While debugging the S32K314 low-power wake-up function recently, I found that it cannot wake up from sleep mode, even when using an external wake-up method.
Under normal circumstances, the DI will respond to external stimuli, but once it enters hibernation, it will not respond at all.
The attached file contains the code. What could be causing this issue, and how can it be resolved?
Hi, Julián
After adopting your suggestion, I found that I could wake up. Does that mean I have truly entered Standby mode?
Another question I'd like to ask is, after entering Standby mode, does the I/O port status remain the same as before?
Another question is, in our circuit design, there is a hardware watchdog that needs to be fed by the MCU at regular intervals. How can this be handled under low power consumption?
Thanks,
Joker_Y
Hi @Joker_Y,
The project you've shared seems to be quite big. I have not gone through all of it, but I can see that you are not enabling the respective wake-up source. You have the following line commented:
Wkpu_Ip_EnableInterrupt(0,Wkpu_Ip_ChannelConfig_PB[0].hwChannel);
Also, before entering standby, change the main clock to FIRC with Clock_Ip_Init() API.
You can refer to the low power examples as reference; it shows how to change clock configuration and how to enable WKPU channel.
Best regards,
Julián
Hi @Joker_Y,
1. You can check if you are in standby by looking at MC_ME.MODE_STAT[PREV_MODE]. It shows if the previous mode was either reset (any reset) or standby.
You could also measure MCU's current consumption. Typical standby values are described in S32K3XX's Datasheet chapter 6.7 (Supply currents).
2. All pins will retain its last set states in run mode during standby mode. However, all pins will also be placed to its default states after reset event by default. You can enable pad keeping ensuring the pin retains its state from wakeup, until user initializes it again.
Refer to 41.12 Pad keeping from S32K3XX's Reference Manual.
3. I guess this depends on design and application. In my opinion, you can either set the watchdog to sleep (if the watchdog supports it), or continuously wake up S32K3 (by RTC or any other wakeup), service the watchdog, and resume low power.
Best regards,
Julián