[RTD600 MCAL] S32K3X4EVB-T172 RTC API Wake-up

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[RTD600 MCAL] S32K3X4EVB-T172 RTC API Wake-up

[RTD600 MCAL] S32K3X4EVB-T172 RTC API Wake-up

This example project will show user how to use and configure the basic functionalities of WKPU + GPT RTC API.

 ------------------------------------------------------------------------------
* Test HW: S32K3X4EVB-T172 (SCH-53148 REV B2) or S32K344MINI-EVB
* MCU: S32K344
* IDE: S32DS3.5 & S32DS3.6
* SDK release: RTD 6.0.0
* Debugger: PE Micro
* Target: internal_FLASH
 ------------------------------------------------------------------------------

This example routine configures the WKPU & RTC units for wake-up. The RTC is present in always ON domain, hence available in RUN mode as well as in STANDBY mode.

Julin_AragnM_0-1771625665539.png

 

The chip contains one instance of RTC (Real Time Clock) timer and API (Autonomous Periodic Interrupt) timer, where both can perform 32-bit comparisons. Both RTC and API timers can generate interrupts as well as wake-up from low power modes.

The following figure highlights the path for RTC API wake-up. Please refer to Chapter 69.3.2 API functional description from the S32K3XX reference manual (Rev. 12) for further information.

Julin_AragnM_1-1771625661011.png

 

The routine waits for SW5 to be pressed, then:

  1. Turns off the green LED
  2. Switches CORE_CLK to Option C - Boot Standby mode (CORE_CLK @ 24 MHz).
  3. Initializes the ICU driver.
  4. Configures RTC_API channel (WKPU0)
  5. Initializes GPT module.
  6. Starts timer and sets RTC_API_TIME.
  7. Enters standby.

After the period defined, RTC API generates an interruption and MCU wakes up. After wake-up, MCU resets and polls for SW5 to be pressed again.

The RTC API value can be changed with RTC_API_TIME definition.

This example is provided as is with no guarantees and no support.

Attachments
%3CLINGO-SUB%20id%3D%22lingo-sub-2320921%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%5BRTD600%20MCAL%5D%20S32K3X4EVB-T172%20RTC%20API%20Wake-up%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2320921%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%0A%3CP%3E%3CSPAN%3EThis%20example%20project%20will%20show%20user%20how%20to%20use%20and%20configure%20the%20basic%20functionalities%20of%20WKPU%20%2B%20GPT%20RTC%20API.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B------------------------------------------------------------------------------%3CBR%20%2F%3E*%20Test%20HW%3A%20S32K3X4EVB-T172%20(SCH-53148%20REV%20B2)%20or%26nbsp%3BS32K344MINI-EVB%3CBR%20%2F%3E*%20MCU%3A%20S32K344%3CBR%20%2F%3E*%20IDE%3A%20S32DS3.5%20%26amp%3B%20S32DS3.6%3CBR%20%2F%3E*%20SDK%20release%3A%20RTD%206.0.0%3CBR%20%2F%3E*%20Debugger%3A%20PE%20Micro%3CBR%20%2F%3E*%20Target%3A%20internal_FLASH%3CBR%20%2F%3E%26nbsp%3B------------------------------------------------------------------------------%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThis%20example%20routine%20configures%20the%20WKPU%20%26amp%3B%20RTC%20units%20for%20wake-up.%26nbsp%3BThe%20RTC%20is%20present%20in%26nbsp%3B%3CSTRONG%3Ealways%20ON%3C%2FSTRONG%3E%26nbsp%3Bdomain%2C%20hence%20available%20in%26nbsp%3B%3CSTRONG%3ERUN%3C%2FSTRONG%3E%26nbsp%3Bmode%20as%20well%20as%20in%26nbsp%3B%3CSTRONG%3ESTANDBY%3C%2FSTRONG%3E%26nbsp%3Bmode.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Julin_AragnM_0-1771625665539.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Julin_AragnM_0-1771625665539.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F377442i5E324C4E928EDAEC%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Julin_AragnM_0-1771625665539.png%22%20alt%3D%22Julin_AragnM_0-1771625665539.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%3EThe%20chip%20contains%20one%20instance%20of%26nbsp%3B%3CSTRONG%3ERTC%3C%2FSTRONG%3E%26nbsp%3B(%3CSTRONG%3EReal%20Time%20Clock%3C%2FSTRONG%3E)%20timer%20and%20API%20(%3CSTRONG%3EAutonomous%20Periodic%20Interrupt%3C%2FSTRONG%3E)%20timer%2C%20where%20both%20can%20perform%2032-bit%20comparisons.%20Both%20RTC%20and%20API%20timers%20can%20generate%20interrupts%20as%20well%20as%20wake-up%20from%20low%20power%20modes.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20following%20figure%20highlights%20the%20path%20for%20RTC%20API%20wake-up.%20Please%20refer%20to%26nbsp%3B%3CSTRONG%3EChapter%26nbsp%3B69.3.2%20API%20functional%20description%3C%2FSTRONG%3E%26nbsp%3Bfrom%20the%20S32K3XX%20reference%20manual%20(Rev.%2012)%20for%20further%20information.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Julin_AragnM_1-1771625661011.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Julin_AragnM_1-1771625661011.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F377443i101B644D46B8D84E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Julin_AragnM_1-1771625661011.png%22%20alt%3D%22Julin_AragnM_1-1771625661011.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%3EThe%20routine%20waits%20for%26nbsp%3B%3CSTRONG%3ESW5%3C%2FSTRONG%3E%26nbsp%3Bto%20be%20pressed%2C%20then%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSPAN%3ETurns%20off%20the%20green%20LED%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ESwitches%20CORE_CLK%20to%20Option%20C%20-%20Boot%20Standby%20mode%20(CORE_CLK%20%40%2024%20MHz).%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EInitializes%20the%20ICU%20driver.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EConfigures%20RTC_API%20channel%20(WKPU0)%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EInitializes%20GPT%20module.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EStarts%20timer%20and%20sets%20%3CSPAN%3ERTC_API_TIME.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EEnters%20standby.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%3EAfter%20the%20period%20defined%2C%20RTC%20API%20generates%20an%20interruption%20and%20MCU%20wakes%20up.%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EAfter%20wake-up%2C%20MCU%20resets%20and%20polls%20for%26nbsp%3B%3CSTRONG%3ESW5%3C%2FSTRONG%3E%26nbsp%3Bto%20be%20pressed%20again.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20RTC%20API%20value%20can%20be%20changed%20with%20RTC_API_TIME%20definition.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%0A%3CP%3E%3CSPAN%3EThis%20example%20is%20provided%26nbsp%3B%3CU%3Eas%20is%3C%2FU%3E%26nbsp%3Bwith%20no%20guarantees%20and%20no%20support.%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎02-20-2026 03:17 PM
Updated by: