2024-11-11 06:39 AM
Hi
I am trying to send some CAN-bus messages from a STM32H723VGT6
I am following this video to send standard CAN messages in external loopback mode (https://www.youtube.com/watch?v=kXyzaaSk6Qs&t=568s&ab_channel=ControllersTech).
The code seems to be working as I am using some blinking LEDs to monitor the sending and receiving of messages
However I tried to connect an oscilloscope to the bus to monitor the waves and I am not able to see the messages that are being sent from the board
To make sure that my setup is working correctly I added another node to the bus and I am able to read its messages correctly (I made sure to have the bus resistance set to 60ohm)
Do you have any idea why the board woud appear to be able to send and receive messages in external loopback mode but we only see radio silece with the oscilloscope?
If I try to use Nomal mode instead I keep seeing nothing with the oscilloscope and after a couple of second the LED stops blinking and I get error 512 (the other node is still connected to the bus)
Attached you can find both the code and the schematics of the board I am using. Note however that there is a mistake in the schematics. The pins used for CANbus and USB are swapped. So in the actual board pins PA11/PA12 are used for CANbus and PB8/PB9 are used for usb.
Solved! Go to Solution.
2024-11-12 01:54 AM - edited 2024-11-12 05:17 AM
Hello,
I've tested your code (I've attached a complete project) on NUCLEO-H723 and I could see CAN frames on Tx (PA12):
Zoom-out:
Zoom-in:
Now, I'm pretty sure there is something on the HW:
Either you have something forcing the Tx output on the board or you are not probing the right pin or you have something wrong on the oscilloscope: probe issue, config issue etc ..
So what I suggest at this stage is to try to toggle the pin PA12 (FDCAN_Tx) and check with the oscilloscope if it's toggling well ..
Hope it helps.
2024-11-11 06:54 AM - edited 2024-11-11 06:55 AM
Hello,
This is the continuation of this thread: https://community.st.com/t5/stm32-mcus-products/stm32h723vgt6-fdcan-0x20-error-on-trasmission/td-p/741256
There are confusions in this new post.
Your are using Loopback then you test in normal mode.
Let's keep Loopback mode as indicated in the title.
My questions in loopback mode:
1- Did you have FDCAN Rx interrupt firing?
2- Are you sure Tx/Rx pins are not connected to nothing in the board as I suggested in the other thread (mentioned above)? This is an important point.
2024-11-11 07:20 AM
Sorry I pressed accept solution by mistake
Sure let's clear up loopback mode first
1- Yes FDCAN Rx interrupt is firing. I connected it with a led to make sure
2- Yes, the tx rx pins are connected only to the canbus connector. I verified this with a multimeter
2024-11-11 07:29 AM - edited 2024-11-11 07:31 AM
@Angelo3 wrote:
Sorry I pressed accept solution by mistake
I removed it.
If the Rx interrupt is firing you've already almost did the job.
Based on your CubeMx config:
It's OK but could you please modify the speed of the IO to be High?
Meanwhile, your main is not complete as indicated in the previous thread, please share the complete main.c you are using for the test.
Are you sure you set the correct trigger level and edge on the oscilloscope?
2024-11-11 07:47 AM
2024-11-11 08:40 AM
Hello,
I will try to test it tomorrow on a Nucleo board and get back to you with the results.
2024-11-12 01:54 AM - edited 2024-11-12 05:17 AM
Hello,
I've tested your code (I've attached a complete project) on NUCLEO-H723 and I could see CAN frames on Tx (PA12):
Zoom-out:
Zoom-in:
Now, I'm pretty sure there is something on the HW:
Either you have something forcing the Tx output on the board or you are not probing the right pin or you have something wrong on the oscilloscope: probe issue, config issue etc ..
So what I suggest at this stage is to try to toggle the pin PA12 (FDCAN_Tx) and check with the oscilloscope if it's toggling well ..
Hope it helps.