Skip to main content
Sebastian Ulrich
Associate
April 25, 2017
Solved

leaving CAN intialization mode fails (MSR->INAK not reset)

  • April 25, 2017
  • 2 replies
  • 1108 views
Posted on April 25, 2017 at 08:56

 

 

The original post was too long to process during our migration. Please click on the attachment to read the original post.
    This topic has been closed for replies.
    Best answer by Sebastian Ulrich
    Posted on September 27, 2017 at 05:01

    Finally we got the solution.

    The problem was, the wrong configuration of the alternate function.

    GPIO_AF_CAN2
    

    // has to be replaced with GPIO_AF_9

    That's all.

    2 replies

    Technical Moderator
    April 25, 2017
    Posted on April 25, 2017 at 12:12

    Hi

    ulrich.sebastian

    ,

    We need more details onyour

    configuration ofCAN hardware, how you initialize the pins, clocks...

    Have you enabled GPIO clock, ...?

    About

    format source code, y

    ou should expand toolbar by clicking on [

    ...

    ] icon :

    0690X00000606rPQAQ.png

    Click on ''More >> Syntax Highlighter'' :

    0690X00000606p0QAA.png

    Then, insert your code in the appropriatelanguage:

    0690X00000606jCQAQ.png

    Thanks

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    Sebastian Ulrich
    Associate
    April 26, 2017
    Posted on April 26, 2017 at 16:03

    Hello Imen,

    I added the code of the initialization routine.

    There you can see, that the GPIO clock is enabled. See line 28 and following.

    The function 'RCC_GetGPIOClock' simply checks the port, provided by the (proprietary, not the ST CAN_InitTypeDef) init-structure and then returns the matching identifier.

    The same applies to the function 'RCC_GetPinSource'.

    I hope this helps understanding the code or the problem.

    If I have to mark the action as 'done' please tell me how to do this.

    The mechanisms of this community are somewhat confusing to me.

    Sebastian.

    Sebastian Ulrich
    Sebastian UlrichAuthorBest answer
    Associate
    September 27, 2017
    Posted on September 27, 2017 at 05:01

    Finally we got the solution.

    The problem was, the wrong configuration of the alternate function.

    GPIO_AF_CAN2
    

    // has to be replaced with GPIO_AF_9

    That's all.