Skip to main content
Visitor II
July 4, 2024
Solved

CAN failed to reinit after deinit for STM32F105

  • July 4, 2024
  • 1 reply
  • 1145 views

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

    This topic has been closed for replies.
    Best answer by supgz

    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.

    1 reply

    Technical Moderator
    July 4, 2024
    supgzAuthor
    Visitor II
    July 5, 2024

    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?

    Technical Moderator
    July 5, 2024

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

    SofLit_1-1719315163826.png