cancel
Showing results for 
Search instead for 
Did you mean: 

FDCAN Not Transmitting or Receiving on STM32G0B1CCT6

AKG123
Associate II

I am working on FDCAN communication using an STM32G0B1CCT6 microcontroller. I am trying to perform a simple Tx/Rx loopback test (and later communication with external tools like Vehicle Spy), but I am facing the following problem:

  • FDCAN is not transmitting or receiving any message.

  • I have configured the peripheral in Normal mode with the following settings:

    • Clock: 64 MHz

    • Bitrate: 1 Mbps

    • Prescaler: 16, TimeSeg1: 13, TimeSeg2: 2, SJW: 1

    • Frame Format: Classic CAN

    • Auto-Retransmission: Enabled

  • I also added a filter (Filter 0) to accept all standard IDs into RX FIFO 0, but still no data is received.

  • FDCAN init and message send/receive functions return HAL_OK, but no actual communication happens on the bus.

I’ve verified the transceiver wiring (ISO1044), and I'm testing using Vehicle Spy and ValueCAN4. I’ve also tried internal loopback, but still no response.

8 REPLIES 8
mƎALLEm
ST Employee

Hello,

There are confusing information in your post.

At the beginning you said you are trying to use loopback mode and after you said you have configured the peripheral in Normal mode.


@AKG123 wrote:

I am trying to perform a simple Tx/Rx loopback test 

  • FDCAN is not transmitting or receiving any message.

  • I have configured the peripheral in Normal mode with the following settings


Could you please clarify? what is the more are you using? and which one you succeeded to perform?

 

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.

Hello,

Thank you for the response. To clarify, I have tried both Loopback and Normal mode for FDCAN on my STM32G0B1CCT6, but unfortunately, neither mode is working.

  • Loopback Mode: I set the FDCAN in internal loopback mode, expecting the device to send and receive its own message. However, no data is being transmitted or received.

  • Normal Mode: I also tried normal mode with the correct clock settings, prescaler, and bitrate, but again, no communication happens.

I have verified the transceiver wiring and am using a ISO1044 transceiver, and I am testing with ValueCAN4. But still, there is no TX/RX communication happening.

Can you please share any relevant STM32CubeMX FDCAN settings or suggest what could be missing from my configuration?

Ok, as the Loopback mode is not working it's certainly a configuration issue in your example. So if the loopback mode is not working the Normal mode will not work.

So at this stage forget about the Normal mode and focus on the External Loopback mode. No need for a transceiver in this mode.

So my question here what part is not working: the transmit or the receive? do you have a logic analyzer or oscilloscope to probe the CAN_Tx pin? so at least to check if the transmit is good.

What ID format are you using: Standard or Extended?

 

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.

 

  • Both transmit and receive are not working.

  • I have tested using a logic analyzer and an oscilloscope on the CAN_Tx pin, but I do not see any signal activity when trying to transmit.

  • We are using Standard ID format (11-bit) for FDCAN frames.

 

Ok could you please share your project? if not possible in public you can share it in private.

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.

okay sure

The attached project is using Normal mode.

Please attach a project in Loopback mode. Please test it (check the Tx pin again with the logic analyzer) before attaching it.

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.
mƎALLEm
ST Employee

+

As you are using standard ID format, you have set the filter number to 0:

  hfdcan2.Init.StdFiltersNbr = 0;

In that case even you succeed with Tx, you will never succeed the receive.

So need at least to set that value > 0.

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.