2025-03-12 8:45 AM - last edited on 2025-03-12 10:19 AM by Andrew Neil
Hello,
I have a STM32L552E-EV, and I would like to know how to detect the RESET button ?
Thank you for your helps.
Solved! Go to Solution.
2025-03-12 1:25 PM
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]
}
}
2025-03-12 4:21 PM
@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.
2025-03-13 12:44 AM
@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.
2025-03-13 1:23 AM
If that's answered your question, please mark the solution:
https://community.st.com/t5/community-guidelines/help-others-to-solve-their-issues/ta-p/575256