Electronic – MCP2551 with STM32 MCU

canstm32transceiver

im learning about the CAN protocol, and bought the transceiver module MCP2551 like this:

enter image description here

I made the driver for CAN controller first in loopback mode for debug, im sending the numbers 1,2,3 and 4 with 1s of interval. Without the transceiver connected to the microcontroller, messages are sent correctly, for example when the number 2 is sent with an ID of 0xff;

enter image description here

But when i connect the transceiver to the mcu, the message is corrupted:
enter image description here

So i think that is something related to the transceiver itself, it is not a driver problem, I checked the connections and everything is fine, has anyone had this problem to help me?

The peripheral connection is below:
enter image description here

There is one more connection thas is not in the image which is the gnd of STM with gnd of arduino, but the problem is before, because i have not tested the CAN in normal mode but in loopback. I think that the problem is (PA12, CTx) AND (PA11, CRx) connection or with the transceiver. This is more likely.

Best Answer