cancel
Showing results for 
Search instead for 
Did you mean: 

problem with NVIC_SystemReset

fabricepeden
Associate II
Posted on March 24, 2017 at 14:47

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

17 REPLIES 17
Posted on March 24, 2017 at 14:55

How is NRST wired on your board?

JW

fabricepeden
Associate II
Posted on March 24, 2017 at 15:13

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

fabricepeden
Associate II
Posted on March 24, 2017 at 15:51

Find below, the pin state when I execute NVIC_SystemReset()

0690X00000602TdQAI.bmp

The reset pin is tied to 0V during 33µs.

Posted on March 24, 2017 at 15:29

Make sure you have nothing driving it high (push-pull) externally.

Review the pin state with a scope when you use NVIC_SystemReset()

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
fabricepeden
Associate II
Posted on March 24, 2017 at 16:38

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

Posted on March 24, 2017 at 16:20

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
fabricepeden
Associate II
Posted on March 27, 2017 at 11:52

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

Adalgiso
Associate II
Posted on March 27, 2017 at 12:10

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

}
fabricepeden
Associate II
Posted on March 27, 2017 at 14:23

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