# Libuavcan CubeMX FreeRTOS SystemWorkbenchForSTM32

**URL:** <https://forum.opencyphal.org/t/libuavcan-cubemx-freertos-systemworkbenchforstm32/430>\
**Category:** LibCyphal\
**Created:** [April 7, 2019, 8:52pm UTC](https://forum.opencyphal.org/t/libuavcan-cubemx-freertos-systemworkbenchforstm32/430 "2019-04-07T20:52:32Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![raimondas](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/r/91b2a8/32.png) [@raimondas](https://forum.opencyphal.org/u/raimondas)\
**Post date:** [September 10, 2019, 11:03am UTC](https://forum.opencyphal.org/t/libuavcan-cubemx-freertos-systemworkbenchforstm32/430/21 "2019-09-10T11:03:47Z")

</div>

In my Case I don’t used cubemx CAN configuration, because libuavcan has own configuration, I only making GPIO pins initalization. My main problem was, what newest version has issues what was discussed in this topic, I just tooked a little bit older version and it began working. Some working examples are at [https://github.com/raimapo](https://github.com/raimapo). Only server side in examples are not implemented, everything is in readme.md explained.

---

<div class="post-metadata">

**Author:** ![RuslanUrya](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/ruslanurya/32/467_2.png) [@RuslanUrya](https://forum.opencyphal.org/u/RuslanUrya)\
**Post date:** [September 10, 2019, 11:20am UTC](https://forum.opencyphal.org/t/libuavcan-cubemx-freertos-systemworkbenchforstm32/430/22 "2019-09-10T11:20:12Z")

</div>

Thank you, Raimondas, I will see your repo)

---

<div class="post-metadata">

**Author:** ![RuslanUrya](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/ruslanurya/32/467_2.png) [@RuslanUrya](https://forum.opencyphal.org/u/RuslanUrya)\
**Post date:** [September 10, 2019, 11:43am UTC](https://forum.opencyphal.org/t/libuavcan-cubemx-freertos-systemworkbenchforstm32/430/23 "2019-09-10T11:43:48Z")

</div>

[Raimondas Pomarnacki](https://forum.opencyphal.org/u/raimondas),I watched. In your example, the same actions are described as in mine. The initialization of the GPIO is also the same. Perhaps there is a bug in the library, but I think I missed something or did something wrong. I’ll think more, but if I don’t solve the problem, I will switch to another version.)

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [September 10, 2019, 11:47am UTC](https://forum.opencyphal.org/t/libuavcan-cubemx-freertos-systemworkbenchforstm32/430/24 "2019-09-10T11:47:22Z")

</div>

> [@RuslanUrya](#):
>
> Perhaps there is a bug in the library, but I think I missed something or did something wrong.

Could be wiring. Could you show us a pic and/or a schematic diagram of your electrical connections?

---

<div class="post-metadata">

**Author:** ![RuslanUrya](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/ruslanurya/32/467_2.png) [@RuslanUrya](https://forum.opencyphal.org/u/RuslanUrya)\
**Post date:** [September 10, 2019, 1:11pm UTC](https://forum.opencyphal.org/t/libuavcan-cubemx-freertos-systemworkbenchforstm32/430/25 "2019-09-10T13:11:12Z")

</div>

For prototyping of my node I used:

1. Nucleo-F429ZI
2. WCMCU-2551 MCP2551 CAN BUS interface module
3. 2 resistors 120 Om
4. bread board

For prototyping of slcan I used:

1. STM32F103C8T6
2. WCMCU-2551 MCP2551 CAN BUS interface module
3. USB-UART bridge
4. bread board

All system:

 ![image](https://forum.opencyphal.org/uploads/default/original/1X/bc205e96510af5d9fcb319d62087e92ac53e6893.jpeg)

Connecting of Nucleo and interface module:

 ![image](https://forum.opencyphal.org/uploads/default/original/1X/696a7eb6998aab256a9a1c9a335e094d7738f33a.jpeg)  
**Nucleo → CAN interface**  
can1\_txo → ctx (“transmitter IN” logic)  
can1\_rxi → crx (“receive OUT” logic)

Photo with the bus between resistors (red line - CANH, blue line - CANL) :

 ![image](https://forum.opencyphal.org/uploads/default/original/1X/036c4b2829e34ce446e51e35cba3d174e16361f6.jpeg)

I`m sorry for bad culture of manufacturing 😬😥. I have not the wiring diagrams, but can make if need.

---

<div class="post-metadata">

**Author:** ![j3qq4hch](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/j3qq4hch/32/26_2.png) [@j3qq4hch](https://forum.opencyphal.org/u/j3qq4hch)\
**Post date:** [September 10, 2019, 2:28pm UTC](https://forum.opencyphal.org/t/libuavcan-cubemx-freertos-systemworkbenchforstm32/430/26 "2019-09-10T14:28:17Z")

</div>

Hi! Could you please try to remove terminating resistors at all, as they are placed weirdly and with your line length they are not really needed.  
Also, I noticed one more thing.

 ![image](https://forum.opencyphal.org/uploads/default/original/1X/fe3f9a03be88c24a443b07e536e0e52cc4727c8a.jpeg)  
Try removing these resistors in green ovel from your WCMCU-2551 boards in order to exclude all excessive components from the line.

---

<div class="post-metadata">

**Author:** ![RuslanUrya](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/ruslanurya/32/467_2.png) [@RuslanUrya](https://forum.opencyphal.org/u/RuslanUrya)\
**Post date:** [September 14, 2019, 11:45am UTC](https://forum.opencyphal.org/t/libuavcan-cubemx-freertos-systemworkbenchforstm32/430/27 "2019-09-14T11:45:08Z")

</div>

Thanks for the answer, [Alexander Sysoev](https://forum.opencyphal.org/u/j3qq4hch)) I tried to remove the terminators. Nodes (slcan and my node) was emitting frames of errors. The resistors on the board are needed to maintain a recessive state, I do not think that they need to be removed. slcan works well under these conditions.

If look at schedule of my nodes working (my post above), can see periodic short pauses. As I understanding, during these pauses a some reboot occurs. I cant capture it in debug.

And one more, mcp2551 has next logic:

1. Dominant on the bus = 0 on the TxD/RxD
2. Recessive on the bus = 1 on the TxD/RxD  
UAVCAN has the same logic, or this question needs addressing to stm32?

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [September 16, 2019, 3:25pm UTC](https://forum.opencyphal.org/t/libuavcan-cubemx-freertos-systemworkbenchforstm32/430/28 "2019-09-16T15:25:46Z")

</div>

> [@RuslanUrya](#):
>
> UAVCAN has the same logic

Yes. UAVCAN works on top of the standard CAN.

It’s hard to debug a hardware problem remotely. Perhaps you could arrange a video call with Alexander if he’s available, or ask for help at [electronix.ru](https://electronix.ru/).

---

<div class="post-metadata">

**Author:** ![RuslanUrya](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/ruslanurya/32/467_2.png) [@RuslanUrya](https://forum.opencyphal.org/u/RuslanUrya)\
**Post date:** [October 13, 2019, 3:37pm UTC](https://forum.opencyphal.org/t/libuavcan-cubemx-freertos-systemworkbenchforstm32/430/29 "2019-10-13T15:37:25Z")

</div>

Hello everybody) I was absent for a long time. Today I continued my work and fixed my problem. I started over and opened “chip.h”, wich contains general defines for communication with hardware of a MCU. STM32\_PCLK1 was defined by number from example (42000000), but was nor correct for work. I changed this number to “HAL\_RCC\_GetPCLK1Freq()” and slCAN reception has begun.Thanks to all for the help!) I continue to work.

 ![rx](https://forum.opencyphal.org/uploads/default/original/1X/ac84bd140421a59357b2f484f47c73d605a49d3a.png)

[Previous page](https://forum.opencyphal.org/t/libuavcan-cubemx-freertos-systemworkbenchforstm32/430.md?page=1)
