I'm experimenting with standby mode. IDE is STM32CubeIDE, mcu stm32f407vgt9. So I read in datasheet that mcu leave standby mode if one of following condition are fullfiled:
WKUP pin rising edge, RTC alarm (Alarm A and Alarm B), RTC wake-up, tamper event, time-stamp event, external reset in NRST pin, IWDG reset.
MCU get into standby mode by this function HAL_PWR_EnterSTANDBYMode() if I well understand. I do that and I expect if mcu got high on WKUP pin (PA0) mcu will exit standby mode. I want this simple code to exacute.
while (1){
HAL_PWR_EnterSTANDBYMode();
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_14, GPIO_PIN_SET);
HAL_Delay(3000);
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_14, GPIO_PIN_RESET);
HAL_Delay(3000);}
MCU go into standby mode but leaving standby mode never occur. I try to connect PA0 with high but nothing is happen.
I want to flash another code but that is now not possible because I go this error from STM32CubeIDE:
Error in final launch sequence:
Error in initializing ST-LINK device.
Reason: (4) No device found on target.
How I can solve this problem? Before experimenting with standby I got this error several times and I was successful solve him by connecting NRST pin with GND (hardware restart mcu) but now it doesn't work because after reset code will be automatically execute. Connecting NRST with GND and trying to flash code it is not possible (new error will occur which indicate that currently is activated hardware reset: Error in initializing ST-LINK device. Reason: (8) Target held under reset.).
Any idea is welcome