cancel
Showing results for 
Search instead for 
Did you mean: 

How to detect the RESET button on STM32L552E-EV

DYann.1
Senior II

Hello,

I have a STM32L552E-EV, and I would like to know how to detect the RESET button ?

DYann1_0-1741794257271.png

Thank you for your helps.

13 REPLIES 13
Chris21
Senior II

NRST is not a GPIO pin.

int main (void)
{   
    [perhaps hardware initialization code]
    [perhaps HAL_Init();]
    
    printf("I've been reset!!!!");
    
    [other initialization code]
    
    while (1)
    {
        [do stuff]
    }
 }
 
 

@DYann.1 wrote:


Yes, I was mistaken but when I press the button, can't it be detected by software ?


That's already been explained: that button is connected to the NRST pin.

The NRST pin causes a hardware reset of the chip - so you cannot detect that in software.

But, again, the software can detect the cause of a reset - as described earlier.


@Andrew Neil wrote:

The NRST pin causes a hardware reset of the chip - so you cannot detect that in software.

But, again, the software can detect the cause of a reset - as described earlier.


OK, I understand but just to make sure before abandoning this track.