Skip to main content
GAgar.1
Visitor II
November 27, 2021
Solved

HAL_CAN_INIT is producing a TIMEOUT error.

  • November 27, 2021
  • 1 reply
  • 1801 views

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?

This topic has been closed for replies.
Best answer by mƎALLEm

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)..

1 reply

mƎALLEm
mƎALLEmBest answer
ST Technical Moderator
November 29, 2021

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 "Best answer" on the reply which solved your issue or answered your question.