cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F767ZI and CAN-Bus: Bus-Off error after receiving 8 byte long message

FSchm.4
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
FSchm.4
Associate II

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%.

View solution in original post

7 REPLIES 7
FSchm.4
Associate II

This is a screenshot from the Trace Window of the PCANView:0693W00000D1UYRQA3.png

Karl Yamashita
Lead II

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?

If you find my answers useful, click the accept button so that way others can see the solution.

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.

FSchm.4
Associate II

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

DCtech
Associate II

What is your DLC configuration ?

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.

FSchm.4
Associate II

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%.