FDCAN on STM32G0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-11 3:38 AM - last edited on ‎2024-06-11 3:54 AM by mƎALLEm
Hi,
I am trying to communicate via FDCAN with a board equipped with a STM32G0 by using this library https://github.com/owennewo/SimpleCAN
I already tested it successfully with both STM32H743 and STM32H723 but I am having troubles with the G0
When I try to send a message from the G0 I get error code 200 back from the serial logs
Does anyone have an idea of why is this happening?
Solved! Go to Solution.
- Labels:
-
FDCAN
-
STM32G0 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-11 6:04 AM
Hello,
For PlatformIO: we don't support such a platform. Please use ST tools, mainly CubeMx/HAL in order to support you efficiently.
Since loopback mode is working fine, I suspect two issues:
- Hardware issue: connection or something else ..
- Clock config: Need to use HSE with an external crystal instead of HSI.
What about bit timing config: CAN prescaler, NBS1 and NBS2 values?
Please consider all above points I pointed out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-11 3:58 AM - edited ‎2024-06-11 3:59 AM
Hello and welcome to the ST community,
First, STM32H7 and and STM32G0 don't have the same FDCAN implementation.
Second, what HW are you using? could you please provide more details?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-11 4:19 AM
Yes but I was hoping that the library was able to astract the different implementations based on the hals
Here is the board I am using https://github.com/bigtreetech/EBB/tree/master/EBB%20CAN%20V1.1%20(STM32G0B1)/EBB42%20CAN%20V1.1
It is equipped with a STM32G0B1CBT6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-11 4:30 AM - edited ‎2024-06-11 4:32 AM
Hello,
Thank you for the answer.
First I invite you using CubeMx to create the project and configure the FDCAN from the GUI based on G0 product.
Second, from your shcematics: https://github.com/bigtreetech/EBB/blob/master/EBB%20CAN%20V1.1%20(STM32G0B1)/EBB36%20CAN%20V1.1/Hardware/BIGTREETECH%20EBB36%20CAN%20V1.1-SCH.pdf the transceiver used on your board is SN65HVD1050DR which is 1Mb/s max baudrate. So you can't exceed 1Mb/s with FDCAN.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-11 4:37 AM - edited ‎2024-06-11 4:51 AM
Third: did you try Loopback mode? it's interesting to use this mode in order to locate the issue.
Fourth: What is the clock source you are using? and what is the node connected on the other side of your CAN bus?
PS: HAL_FDCAN_ERROR_FIFO_FULL ((uint32_t)0x00000200U) /*!< Get element from empty FIFO. -> seems there is no transmitted frame until the FIFO is get full!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-11 5:27 AM
Thank you so much for the quick reply
- We are using PlatformIO and a StLink programmer to configure the MCU
- We set the baudrate of all the nodes to 125000 which shoud be well under 1Mb/s
- Yes we tried loopback mode and it seems to be able to receive its own messages
- PlatformIO already supports this board, (here are the config files https://we.tl/t-2GpoxtnjeU). From the board json file the clock frequency should be "f_cpu": "64000000L".
- The other node connected to the bus is a BTT Kraken equipped with a STM32HT723VG. We connected an oscilloscope in between the two and we are able to see and decode the wave coming from the H7 but it's only radio silence from the G0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-06-11 6:04 AM
Hello,
For PlatformIO: we don't support such a platform. Please use ST tools, mainly CubeMx/HAL in order to support you efficiently.
Since loopback mode is working fine, I suspect two issues:
- Hardware issue: connection or something else ..
- Clock config: Need to use HSE with an external crystal instead of HSI.
What about bit timing config: CAN prescaler, NBS1 and NBS2 values?
Please consider all above points I pointed out.
