Problem when I am waking-up from standby mode (STM32L4)
Hello, I am trying to set the device into standby mode before the actual code execution. I have set a pin as a wake-up source from standby mode and I need to run the actual code after waking up from standby mode. The workflow seems to work, for instance it goes to standby mode and when an interrupt comes from the pin the system wakes-up and starts the actual code execution. When it comes to enable a pin with HAL_GPIO_WritePin then the system crashes and it reset again. This is causing a loop of standby mode and wake up event which I don't want. I need the standby to run only once before the actual code. So for that I use this code:
1) It enters into the standby mode since the check_reset_source returns 0 from the first execution of the program
2) Then an interrupt comes to the pin and the system wakes-up from standby mode.
3) It starts again and after peripheral initialization check_reset_source returns 1 and then it goes to the actual code execution.
4) When the init_test_code starts there is a line where the HAL_GPIO_WritePin sets high a specific pin then it resets (I don't know the reason for that), runs the check_reset_source, which returns 0 and then goes back to standby mode.
How to avoid that? Does anyone know the reason or can give some hints to resolve this issue?
Thanks in advance.
