I work with some devices which used STM32 MCU and MCP2561. Theses devices talks on a CAN Bus. Everything is ok.

But when i plug a Raspberry Pi with a MCP2515(Spi) and a MCP2561. I see a lot of invalid frames on my scope like this :

enter image description here

A valid CAN Frame is like : enter image description here

A zoom on the problem : enter image description here

I don't understand why there is a problem at the ACK/ACK Delimiter.

Thank You for your help.

  • \$\begingroup\$ In your 'valid' frame, the ACK slot does not look right either. Why is it only at 2V? I assume you measure not only one line (CANH) but the difference between CANH and CANL, correct? What else is connected to the bus besides the scope? Do you have termination resistor(s) in place? \$\endgroup\$ – JimmyB Jun 21 '19 at 13:17
  • \$\begingroup\$ Looks like the RPI issues an error flag at the end. What do the status registers of the can controller read? \$\endgroup\$ – Jeroen3 Jun 24 '19 at 5:46
  • \$\begingroup\$ None of these are valid CAN frames, what exactly about them looks valid to you? Notably, there is no binary pulse train of data, did you think it was PWM-driven or something? These are repeated error frames at best. You have some fundamental hardware problem. See this: electrical.codidact.com/questions/276251 \$\endgroup\$ – Lundin Jun 30 at 5:51

It could be an electrical issue with one of the CAN signal leads or the grounds. Check the continuity of those.

Next, make sure that the RPi is running some known-good code that initializes the CAN adapter properly. The adapter has to do a lot of work for the CAN protocol. It works semi-autonomously, so if it’s not set up properly it’ll reject frames.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.