2021-08-04 02:12 AM
Hello everyone,
i am currently trying to get the can bus on my Nucleo-F767ZI running.
Now i got a problem that every time i sent a message via CAN (from my PCANView) which is longer than two bytes i got a Bus-Off error, but if byte 2 is not empty i can sent messages with more bytes. Maybe someone here can explain to me what i am doing wrong. If you need everything else for helping me, i will upload the requested files.
Thank you for your time and help.
Solved! Go to Solution.
2021-08-13 10:51 AM
It seems the problem was with the sample point of the CAN from 87.5% to 75% now it works with varying byte length.
Interesting is that the same code works on my Nucleo L476RG with varying byte lengths and the old sample point of 87.5%.
2021-08-04 02:21 AM
This is a screenshot from the Trace Window of the PCANView:
2021-08-04 08:06 AM
Edit: Scratch what i said before. Have you tried to break on the HAL_CAN_RxFifo0MsgPendingCallback to see if you are interrupting and receiving the correct ID and data?
2021-08-05 12:38 AM
Thank for your reply,
i tried the first sugesstion from you and that did not work and
if i set a breakpoint at the HAL_CAN_RxFifo0MsgPendingCallback and step into the function,
the ID and data are correctly processed.
If you like i could upload the full project as Zip file if that helps.
Thank you for your time and help.
2021-08-05 01:42 AM
I tryed to check the rx_data array with live expression view.
It seem when i am sending 4 bytes that are not zero, that the upper 4 bytes are getting also filled with data. For example byte 4 to 6 are filled with 0xff and byte 7 ist filled with random numbers between 0x00 and 0xff
2021-08-13 02:11 AM
What is your DLC configuration ?
2021-08-13 10:46 AM
Thank you for your reply,
the tx_header.DLC ist set to 8 for the STM and the PCAN DLC is also set to 8.
2021-08-13 10:51 AM
It seems the problem was with the sample point of the CAN from 87.5% to 75% now it works with varying byte length.
Interesting is that the same code works on my Nucleo L476RG with varying byte lengths and the old sample point of 87.5%.