STOP2_Mode prevents me from programming the MCU using J-Link and STM32 Cube programmer
In my program, I implemented a sleep using the STOP2_Mode, and to wake the MCU again, I have to depend on interrupts and events. I have attached the image of the block of code which represents the STOP mode mechanism.

When the device gets in STOP mode or Sleep mode not able to flash the MCU at all using both J-Link and STM32 Cube programmer. Also referred to the community pages and came to know about the BOOT0 option bytes but after trying it still not able to resolve that issue. I tried to modify the option bytes using the STM32 Cube programmer

Please suggest a way so that we can flash the new firmware even when the device is in STOP mode or Sleep mode.
