cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_CAN_INIT is producing a TIMEOUT error.

GAgar.1
Associate

I am using CAN in normal mode and produced code using STM32CubeMX ide for Keil uVision IDE.

While running the code my program stuck in HAL_CAN_INIT(). It produces a timeout error.

I am not having any CAN transceiver so I am having only STM32 Nucleo Board connected to the power supply.

So How to resolve this issue. Is there any way to debug the code without transceiver?

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

Hello,

In CAN normal mode you need to have a complete CAN bus: your board + transceiver and at least another node connected to the bus to establish a CAN communication.

CAN is not SPI or UART. It needs a minimal configuration to establish a communication. That's why there is the loopback mode to run preliminary tests or debug (like your case)..

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.

View solution in original post

1 REPLY 1
SofLit
ST Employee

Hello,

In CAN normal mode you need to have a complete CAN bus: your board + transceiver and at least another node connected to the bus to establish a CAN communication.

CAN is not SPI or UART. It needs a minimal configuration to establish a communication. That's why there is the loopback mode to run preliminary tests or debug (like your case)..

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.