Skip to main content
gowtham K
Associate II
Jun 26, 2019 10:17 AM UTC
Solved

STM32F407 DISCOVERY board CAN example

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.
gowtham K
gowtham KBest answer
Associate II
Jun 26, 2019 11:09 AM UTC

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
Jun 26, 2019 10:51 AM UTC

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
Jun 26, 2019 11:09 AM UTC

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.