cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F072 CAN LoopBack error on logic analyzer

Oli98
Associate II
 

Dear reader,

I am trying to get the CAN peripheral on my STM32-NUCLEO board working. To start off i wanted to test the loopback mode before I hooked up my transceiver circuit.

Heres my init code for the can peripheral generated by CubeMX:

Oli98_1-1701379345715.png

Heres my CAN MSPinit code:

Oli98_2-1701379430426.png

Heres my main where im attempting to send a messaeg through the peripheral:

Oli98_3-1701379475889.png

I also used the CAN Bit Time Calculation (can-wiki.info) to find the correct settings for my CAN perpheral aswell as shown here: 

Oli98_4-1701379662680.png

 And this is the output from my logic analyzer, i of course checked that the bit rates matched aswell:

Oli98_5-1701379735891.png

The callback function to receive messages is never called as the RX pin on the CAN peripheral is always high, im very stumped by this and have seen various tutorials online and cant figure out if im missing something.

Any help would be greatly appreciated!

2 REPLIES 2
Karl Yamashita
Lead III

You haven't shown any CAN filter configuration

Tips and Tricks with TimerCallback https://www.youtube.com/@eebykarl
If you find my solution useful, please click the Accept as Solution so others see the solution.

Hi Karl!

Thankyou for the reply, my filter settings:

Oli98_0-1701422607256.png

My aplogies I didnt think these were important at this stage as I was trying to get my transmission working from the peripheral first.