cancel
Showing results for 
Search instead for 
Did you mean: 

NVIC_SystemReset not working

dominik
Senior

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();

1 ACCEPTED SOLUTION

Accepted Solutions
dominik
Senior

@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

View solution in original post

9 REPLIES 9

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
Up vote any posts that you find helpful, it shows what's working..
dominik
Senior

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

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
Up vote any posts that you find helpful, it shows what's working..
dominik
Senior

PG10I'm using as an output0693W000005BJpUQAW.jpg

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
Up vote any posts that you find helpful, it shows what's working..
dominik
Senior

@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?

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
Up vote any posts that you find helpful, it shows what's working..
dominik
Senior

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
Senior

@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