cancel
Showing results for 
Search instead for 
Did you mean: 

FDCAN on STM32G0

Angelo3
Associate III

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

6 REPLIES 6
SofLit
ST Employee

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?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

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

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.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
SofLit
ST Employee

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!

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Thank you so much for the quick reply

  1. We are using PlatformIO and a StLink programmer to configure the MCU
  2. We set the baudrate of all the nodes to 125000 which shoud be well under 1Mb/s
  3. Yes we tried loopback mode and it seems to be able to receive its own messages
  4. 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".
  5. 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 

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.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.