cancel
Showing results for 
Search instead for 
Did you mean: 

CAN FD network normal mode does not work with NUCLEO-C092RC boards

BNE
Associate II

Hello everyone,

 

i want to build a CAN FD network with three NUCLEO-C092RC boards. So far i can transmit frames, as i can see on an oscilloscope. But the moment i connect TWO boards, the interrupt is not triggered. My code should activate user LED2 if it receives a frame with one specific id:

Board 1 (0x101) triggers LED when receiving message 0x344 or 0x234

Board 2 (0x234) triggers LED when receiving message 0x344 or 0x101

Board 3 (0x344) triggers LED when receiving message 0x101 or 0x234

 

i use a nom. baudrate of around 500 kbit/s and data baudrate of 1 Mbit/s with a clock of 40 MHz (HSE).

The Boards are connected with two short (10cm) twisted jumper cables and the jumpers for the 120 Ohm resistor are also plugged in on both baords.

when i test it in external loopback mode, it works (with ident. change)

Could this just be a problem with my wires (reflexion , parasi. C ,etc.)?

 

thanks a lot for the help

19 REPLIES 19

Hello,

I don't see you put STDBY pin to 0 to wake  the transceiver up.

There is an internal 10K pull down on the board on STBY pin:

mALLEm_0-1777379426584.png

But there is an internal Pull up on it (~33k). To me it's a bit conflicting:

mALLEm_2-1777380498778.png

mALLEm_0-1777380899916.png

So set the STBY to 0 (Transceiver_STDBY_Pin in your code).

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, the datasheet says exactly the same: STBY pin needs low state for the transceiver to be in Normal mode.

ghibli_0-1777385541316.png

ghibli_4-1777386096380.png

 

 

 

BNE
Associate II

Idk what it was, but now it works with 500kBit/s. I think, i flashed the same software everytime. Now i have just one project and change the if-statements and IDs manually.

Stdby was not the problem, because i already had frames. This is pin is set as RESET in my GPIO setup function. Now i hope, i can just bump up the speed and switch back to CAN FD. As far as i know the transceiver can handle up to 5 Mbit/s.

 

Thank you all for the support

If the Standby pin was not the problem why marking the solution as answered then?

Meanwhile, you have another issue in the clock config.

You are using HSE but you set the crystal to be 40MHz while on the board the crystal is 48MHz:

mALLEm_1-1777389201305.png

 

mALLEm_0-1777389166138.png

It works because you are using the same board with the same software but if you connect another CAN node it won't work because there will be a mismatch in the CAN bitrate.

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

Another issue I've just detected in your configuration:

mALLEm_0-1777389471604.png

Nominal bitrate is at 2.5Mb/s!! You must not exceed 1Mb/s in the nominal phase 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.

To correct myself:


@mƎALLEm wrote:

mALLEm_0-1777380899916.png

So set the STBY to 0 (Transceiver_STDBY_Pin in your code).


The 33K pull-up resistor was on TxD pin of the tranceiver while on STDBY, the internal resistor ranges from 660K to 4.4M according to the VIO voltage.

mALLEm_0-1777457338138.png

Sorry for the wrong information.

This post will be unmarked.

mALLEm_1-1777457432938.png

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

Hello,

I've created a project running on two NUCLEO-C092RC boards. Two IDs have been used: 0x555 and 0x777. Refer to the #define at the beginning of the main.c.

Nominal phase bitrate: 500kb/s, (sample point set @87.5%) Data phase bitrate: 1Mb/s (sample point set @68.75%), 12 bytes are transmitted/received.

HSE: 48MHz as available on the board.

The blue LED is toggling while receiving a FDCAN frame over HAL_FDCAN_RxFifo1Callback() callback.

I've attached the project. I used IAR but you can generate the project for CubeIDE.

Hope that helps.

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.

Thanks @mƎALLEm, very useful!

Ok, that was my problem with CAN-FD- I thought i would work. Now i am trying to build the network with nom. 1MBit/s and 4,8 MBit/s as data. This is not a private project. It is for a test setup. The idea is to take a look at, what happens, if we have a very high bitrate and long wires to hopefully see reflexions and communication error. That's why i set the bitrates very high. Since 5MBit/s is not really possible with 48 MHz, i will take 4,8 MHz.

 

Thank you very much for the support. So far the combination with 1MBit/s and 4,8MBit/s seems to work. I think it was because i set nom. speed way to high.

Thank your for the example