cancel
Showing results for 
Search instead for 
Did you mean: 

CAN bus doesn't work in loopback mode

Mr4
Associate III

 

Hi I followed this yt-guide for CAN-bus https://www.youtube.com/watch?v=JfWlIY0zAIc&t=918s

I'm however using a different type of nucleo board (L433RC-P in my case and F103C8tx in the video) and a different type of CAN-transceiver (MCP2561T-E/SN vs MCP2551 in the video). My board uses a different type of can periphery (can1 vs can). My solution to this difference was to just change all of the code where he writes can to can1. Yet checking with an oscilloscope, I don't seem to be sending any CAN signal.

relevant code:

Mr4_0-1707733361123.png

Mr4_1-1707733423132.png

Mr4_2-1707733462396.png

Setup:

Mr4_3-1707733661815.png

Mr4_4-1707733718880.png

 

 

 

12 REPLIES 12
Mr4
Associate III

yes thank you. I meant oscilloscope.

 

Please share your .ioc and main.c files.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
SofLit
ST Employee

Hello,

Attached a project using NUCLEO-L433RC-P on which CAN1 is configured in loopback mode.

Details:

  • System clock @80MHz
  • System clock: HSI
  • CAN1 bitrate @1Mb/s

But be careful, here, HSI has been used as system clock because loopback mode is used. So the timings / jitter are similar on transmit and receive. But when you switch to Normal mode to communicate with another board you need to use HSE with a crystal as source of clock.

Hope it helps.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.