This example project will show user how to use and configure the basic functionalities of WKPU + SIUL2 (GPIO) for wake-up from Standby mode on the S32K358 MCU, with RTC time preservation across Standby and functional reset clock sourced through SIRC.
Test HW: FRDM-A-S32K358 / S32K3X8EVB-Q289
MCU: S32K358
IDE: S32DS v3.5 & S32DS v3.6.x
SDK release: RTD 6.0.0
Debugger: PE Micro
Target: internal_FLASH
This example routine configures the WKPU unit for GPIO interrupt wake-up using pins PTH1 (WKPU0) and PTH3 (WKPU15). RTC time is preserved across Standby via the VDDBY supply domain. After wake-up, the functional reset clock is sourced from SIRC before transitioning to the main PLL. No fast wake-up path is used.
The routine waits for SW5 to be pressed, then turns off the green LED, and enters Wkpu_EnterStandby() function which:
Switches core clock to FIRC.
Initializes the WKPU instance.
Configures WKPU0 (PTH1) and WKPU15 (PTH3) as wake-up sources.
Enters Standby mode (normal wake-up).
After pressing USER0/SW4(PTH1), MCU wakes up, resets and polls for USER1/SW5 (PTH3) or USER0/SW4(PTH1) to be pressed again.
Terminal output
Settings: 115200 baud — 8 data bits — No parity — 1 stop bit — No flow control (LPUART6)
The terminal interaction follows three distinct phases each cycle: boot/wake-up banner → SW6 to read RTC time → SW5 to enter Standby. A representative session is shown below.
1 — Initial power-on (cold start)
RTC Standby example, press SW5 to enter standby.........
Press SW6 to print RTC date & time.........
Reset reason: 15
Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 0 seconds 0
Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 0 seconds 2
2 — Enter Standby → Wake-up → RTC time preserved
MCU will enter standby........
RTC Standby example, press SW5 to enter standby.........
Press SW6 to print RTC date & time.........
Reset reason: 28
Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 0 seconds 13
Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 0 seconds 14
Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 0 seconds 14
3 — Multiple Standby cycles (RTC keeps incrementing)
MCU will enter standby........
RTC Standby example, press SW5 to enter standby.........
Press SW6 to print RTC date & time.........
Reset reason: 28
Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 0 seconds 59
Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 1 seconds 0
MCU will enter standby........
RTC Standby example, press SW5 to enter standby.........
Press SW6 to print RTC date & time.........
Reset reason: 28
Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 1 seconds 4
Current RTC date & time: year 1970 month 1 day 1 hour 0 minutes 1 seconds 6
Disclaimer — PTH3 pin on S32K3X8EVB-Q289:
The EVB button mapped to PTH3 may fail to trigger a wake-up event. This is caused by the button connected to the VDD_HV_B (3.3 V) rail, while PTH3 belongs to the VDD_HV_A domain, which defaults to 5 V. The signal level mismatch prevents correct wake-up detection.
Workaround: switch Jumper J23 from position 1-2 (default, 5 V) to position 2-3 (3.3 V) to align VDD_HV_A with the button voltage level before testing wake-up via PTH3.
This example is provided as is with no guarantees and no support.