cancel
Showing results for 
Search instead for 
Did you mean: 

FDCAN not working with STM32U5F7

Hareesh_S
Associate II

I'm using a custom board with an STM32U5F7. Written a program(with nothing else configured other than clock and FDCAN) that simply sends out a message via FDCAN (in classis mode, 500kbps) which I'm hoping to receive using a P-CAN. When probing the TX line going to my transceiver using an oscilloscope there seems to be no data being transmitted, the line is just pulled high to 3V3. 

 

The same board populated with an STM32U599 running a new project with the same configuration and same code is able to successfully send messages which I can scope on the TX line.

 

With the STM32U5F7, I have tried internal loopback mode to rule out any hardware related issues (following the FDCAN loopback walkthrough on ST's YouTube) but I'm not receiving messages as well.

 

Not sure what to make of this or how to diagnose and fix the issue I'm facing any further than this. Any input would be highly appreciated 

21 REPLIES 21

That's fair.
And no, I do not get any frame on CAN_Tx with external loopback mode - the pin is just held at VCC. 

Are you sure you are probing CAN_Tx on PB9?

Also set the GPIO pin of Tx and Rx at least to High.

 

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.
Hareesh_S
Associate II

Yes, the board I am using allocates PB8 and PB9 to CAN lines, and test points are provided for the same, which is where I am checking. I can indeed confirm I am probing the right pin as I have tried configuring PB9 as a PWM output to see if is able to toggle at 500KHz, which it is able to cleanly.

The Tx and Rx lines have an external pull up to 3V3, which is why I have not set them as high by default. I have tried by removing the external pull up as well, to no avail.

SofLit
ST Employee

That's weird..

Did you change the GPIO speed to High?

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.
Hareesh_S
Associate II

I have not tried this actually, I assumed it was not the issue since it wasn't causing me issues with the U599. I will try this out and get back at the earliest. Thanks! 

Hareesh_S
Associate II

Hello again.

I can confirm that changing GPIO speeds does not work. Pins are set to "Very High" now, no difference in behaviour.

Hello,

Just tested the project on a compatible MCU (on STM32U5G9 DK board) I've just adapted the value of crystal 25MHz -> 16MHz and it's working perfectly. The Rx callback is raising and the data are receiving very well.

This is the Live Expression and as you can see the value is updating. Just added the incrementation of the first data TxData[0]:

SofLit_0-1726579543668.png

See attached project. So need to check again from your side.

Hope I answered your question.

 

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.
Hareesh_S
Associate II

Hello,

Thank you for attaching a working example. I tried running the same project (only changed the clock source as I have a 32Mhz osc instead) but it is not working.
Given that this is testing internal loopback, is it safe for me to assume the specific MCU I have is just faulty? Not sure how else to proceed at this point.


@Hareesh_S wrote:

Given that this is testing internal loopback, is it safe for me to assume the specific MCU I have is just faulty? 


At this point I can't add more as I don't have the same MCU part number as yours. But there is no difference between the two MCUs from FDCAN stand point.

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.
Hareesh_S
Associate II

That's completely fair. Thank you for your guidance thus far, I'll try  with another board/MCU and see if I can figure something out from my end