This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using the WFI command on STM32U599 and IRQ pending

Using the WFI command on STM32U599 - I've noticed that this doesn't work because there is a pending IRQ (UART4). We're not using UART4 at all - clearing this pending IRQ before executing WFI does work, though. Is there any reason why this IRQ is pending even though we're never enabling it or even using any UARTs? Should this pending interrupt stop WFI from entering standby?

  • Hello,

    The presence of a pending IRQ (UART4) despite not enabling or using any UARTs on the STM32U599 can be attributed to several factors. Firstly, it's possible that there might be unintentional configuration or initialization code that inadvertently enables UART4 interrupts. It's important to thoroughly review the codebase and ensure that no unintended configurations or interrupt enabling operations are present.

    Furthermore, it's worth noting that some peripheral modules on microcontrollers can have default configurations that enable interrupts. It's possible that UART4 on the STM32U599 falls into this category, where even though it's not explicitly enabled by the user, it still generates pending interrupts.

    In general, pending interrupts can prevent the WFI (Wait for Interrupt) instruction from entering the standby mode. The WFI instruction halts the CPU until an interrupt occurs, and if there are pending interrupts, it will not enter standby.  targetpayandbenefits

    To address this issue, it is recommended to explicitly clear the pending interrupt for UART4 before executing WFI. This ensures that the microcontroller can enter the desired standby mode without being hindered by unwanted interrupt requests.