cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_NVIC_SystemReset() is not consistent

In my STM32L432 project (Keil) I need to use a system reset.

System should be able to reset by external command, and it's also used in bootloader<->application jumps. I am using HAL_NVIC_SystemReset() for this purpose.

I've noticed that once in a while the system is not reset by HAL_NVIC_SystemReset().

Is there any reason that it may not reset a controller?

Is there any other reliable way to immediately reset the controller by firmware?

Thank you.

6 REPLIES 6
AvaTar
Lead

Are you sure NVIC_SystemReset() is really executed under all circumstances ?

Are the BOOT pins floating ?

I personally didn't work with the L4xx, though.

How is NRST pin connected?

Are you sure that SystemReset() was called?

JW

BOOT0 pin (it's the only one) is grounded the same way as it is on a development board.

And yes, reset is executed, here is the scope capture for a reset pin:

0690X000006DC5tQAG.jpg

The first pulse is reset in application, which provides jump to a bootloader.

The second pulse is a reset in a bootloader before the jump to an application.

The capacitor to the ground at a reset pin is 0.1 uF, nothing drives the NRST pin externally.

It seems to me that pulse may be too short to reliably reset a controller, but I don't know what is possible to do with that.

NRST is connected to the ground by 0.1 uF capacitor.

Reset is executed - see the capture above. The pulses in it are caused by SystemReset() calls.

OK, I've checked again. It seems like in cases when there no reset occurs, there are no pulses at NRST.

It means that SystemReset() is either not called or it's called but reset is not executed.

Will check this.

Piranha
Chief II

The NVIC_SystemReset() in itself is very simple. Most likely it isn't called. Could be some interrupt or multi-threading (if RTOS is used) related problems.

Do You set VTOR in application also? It should be done at least for debugging purposes, if debugger starts execution from application base address and therefore bootloader is not executed.