You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to use the active halt power save mode together with AWU unit to wake up.
Basically the concept of AWU works but the processor gets restarted every time the AWU interrupt occur. Expected behavior is that the procesdor should continue its execution from the place where HALT instruction has been called.
Root cause: it is not possible to correctly set the AWU_IRQHandler to some specific method. This code doesn't work:
Hi @wmarkow I'm working on same to use STM8S103F3P6 halt for ultra low power consumption . Can you please share your working code how did you implement attaching interrupt to pin , etc ?
To make it happen I needed to patch the STM8 Arduino core, see this file: https://github.com/wmarkow/arduino-sandbox/blob/master/fox-hunting-stm8/patches-fw/cores/sduino/stm8s_it.h
and look for the patch between phrases // PATCH wmarkow 'AWU_IRQHandler not working'. It is possible that it (the patch) could be done nicer as now all my example sketches need to define the AWU interrupt routine, even if it is not needed.
I'm using PlatformIO and the patch is copied automatically to the STM8 core distribution at every build.
Activity
[FoxHunting] AWU interrupt is not called because of the bug in the Ar…
[FoxHunting] Patch for framework issue #164 AWU_IRQHandler not workin…
g1ra commentedon Dec 19, 2024
Hi @wmarkow I'm working on same to use STM8S103F3P6 halt for ultra low power consumption . Can you please share your working code how did you implement attaching interrupt to pin , etc ?
wmarkow commentedon Dec 19, 2024
Hi @g1ra , my code is available here:
https://github.com/wmarkow/arduino-sandbox/blob/master/fox-hunting-stm8/examples/FoxTransmitter/FoxTransmitter.c
just look at the end of the file where AWU interrupt routine is implemented (together with sleep method),
but I'm using there a time wake up, so the uC goes to sleep and is woken up (after amount of time) automatically by AWU.
To make it happen I needed to patch the STM8 Arduino core, see this file:
https://github.com/wmarkow/arduino-sandbox/blob/master/fox-hunting-stm8/patches-fw/cores/sduino/stm8s_it.h
and look for the patch between phrases // PATCH wmarkow 'AWU_IRQHandler not working'. It is possible that it (the patch) could be done nicer as now all my example sketches need to define the AWU interrupt routine, even if it is not needed.
I'm using PlatformIO and the patch is copied automatically to the STM8 core distribution at every build.
[FoxHunting] AWU interrupt is not called because of the bug in the Ar…
[FoxHunting] Patch for framework issue #164 AWU_IRQHandler not workin…