cancel
Showing results for 
Search instead for 
Did you mean: 

STM32-HAL CAN transmits empty messages

LFili.2
Associate

I'm trying to transmit messages through CAN using HAL library. For test I repeated code from the first part of this video I have the same bluepill so I just did the same. Also I've tried his project, but changing Nucleo RE to ZE model. I've looked through other sources and they all do the same thing, and in their videos/articles bus perfoms as it is supposed to.

But on all of my devices

HAL_CAN_AddTxMessage

produces empty (or maybe error) message

0693W00000KaJJxQAN.pngTheese different lines are TX on one board and RX from other transcievers.

Debugging showed me nothing wrong: function returns "HAL_OK". I went step by step through this function in debug mode and everything seemed as normal. But niether loopback nor normal mode transmitts correct message.

Also I've checked my LA with MCP2515 + TJA1040 and CAN bus worked as it has to

0693W00000KaJKbQAN.pngSo I'm confused and don't understand what I'm doing wrong.

P.S. Also in loopback mode interrupt doesn't happen as well as in normal mode and data frames are empty too

0 REPLIES 0