2024-10-21 12:11 AM - last edited on 2024-10-21 01:04 AM by SofLit
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.
Solved! Go to Solution.
2024-10-22 09:51 AM - edited 2024-10-22 09:55 AM
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:
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.
2024-10-21 01:04 AM
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.
2024-10-21 02:46 AM
Yes we tried the external loopback mode and probed Tx pin.
Please see the link we used as the reference.
2024-10-21 03:01 AM - edited 2024-10-21 03:41 AM
Hello,
Please share your code and your ioc file instead of sharing a link to "Controllerstech" youtube channel/links!
2024-10-21 04:01 AM
2024-10-21 04:04 AM
Could you please also share your ioc file?
2024-10-21 04:15 AM
2024-10-21 04:34 AM
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?
2024-10-21 05:16 AM
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.
2024-10-21 05:47 AM
Ok. I will try to run a test on a NUCLEO-G491RE board by tomorrow and will let you know.