Hi @bpr,
I guess you are seeing this problem because of IWDG reset which was enabled in Bootloader in new versions of Core(Run 2 aand Run 3).
I made an update to Bootloader today to “NOT” enable IWDG when the Stop Mode Flag is Set.
Following is the commit: spark/bootloader@e5792b1
I also created a Bootloader-patch firmware which will easily enable anyone in field to update to the latest bootloader without using JTAG programmer. Here is the core-firmware branch for this:
However care should be taken not to disturb the patch update process by accidentally removing usb power or through reset.
Following is the procedure to update the bootloader-patch
1)cd core-firmware
2)git pull
3)git checkout bootloader-patch-update
4)cd build [No need to run make]
5)Enter usb dfu/bootloader mode => Yellow flashes
6) dfu-util -d 1d50:607f -a 0 -s 0x08005000:leave -D core-firmware.bin
7)Upon execution, the bootloader should be updated within a second or two and normal core-firmware should start executing.
8)Congrats! your core is loaded with latest bootloader without the hassle of going through ST-Link JTAG programming
For those with Run2 and Run3 production Cores, the above mentioned process should get your “wakeup from sleep with interrupt” working i.e. IWDG should not reset after 5 seconds.
Be Brave in trying out on one of your Core
I tried your above mentioned code and it worked fine after the Bootloader fix.
Thanks!
Satish