cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743ZI2 CAN message receive issue with MCP2551

SAmpi.1
Associate

I have hooked up a STM32H743ZI2 Nucleo board with a CAN tranceiver MCP2551 following the instructions kindly provided by mr. Hudak (https://os.mbed.com/users/hudakz/code/CAN_Hello/) with the exception of replacing the second board with a USB-CAN-module and sending responses from the pc.

This setup sends CAN messages just fine but doesn't seem to be able to receive the messages sent to the STM board as the attached interrupt event function is never called. Attached is a screenshot of the CAN and serial traffic. By examining the RX pin with oscilloscope I have determined the voltage levels to be sensible and the message is sent from the MCP2551 to the RX pin.

Could this be a problem with the setup of pin interrupts or am I missing some other additional steps that must be taken to set up MCP2551 to work with the STM32H7 board?

3 REPLIES 3
JoniS
Senior
#define BOARD1
...
...
#if defined(BOARD1)
    const unsigned int  RX_ID = 0x100;
    const unsigned int  TX_ID = 0x101;
 can.filter(RX_ID, 0xFFF, CANStandard, 0); // set filter #0 to accept only standard messages with ID == RX_ID

You send messages with 0x101 ID based on your screenshot, your hardware only accepts 0x100 with that filter.

Thank you for your feedback.

However, I'd like to point out that the IDs are in fact correct as the serial terminal window represents the STM32 board having TX_ID = 0x101 and the CAN bus monitor window on the background showing that the messages sent from the pc have an ID of 0x100. Additionally commenting the filter

can.filter(RX_ID, 0xFFF, CANStandard, 0); // set filter #0 to accept only standard messages with ID == RX_ID

out alltogethter yields no results either.

LMart.6
Associate

Hi, Sampi,

I am facing a similar problem here, did you come up with a solution to yours?