cancel
Showing results for 
Search instead for 
Did you mean: 

CAN failed to reinit after deinit for STM32F105

supgz
Associate II

Can failed to reinit after deinit.

1. Two cans was used for my projects which was generated by stm32cubemx

2. after run for a short while , I turn off both cans by HAL_CAN_DeInit

3. then I reinit both cans by MX_canx_init and found it failed in HAL_CAN_Init

4. I have tried to pull both can rx and tx pins but does not work

5. Before reinit I have checked both rx and tx pins is high

supgz_0-1720093361327.png

Questions:

1. Possible reason for can reinit failed.

2. Any checlist for reinit?

 

Thank you & BR

4 REPLIES 4
SofLit
ST Employee

Hello,

See this thread: https://community.st.com/t5/stm32-mcus-products/can-initializing-issue/m-p/689766

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.

Hi SofLit:

    Thanks for your reply.

    I have measured Can_rx pin is high during reinit which means recessive bits.

    reinit still failed.

    is there any other reason for reinit fail?

As stated in the thread I gave, did you implement this requirement?:

SofLit_1-1719315163826.png

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.

Hi SofLit:

   Thanks for your reply.

   I have found the reason is that I deinit the same can twice which cause the reinit failure.

  After modify code the can reinit successfuly.