Skip to main content
FSchm.4
Associate
August 4, 2021
Solved

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

  • August 4, 2021
  • 5 replies
  • 2318 views

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.

This topic has been closed for replies.
Best answer by FSchm.4

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

5 replies

FSchm.4
FSchm.4Author
Associate
August 4, 2021

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

Karl Yamashita
Lead III
August 4, 2021

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 a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source
FSchm.4
FSchm.4Author
Associate
August 5, 2021

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
FSchm.4Author
Associate
August 5, 2021

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 III
August 13, 2021

What is your DLC configuration ?

FSchm.4
FSchm.4Author
Associate
August 13, 2021

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
FSchm.4AuthorBest answer
Associate
August 13, 2021

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