cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F303 and L9616 CAN transceiver

enhering
Associate III

I have a STM32F303 connected to a L9616 as displayed below. 

enhering_0-1711296523818.png

enhering_1-1711296567728.png

The pullup resistor R3 is not present any more. Please ignore it. 
Vdd is 3.3V but, as can be seen, I have set Vs to 5V, believing that was necessary to make the CAN BUS work.

With an oscilloscope channel connected between CAN_BUS_H and GND I can see a Tx pulse train, but STM32 HAL reports state 2 and error 43 (0x2B) after transmission. If I understood well, this means 0x20 + 0x10 + 0x1 which leads me to believe that the following three errors are occurring:

#define HAL_CAN_ERROR_EWG (0x00000001U) /*!< Protocol Error Warning */
#define HAL_CAN_ERROR_FOR (0x00000010U) /*!< Form error */
#define HAL_CAN_ERROR_ACK (0x00000020U) /*!< Acknowledgment error

Besides that reported error, the most annoying fact is that I tried many ways to fire the Rx Callbacks on another node with similar configurations, without success. 

When investigating the problem I measured, on the reception node, CAN_TX at 3.3V and CAN_RX at 5V. I believe this 5V at CAN RX is, somehow, blinding STM32 from the Rx transceiver signal. 

Can you help me with some information? Or could you please share a proved working connection diagram between STM32 and L9616 with me? 

Best regards,

Hering

23 REPLIES 23

Thanks for all the information! I'll measure the exact bitrate to be sure about it.

The oscillator I'm using is an Abracon SMD.

enhering_0-1711457088581.png

 

Your HSE Bypass configuration is correct.

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.
enhering
Associate III

Hello @SofLit,

Substituting the L9616 for the MCP2561 solved the reception problem. The 8 byte sequence sent by one module is received correctly by the other module. Also, the transmission and reception callbacks are being fired, which is much much better than what I had before. Thanks a lot for helping with that!
But the module that is sending the message is reporting error 4129, or 0x1021, or:

#define HAL_CAN_ERROR_EWG (0x00000001U) /*!< Protocol Error Warning */
#define HAL_CAN_ERROR_ACK (0x00000020U) /*!< Acknowledgment error */
#define HAL_CAN_ERROR_TX_TERR0 (0x00001000U) /*!< TxMailbox 1 transmit failure due to transmit error */

I'm going to verify the bitrate and set it to a standard value to see if the error stops.

Thanks again for your kind help.

Hello,

Thank you for the feedback.

I'm closing this thread as the transceiver issue has been solved. Now the issue is something else . You can open a new thread for this.

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.