Skip to main content
dominik
Senior
November 13, 2020
Solved

NVIC_SystemReset not working

  • November 13, 2020
  • 9 replies
  • 3277 views

I'm using the X-CUBE-SBSFU bootloader on a ST STM32G474VE.

Sometimes NVIC_SystemReset is not resetting the controller, only a power reset helps. Any ideas? The string "Image correctly downloaded" i can see everytime!

/* System Reboot*/
 printf(" -- Image correctly downloaded - reboot\r\n\n");
 HAL_Delay(1000U);
 NVIC_SystemReset();

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

    @Community member​  I think the Option bytes was the solution, I changed them with the STM32 Cube Programmer the NRST Mode to 2, now its working and I can use PG10 as Push/Pull output

    9 replies

    Tesla DeLorean
    Guru
    November 13, 2020

    What you describe sounds like a latch-up issue.

    If you drive NRST externally, with a push-pull driver, this can prevent the core from resetting.

    ST, in more recent parts, has decided to have NRST not completely reset them. Several of the protection methods require a power-on-reset actually occur, otherwise system loader code will run, rather than your code in FLASH

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Tesla DeLorean
    Guru
    November 13, 2020

    printf(" -- Image correctly downloaded - reboot\r\n\n");

    HAL_Delay(1000U);

    NVIC_SystemReset();

    printf(" -- I'm not dead!!\r\n\n"); // If something is output, the mechanics of the pin are being interfered with

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    dominik
    dominikAuthor
    Senior
    November 13, 2020

    Hi Clive

    But it works like 70-80% of the updates...

    Is there a precompiler setting or something to check? I'm using IAR.

    Thaks

    dominik
    dominikAuthor
    Senior
    November 13, 2020

    PG10I'm using as an output0693W000005BJpUQAW.jpg

    Tesla DeLorean
    Guru
    November 13, 2020

    Well I suppose that could complicate things. Not sufficiently read into the G4's to know the potential consequences of doing that.

    You'd perhaps want to find a FAE to talk too, or file a Online Support Request to see if there is any gotchas. @Amel NASRI​ @Imen DAHMEN​ 

    Check also errata

    You might try configuring the pin as an INPUT + PULL-UP prior to the NVIC_SystemReset()

    >>But it works like 70-80% of the updates... Is there a precompiler setting or something to check? I'm using IAR.

    Not sure it is something resolvable with a compiler setting

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    dominik
    dominikAuthor
    Senior
    November 13, 2020

    @Amel NASRI​  @Imen DAHMEN​  @Tilen MAJERLE​ 

    Do you have an idea about this topic? Can I use the NRST PG10 PIN as Output or not? In cubeMX I can set it as push-pull, hope this is no bug in the MX?

    Tesla DeLorean
    Guru
    November 13, 2020

    Try reconfiguring the pin right before use here, it will indicate if it is a HW level issue, or something else.

    Probing via USART1 might tell you if it is in the System Loader ROM.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    dominik
    dominikAuthor
    Senior
    November 13, 2020

    I saw this entry, Its not working correctly but I saw when I connect with multi meter to measure the voltage level on this PIN the Core is getting resetted even if the impedance is really high...0693W000005BKZrQAO.jpg

    dominik
    dominikAuthorBest answer
    Senior
    November 13, 2020

    @Community member​  I think the Option bytes was the solution, I changed them with the STM32 Cube Programmer the NRST Mode to 2, now its working and I can use PG10 as Push/Pull output