S32K3 STANDBY + FIRC + Watchdog Hello, I am trying to implement standby mode for the S32K3 series (K312) following the examples provided in the community posts by NXP. My project uses an external clock source during regular operation and configures the watchdog timer. It is my understanding from the documentation/examples that before entering STANDBY mode I must switch to using the FIRC. If I switch to FIRC before entering STANDBY, the watchdog timer triggers, resetting the MCU. Is this expected behaviour? Additionally, if I disable the watchdog, the MCU does go into a low-power state, but will not not reset from a wakeup source. Meanwhile, if I directly enter STANDBY without switching to FIRC, the watchdog does not trigger a reset and the MCU goes into a low-power state and will reset from a wakeup source, as one would expect from STANDBY. Evidently, it seems at first glance that approach 2 (not switching to FIRC) works, but I would like to clarify as I am witnessing peculiar behaviour with pad keeping. If I toggle a pad high before entering STANDBY(approach 2), regardless of whether pad keeping is enabled or disabled for the pad, it remains high after the MCU has entered STANDBY. This has me questioning if the MCU is truly entering STANDBY, or is in some intermediary state. I realize this post is rather vague - do let me know what additional context I can provide. With regards, Hareesh Re: S32K3 STANDBY + FIRC + Watchdog Hello @Hareesh_S,
Firstly, before entering Standby, the system clock source must be changed to FIRC at 48 MHz because PLLDIG is not available in Standby mode. If this sequence is not followed, this may result in unexpected/undefined clock behavior.
If I switch to FIRC before entering STANDBY, the watchdog timer triggers, resetting the MCU. Is this expected behaviour? Additionally, if I disable the watchdog, the MCU does go into a low-power state, but will not not reset from a wakeup source.
By default, POR_WDG is enabled for standby entry/exit sequence monitoring for stuck scenarios:
Julin_AragnM_0-1785518283148.png
Does this behavior happen with the provided examples in community? Are you using RTD APIs to change clock source?
S32K3 Low Power Management AN and demos
Example S32K312 STANDBY wake up using CAN-0-RX and GPIO Switch DS3.5 RTD300
[RTD600 IP] S32K312EVB-Q172 Standby RAM GPIO Wake-up
If I toggle a pad high before entering STANDBY(approach 2), regardless of whether pad keeping is enabled or disabled for the pad, it remains high after the MCU has entered STANDBY. This has me questioning if the MCU is truly entering STANDBY, or is in some intermediary state.
1. All pins will retain its last set states in run mode during standby mode.
2. All pins will be placed to its default states after reset event by default.
PadKeeping configuration affects pin state after Standby exit sequence, in between K3's wake-up reset, and user's port initialization, in which pins may enter an uncontrollable state:
Julin_AragnM_2-1785519093000.png
Best regards, Julián Re: S32K3 STANDBY + FIRC + Watchdog Hello @Julián_AragónM , Apologies for my delayed response. Regarding the pad keeping behaviour - it seems I had misunderstood the intended functionality of padkeeping. I appreciate you clarifying the same. Regarding STANDBY entry - This behaviour is not replicable for the unmodified community examples. The sequence works as expected with the community examples. Additionally, I can now confirm that when switching to FIRC in my project, the MCU hardfaults, and that is why the watchdog triggers a reset. I have managed to replicate this behaviour in a blank project, but cannot figure out what the root cause is. I am attaching the project, could you please check the same and let me know what I am missing? With regards, Hareesh S Re: S32K3 STANDBY + FIRC + Watchdog Hello @Hareesh_S,
I'm glad PadKeeping functionality has been cleared up.
Regarding your project, after calling Clock_Ip_Init(), I can see a hardfault at Clock_Ip_SetRtcRtccClksel_TrustedCall(). After enabling PRTN1_COFB1_CLKEN[REQ34], I can change clock source through Clock_Ip_Init() API as expected.
Can you try this fix in your project?
Julin_AragnM_0-1786382290784.png
Julin_AragnM_1-1786382522241.png
Julin_AragnM_2-1786382602253.png
Best regards, Julián Re: S32K3 STANDBY + FIRC + Watchdog Hello @Julián_AragónM After enabling the RTC module/peripheral in the RUN domain switching to the FIRC works as expected and does not trigger a hardfault. I was not expecting RTC to be enabled mandatorily, but nevertheless, much thanks for the quick resolution!
View full article