2024-06-11 03:38 AM - last edited on 2024-06-11 03:54 AM by SofLit
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.
2024-06-11 06: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.
2024-06-11 03:58 AM - edited 2024-06-11 03: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?
2024-06-11 04: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
2024-06-11 04:30 AM - edited 2024-06-11 04: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.
2024-06-11 04:37 AM - edited 2024-06-11 04: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!
2024-06-11 05:27 AM
Thank you so much for the quick reply
2024-06-11 06: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.