Skip to main content
Javier1
Principal
Feb 16, 2021 1:59 PM UTC
Solved

NVIC_SystemReset() is in reality NVIC_CoreReset()? STM32F105rbT6

Hi , i couldnt find any clear solution to this issue:

I need to trigger a software System Reset to enter into stm32´s bootloader.

0693W000008GIrMQAW.png 

  • So far NVIC_SystemReset() only resets the core and i cant use it to enter stm32 bootloader, am i missing something?
NVIC_SystemReset();

  • Reloading the IWDG with the wrong value also triggers a core reset?
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 :\

This topic has been closed for replies.
Javier1
Javier1Best answer
Principal
Feb 17, 2021 11:15 AM UTC

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 .

hit me up in https://www.linkedin.com/in/javiermuñoz/

5 replies

KnarfB
Super User
Feb 16, 2021 3:33 PM UTC

Please tell us what your MCU / series is.

Javier1
Javier1Author
Principal
Feb 16, 2021 3:54 PM UTC

of course : STM32F105rbT6

hit me up in https://www.linkedin.com/in/javiermuñoz/
KnarfB
Super User
Feb 17, 2021 7:47 AM UTC

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

Javier1
Javier1Author
Principal
Feb 17, 2021 10:07 AM UTC

> > 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.

hit me up in https://www.linkedin.com/in/javiermuñoz/