2017-03-24 06:47 AM
Hi everybody,
I'm using a STM32F205VE on one of my electronic board.
I'd like to reset my microcontroller, so I use the function NVIC_SystemReset that I can find in core_cm3.h but it never works.
My board is not resetting so I don't understand what happen and why my board is not resetting.
If you've have some ideas, I'll be very happy.
Regards,
Fabrice Péden
2017-03-24 06:55 AM
How is NRST wired on your board?
JW
2017-03-24 07:13 AM
Thank you for your quick reply.
My reset pin is wired on the reset pin of my programmation connector with a 10k pull-up resistor.
I've also tried without this pull-up resistor, the result still be the same.
Fabrice
2017-03-24 07:51 AM
Find below, the pin state when I execute NVIC_SystemReset()
The reset pin is tied to 0V during 33µs.
2017-03-24 08:29 AM
Make sure you have nothing driving it high (push-pull) externally.
Review the pin state with a scope when you use NVIC_SystemReset()
2017-03-24 08:38 AM
I have put some breakpoints in NVIC_SystemReset().
__DSB(); => OK, firmware is going here
SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) | (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | SCB_AIRCR_SYSRESETREQ_Msk);=> OK, firmware is going here
__DSB();=> NOK, firmware is never going here
while(1);
The problem comes from the update of the register. However, the update of this register seems to be good as describes in the cortex documentation.
Regards,
Fabrice
2017-03-24 09:20 AM
And the CPU doesn't go into the ResetHandler? You're checking/verifying this how?
Does it continue to execute code on the other side of NVIC_SystemReset()?
2017-03-27 02:52 AM
Hi everybody,
I've tried to put 'NVIC_SystemReset();' somewhere else in my code, and it's always the same, my µc doesn't reset, it seems to be freeze (I have a LCD screen, I can see that this one is frozen).
Is something can block (IT...) this function ?
Regards,
Fabrice
2017-03-27 03:10 AM
in the main add this before doing anything else, I am not sure how long the delay needs to be but for me this works
/* delay absolutely necessary when a narrow reset pulse on the NRST or/and with software or watchdog reset */
/* Little delay */ for(i=0;i<512;i++) { __NOP(); }2017-03-27 05:23 AM
Thank you for your suggestion, but it doesn't work.
I've tried to put (my watchdog is activated):
while(1)
{
__NOP();
}
But it's the same, I think the core is stopped (I use also an external watchdog so I can see some LEDs and buzzer whic are activated) but my µc doesn't restart.
Regards,
Fabrice