2021-02-16 05:59 AM
Hi , i couldnt find any clear solution to this issue:
I need to trigger a software System Reset to enter into stm32´s bootloader.
NVIC_SystemReset();
WRITE_REG((_hiwg)->Instance->KR, (IWDG_KEY_RELOAD+1));
The only way i´ve been able to generate a System reset has been letting the IWDG counter reach 0 :\
Solved! Go to Solution.
2021-02-17 03:15 AM
okay i found it, i was trying to do a HAL_Delay(); inside one interruptionjust before the NVIC_SystemReset();
that was jamming my core because inside interruptions there is no systick going on.
NVIC_SystemReset(); does trigger a system reset now and it always had .
2021-02-16 07:33 AM
Please tell us what your MCU / series is.
2021-02-16 07:54 AM
of course : STM32F105rbT6
2021-02-16 11:47 PM
Don't have a F1 device on my bench. But
> NVIC_SystemReset() only resets the core
How did you find out?
If you can check that a low pulse on NRST is generated --> system reset. In addition, start a timer PWM which should stop after system reset. Tested on a STM32L432KC.
You can set the IWDG timeout as small as 100µs @40 kHz LSI clock. Shouldn't be a problem.
After reset you can inspect IWDGRSTF flag in RCC_CSR register to differenciate an IWDG reset from a normal reset. With some code in the Reset_Handler you may safely jump to system memory in that case without needing external circuitry.
hth
KnarfB
2021-02-17 02:07 AM
> > NVIC_SystemReset() only resets the core
> How did you find out?
My f105 is driving some leds with pwm and gpios, so when a system reset happens all LED go off (quite visual)
If just a core reset happens the LEDs remain lit.
> If you can check that a low pulse on NRST is generated
ill check this , thanks
> After reset you can inspect IWDGRSTF flag in RCC_CSR register to differenciate an IWDG reset from a normal reset. With some code in the Reset_Handler
> you may safely jump to system memory in that case without needing external circuitry.
I am exploring this option now, my plan is to jumpAddress to the factory stm bootloader after deactivating interruptions, timers and watchdogs.
2021-02-17 03:15 AM
okay i found it, i was trying to do a HAL_Delay(); inside one interruptionjust before the NVIC_SystemReset();
that was jamming my core because inside interruptions there is no systick going on.
NVIC_SystemReset(); does trigger a system reset now and it always had .