2024-06-26 01:14 PM
Hello,
I am using STM32WB55CEU6, when using EXTI callback with BLE and LPM enabled, the MCU never enters the desired STOP2 power mode. The callback triggers every 20 seconds and is used to set a task by calling UTIL_SEQ_SetTask(...).
When a virtual timer is used (no EXTI callback) to set the task, MCU enters STOP2 when there is nothing to do, as expected.
Is the EXTI callback behavior an expected behavior (does EXTI break the LPM)? Is this a consequence of the sequencer being not re-entrant?
Thanks!
Solved! Go to Solution.
2024-06-27 11:30 PM
If by 'not recommended', you are referring to the slide ~ 2:40, then this clearly concerns only stack functions like the aci_gat... function shown there. Otherwise, you'd be sending multiple (maybe contradicting) commands to the stack. Other generic code can be executed here without issues. It just should be kept as short as possible - this is true in general for interrupts.
From an interrupt, the code returns to the place where it was interrupted - so in this case, it would be to the active task which was run before the interrupt.
2024-06-26 01:33 PM
When an EXTI interrupt occurs, it will wake up the MCU from STOP2 mode. If the EXTI interrupt happens every 20 seconds, this frequent wake-up can prevent the MCU from entering or staying in STOP2 mode for longer periods. Keep the EXTI ISR as short as possible. Consider deferring non-critical work to the main loop or a lower-priority task to allow the MCU to return to low-power mode more quickly. You can also consider using STM32WLE5CC instead and see a comparative result. STM32WLE5CC long-range wireless and ultra-low-power devices embed a powerful and ultra-low-power LPWAN-compliant radio solution, enabling the following modulations: LoRa®, (G)FSK, (G)MSK, and BPSK.
https://www.st.com/en/microcontrollers-microprocessors/stm32wle5cc.html
https://www.pcbway.com/project/shareproject/STM32WLE5CC_LoRaWAN_Sensor_Logger_aadebc34.html
2024-06-26 02:22 PM
Waking up every 20 seconds is what I actually want. The problem is that the MCU never enters STOP2 when using EXTI Callback. That is why I suspect that the EXTI Callback compromises the LPM.
I need to wake up on a sensor FIFO-full-interrupt-trigger that happens roughly every 20 seconds.
2024-06-27 05:23 AM
There shouldn't be any issue in this regard.
I'd suggest starting from one of the BLE examples. E.g. here I'm using the BLE_Beacon project. By default, the user buttons are set so that I can wake up the MCU and I added a simple code to switch between STOP and SLEEP modes. This is the resulting power consumption.
2024-06-27 11:01 AM
Even in ST´s video, using EXTI on STM32WB55 is not recommended, why is that? https://www.youtube.com/watch?v=Zgw3wRpGSRQ&list=PLnMKNibPkDnG9JRe2fbOOpVpWY7E4WbJ-&index=17
I got the low power with EXTI working by resetting the power for the board after uploading firmware, resetting the MCU was for some reason not enough. Now I am getting the same current consumption as with the timerserver setting the task.
2024-06-27 11:06 AM
If a task gets interrupted by the EXTI interrupt, does the code return to that task after the ISR is finished, or does it jump to the next task?
2024-06-27 11:30 PM
If by 'not recommended', you are referring to the slide ~ 2:40, then this clearly concerns only stack functions like the aci_gat... function shown there. Otherwise, you'd be sending multiple (maybe contradicting) commands to the stack. Other generic code can be executed here without issues. It just should be kept as short as possible - this is true in general for interrupts.
From an interrupt, the code returns to the place where it was interrupted - so in this case, it would be to the active task which was run before the interrupt.
2024-08-14 12:33 PM
Hi, the "simple code to switch between STOP and SLEEP modes" is not in the source files (stack 1.20.0).
Could you provide us ?