cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 DISCOVERY board CAN example

gowtham K
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
gowtham K
Associate II

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.

View solution in original post

2 REPLIES 2
Uwe Bonnes
Principal III

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

gowtham K
Associate II

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.