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-23 05:47 AM
We face issues while opening the project.
Meanwhile can you let us know if you have modified anything on the code or ioc file shared to you by us?
Also, PB6 IO is made HIGH?
2024-10-23 06:15 AM
Hello,
I didn't remember that I modified something on the configuration. The are some screenshots of CubeMx:
At this stage I prefer that you share your schematics mainly the CAN part.
2024-10-24 05:17 AM
2024-10-24 05:32 AM
Hello,
I don't see any issue in the CAN HW.
Did you test the project I shared and probed CAN frame on PB6?
Is Rx interrupt firing?
2024-10-25 12:37 AM
Hi Expert,
We tried the same project you shared, but no change in the observation. No activity on Tx pin while probing.
Please look into screenshot below:
We are running the code in Debugger mode.
We can see that Tx buffer is getting filled up on executing the code and once Tx buffer is fully filled with 8 bytes, Rx buffer starts to get filled, but only 2 bytes.
Can you let us know if this is the expected behaviour? Why Rx buffer is not fully filled?
Is Rx interrupt firing? ---> How can we check this? Is there any register for this?
2024-10-25 01:02 AM
@ssuresh wrote:
No activity on Tx pin while probing.
Here I'm sure this is not a software issue. Please check again if you are probing on PB6. Check also if you set good parameter on the oscilloscope/Trigger to catch the frame.
@ssuresh wrote:
Hi Expert,
We tried the same project you shared, but no change in the observation. No activity on Tx pin while probing.
Please look into screenshot below:
We are running the code in Debugger mode.
Since you are receiving data, it's a good step.
@ssuresh wrote:
We can see that Tx buffer is getting filled up on executing the code and once Tx buffer is fully filled with 8 bytes, Rx buffer starts to get filled, but only 2 bytes.
Can you let us know if this is the expected behaviour? Why Rx buffer is not fully filled?
Is Rx interrupt firing? ---> How can we check this? Is there any register for this?
Simply because the Tx DLC = 2:
TxHeader.DataLength = FDCAN_DLC_BYTES_2;
Need to modify it to be:
TxHeader.DataLength = FDCAN_DLC_BYTES_8;
My question is: are you familiar with CAN? If not you need to get familiar with it in order to trouble shoot issues.
2024-10-25 04:49 AM
Hi Expert,
Modified the DataLength parameter to below one and now Rx buffer is getting filled. Thanks for the response.
TxHeader.DataLength = FDCAN_DLC_BYTES_8;
But still we could not observe activity on Tx pin in Debugger mode.
Then we disabled the debugger mode and simply booted our system. At this point, we were able to see continuous activity on Tx pin as below
Cannot understand why it did not work when MCU was in debugger mode.
Now let us try the Normal mode and get back to you!
are you familiar with CAN? If not you need to get familiar with it in order to trouble shoot issues -->
No, CAN is new to me.
2024-10-25 05:01 AM
Hello,
Since the first issue has been solved : Frames are seen on Tx. We can close this thread.
Please open a new thread for this behavior on Debug mode.
2024-10-30 02:42 AM