How can I exit from standby mode using wakeup pin ?

Hi,
I'm using an stm32f401 mcu, mounted above Discovery platform, trying to understand how can I correctly use the standby low power mode; for this reason, I use the PA0 wake up to exit from this low power mode, but it doesn't work. The PA0, for my project, is setted as external interrupt, but when I use the standby mode, I configure it using the HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1) function that sets the EWUP bit in power control/status register, but when the mcu enter in standby mode and I push the button linked with PA0 pin, the mcu instead of restart code after the enter standby mode instruction, it resets. This is my code (only the code to enter/exit of standby mode):

Sorry but I'm a little bit confused; I read on reference manual:
"The microcontroller exits Standby mode when an external Reset (NRST pin), an IWDG
Reset, a rising edge on WKUP pin, an RTC alarm, a tamper event, or a time stamp event is detected"
and in fact I use a wake up pin to exit from standby mode, but I don't know if it's possible to see it as a reset. Please could you explain me ?

Thanks a lot, I'll try immediatly this solution...only one question: why
check the LPWRRSTF: Low-power reset flag of RCC control/status
register, instead of SBF flag of power control/status register ? The
last one remain unchanged after the exit of stand by mode