2025-06-10 11:15 AM - last edited on 2025-06-11 2:29 AM by STTwo-32
Hello,
I am using p-nucleo-wb55. I have a code with an RTC alarm interrupt triggered every 5 seconds. In the ISR, I set a sequencer task that sends a message via BLE. I have enabled the LPM as I want the MCU to enter sleep mode while it isn't working and only wakeup with the RTC alarm. I realized that the MCU doesn't stay in the sleep mode and when I debug, I realized that it wakes up so fast as the IPCC RX Interrupt is triggered continuously with high frequency.
How can I control this, knowing that I don't need the MCU to do any task through those 5 seconds, I just want it to sleep and wakeup only after 5 seconds.
Thanks in advance
2025-06-11 2:55 AM
Ahlin @MahmoudAhmed11 and welcome to the ST Community.
Could you try to disable the IPCC RX Interrupt and all unnecessary interrupts before entering the Sleep mode and reenable them directly after the wake-up.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-06-11 2:09 PM - edited 2025-06-11 2:10 PM
Ahlin @STTwo-32 , thanks for your reply.
If you mean trying HAL_NVIC_DisableIRQ(IPCC_C1_RX_IRQn); before entering the sleep mode and HAL_NVIC_EnableIRQ(IPCC_C1_RX_IRQn); after it.
Yes, I tried that, and for some reason, the code enters hard fault ISR and gets stuck in the while(1) at some point. I have asked an AI if this solution is possible, and he replies that it isn't possible as disabling it will break BLE Stack operations, and in fact, it doesn't just affect the BLE, it makes the whole application stuck.
2025-06-12 1:51 AM
Hello @MahmoudAhmed11
Could you try to use to tasks one is the sending task, and the other one is the IDLE task that take the system to sleep mode when there is no transmission. and for the 5 seconds interval, you may use a HW timer. More details are available on the AN5289;
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-06-13 8:35 AM
Yes, I made only one task that is triggered from the ISR that happens every 5 seconds, and since there aren't any other tasks, the sequencer enters the stop mode. The problem is that it wakes up quickly due to the IPCC RX interrupt.