STM32L011 in low-power and "Target is not responding, retrying ..."
I'm using Nucleo STM32L011K4T6 kit to test different low-power features.
For this, the code is executed in RAM for 10ms (GPI/Os management) then the MCU is put in stop mode with the WFI instruction, to be woken up 90ms later by the RTC (RTC wake up).
This works fine if the Flash memory remains valid, but if I disable the Flash memory (RUN_PD and SLEEP_PD bit of the FLASH_ACR register), the code seems to run only once.
I obviously checked that all the code (main code and code under interrupt) is indeed in RAM, unfortunately when I disable the Flash memory, in debug mode in STM32CubeIDE, I get the error message "Target is not responding, retrying..."
If I put a breakpoint on the WFI instruction and restart the execution of the code with the F8 (resume) function, then the code is executed correctly.
If I run the code with the F5 (Step into) or F6 (Step over) function, then the code runs correctly.
But if I remove the breakpoint and I restart the execution (F8) the error message "Target is not responding, retrying ..." appears 10 times, and the debug mode stops.
Does anyone have an idea about the problem?