Skip to main content
gowtham K
Associate II
June 26, 2019
Solved

STM32F407 DISCOVERY board CAN example

  • June 26, 2019
  • 2 replies
  • 888 views

I have tried to get the CAN peripheral up and running on STM32F407 discovery board.

But I am stuck at one point.

Inside method HAL_CAN_Init(CAN_HandleTypeDef *hcan), I end up in the HAL_CAN_STATE_ERROR.

Is there any example available to test on the discovery board and to cross verify mistake made in my code..

I have used STMCubeMX to generate the skeleton code and have written the CAN initialization in the user code block.

This topic has been closed for replies.
Best answer by gowtham K

Yes. Found the solution. Before the CAN terminals are floating. When connected to CAN transceiver (now terminated), it started working as expected.

Thanks for the reply.

2 replies

Uwe Bonnes
Chief
June 26, 2019

What is connected to the CAN pins. CAN startup expects to see the behaviour of a terminated CAN line.

gowtham K
gowtham KAuthorBest answer
Associate II
June 26, 2019

Yes. Found the solution. Before the CAN terminals are floating. When connected to CAN transceiver (now terminated), it started working as expected.

Thanks for the reply.