cancel
Showing results for 
Search instead for 
Did you mean: 

No activity observed in Tx pin of FDCAN in STM32G491KCU6

ssuresh
Associate II

Hi STM Expert,

We are currently working on STM32G491KCU6 MCU FDCAN side. Our requirement is to validate the activity on Tx and Rx pins.

We started off the testing with the LoopBack mechanism but unfortunately we were not able to see any data received in the Rx buffer. We referred sample FDCAN programs for this and tested the same in STM IDE Debugger mode.

We then moved to test the normal mode as well. For this we used a sample code and probed the Tx pin of FDCAN using an oscilloscope. During the transmission, no activity is seen on the oscilloscope.

We confirmed the pins are not damaged by setting FDCAN_Tx and FDCAN_Rx pins to GPIO and toggled it.

 

Please let us know what we have missed and guide us.

1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

I tested your project and I probed CAN frames on Tx without any issue and the Rx callback is also triggering.

This is a screenshot of CAN frame on PB6:

SofLit_0-1729615700345.png

Attached the project that I tested on NUCLEO-G491RE board.

So I suspect something wrong on PB6 on you board: either something forcing the pin level voltage or you are not probing the right pin!

Hope it 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.

View solution in original post

28 REPLIES 28
SofLit
ST Employee

Hello @ssuresh ,

For Loopback mode, please share your code. You can probe only on Tx  pin in External Loppback mode.

For Normal mode you need to establish a CAN node, on which at least, another node is connected with the same baudrate.

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

Yes we tried the external loopback mode and probed Tx pin.

Please see the link we used as the reference.

https://controllerstech.com/stm32-fdcan-in-loopback-mode/

Hello,

Please share your code and your ioc file instead of sharing a link to "Controllerstech" youtube channel/links!

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

Hi STM Expert,

Sorry for the inconvenience caused.

Sharing you the main.c file having the code we tested.

Could you please also share your ioc file?

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

Sharing you the file

 

Ok thank you. For the moment I don't see and issue in your config.

If you can replace:

hfdcan2.Init.FrameFormat = FDCAN_FRAME_FD_NO_BRS;

by 

hfdcan2.Init.FrameFormat = FDCAN_FRAME_CLASSIC;

What happens?

Also, please set PB6 IO to High instead of Low.

Another question: are you sure there is nothing connected to PB6 apart of the CAN transceiver?

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

Replacing the frame format did not help. Still no activity on the Tx pin.

please set PB6 IO to High instead of Low -> Done, Please check the attachment.

are you sure there is nothing connected to PB6 apart of the CAN transceiver? -> right now CAN transceiver is isolated from MCU and we are just checking the MCU side alone.

 

 

Ok. I will try to run a test on a NUCLEO-G491RE board by tomorrow and will let you know.

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.