S32K3: WKPU Wake-Up Interrupt Behaviour During Sleep Mode Hello NXP Support, We are using the S32K312 MCU and have configured a WKPU (Wake-Up Unit) channel with an interrupt callback. Note: Add +4 offset to Wkpu[n] -> n+4 We would like to clarify the behaviour of the WKPU when the ECU enters a low-power mode. Our questions are: If the MCU is in Sleep/Standby mode, does the WKPU continue monitoring the configured external wake-up pin? When the configured external edge is detected during Sleep/Standby mode, will the WKPU wake the MCU? After the MCU wakes up, will the configured WKPU interrupt callback be executed automatically, or is additional software handling required? Are there any specific WKPU, NVIC, or Power Management configurations required to ensure wake-up from Sleep/Standby mode? Are there any differences in WKPU wake-up behaviour between the supported low-power modes (Sleep, STOP, STANDBY, etc.) on the S32K312? We are using the NXP RTD drivers for the S32K312. Thank you for your support. Re: S32K3: WKPU Wake-Up Interrupt Behaviour During Sleep Mode Hi NXP Team, Thanks for your quick response. I am using the NXP S32K312 MCU. I have configured an external interrupt source (WKPU) on PTB2 (WKPU Channel 8). The interrupt is intended to wake the MCU from Sleep/Standby mode when the Sensor INT2 pin asserts. My question is: When an external WKPU interrupt is received, should the configured callback function be invoked automatically after wake-up? Or does the WKPU only generate a wake-up event when the external source is configured as an input on the WKPU pin, and do I need to configure PTB2 as an EIRQ pin and use the WKPU driver as the peripheral? If a callback is expected, are there any additional configurations required (e.g., NVIC, interrupt routing, WKPU settings, or mode-dependent limitations)? In my current implementation, the external interrupt successfully wakes the MCU when configured as EIRQ/ECU in Run mode, but it does not work in Standby mode(Wkpu configured in both pin and peripherals), and the configured callback is not executed. Could you please clarify the expected WKPU behavior and the required configuration for callback execution? Thank you. Re: S32K3: WKPU Wake-Up Interrupt Behaviour During Sleep Mode Hi @Dia,
Yes, the WKPU engine has the wake-up capability to the chip from multiple configurable asynchronous wake-up events.
Yes. Here is the standby exit sequence after a WKPU wake-up event: After Standby mode exit, the following events occur:
A wake-up event arrives
FIRC gets powered up (if disabled in Standby mode)
PMC starts the transition process to FPM (for example, enables the last-mile regulator and provides V1 _RUN supply to the chip)
MC_PCU removes the isolation between Run and Standby domains
Run domain reset deasserts (it’s asserted on Standby entry) and the chip undergoes a functional reset exit sequence for this domain
The chip enters Run mode of operation
Additional configuration is needed. Since the wakeup flag register is retained after waking up, the wakeup ISR can be entered once the NVIC→ISER of Wakeup Unit is enabled by code. So, after wake-up and in Run mode, if you call Platform functions to enable interrupt for wake-up (configure NVIC_ ISER for WKPU_IRQn) then your program will jump into wake-up interrupt function.
S32K3 only supports two modes: Run & Standby. However, there is a difference in wake-up behavior, as S32K3 can select normal Standby exit, or Fast Standby exit: Reset and normal Standby exit will perform both the HSE sBAF initialization code and HSE_FW verification, while fast standby exit will bypass it to save time, and boot to a user defined address. You can refer to Figure 176 (Power-up sequence) from the S32K3XX reference manual for further details.
I suggest looking into the low power management documentation from S32K3 Low Power Management AN and demos.
You can also refer to the latest examples: [RTD600 MCAL & IP] S32K3 Low Power Management AN and demos.
Best regards, Julián Re: S32K3: WKPU Wake-Up Interrupt Behaviour During Sleep Mode Hi @Dia,
When an external WKPU interrupt is received, should the configured callback function be invoked automatically after wake-up?
After calling interrupt initialization, WKPU_EXT_IRQ_SINGLE_ISR() will be entered. If you need to use callback, you can add the following lines before calling interrupt initialization:
Wkpu_Ip_u32ChState[0].chInit = TRUE;
Wkpu_Ip_u32ChState[0].notificationEnable = TRUE;
Wkpu_Ip_u32ChState[0].WkpuChannelNotification = Wkpu_Callback;
IntCtrl_Ip_Init(&IntCtrlConfig_0);
After ISR is serviced, WKPU callback will be entered.
Or does the WKPU only generate a wake-up event when the external source is configured as an input on the WKPU pin, and do I need to configure PTB2 as an EIRQ pin and use the WKPU driver as the peripheral?
This is valid as well. You can use callback configuration to know if a WKPU request was called before Standby.
If a callback is expected, are there any additional configurations required (e.g., NVIC, interrupt routing, WKPU settings, or mode-dependent limitations)?
See first response.
Can you stop MCU right after Standby exit (wake-up), and place a breakpoint inside WKPU_EXT_IRQ_SINGLE_ISR to see if MCU is jumping to it?
Best regards, Julián
記事全体を表示