Hello,
I am investigating WUU wake-up behavior from Deep Power-Down mode on the FRDM-MCXA266 board.
Environment:
- MCU: MCXA266
- Board: FRDM-MCXA266
- SDK Example project: frdmmcxa266_power_mode_switch_ll_mcxa
- SDK version: 26.6.000
- Development environment: MCUXpressoIDE_25.6.136
I added the following code near the beginning of main() to read the reset and wake-up status before BOARD_InitHardware() is called.
/*******************************************************************************
* Variables
******************************************************************************/
char *const g_modeNameArray[] = APP_POWER_MODE_NAME;
char *const g_modeDescArray[] = APP_POWER_MODE_DESC;
uint32_t resetCount;
uint32_t resetStatus;
uint32_t resetStickyStatus;
uint32_t wakeupResource;
uint32_t wuuWakeupPinsFlag;
/*******************************************************************************
* Code
******************************************************************************/
int main(void)
{
uint32_t freq;
app_power_mode_t targetPowerMode;
bool needSetWakeup = false;
// --- START ADDED CODE ---
resetStatus = CMC_GetSystemResetStatus(CMC);
resetStickyStatus = CMC_GetStickySystemResetStatus(CMC);
CMC_ClearStickySystemResetStatus(CMC, resetStickyStatus);
wakeupResource = CMC_GetWakeupSource(CMC);
wuuWakeupPinsFlag = WUU_GetExternalWakeUpPinsFlag(WUU0);
WUU_ClearExternalWakeUpPinsFlag(WUU0, wuuWakeupPinsFlag);
// --- END ADDED CODE ---
BOARD_InitHardware();
// --- START ADDED CODE ---
DbgConsole_Printf("CMC_GetSystemResetStatus(CMC) = 0x%x\r\n", resetStatus);
DbgConsole_Printf("CMC_GetStickySystemResetStatus(CMC) = 0x%x\r\n", resetStickyStatus);
DbgConsole_Printf("CMC_GetWakeupSource(CMC) = 0x%x\r\n", wakeupResource);
DbgConsole_Printf("WUU_GetExternalWakeUpPinsFlag(WUU0) = 0x%x\r\n", wuuWakeupPinsFlag);
// --- END ADDED CODE ---
APP_SetVBATConfiguration();
APP_SetSPCConfiguration();
APP_InitWaketimer();The complete relevant output is:
```
Normal Boot.
########################### Power Mode Switch Demo ###########################
Core Clock = 240000000Hz
Power mode: Active
Select the desired operation
Press A to enter: Active mode
Press B to enter: Sleep mode
Press C to enter: DeepSleep mode
Press D to enter: PowerDown mode
Press E to enter: DeepPowerDown mode
Waiting for power mode select...
Deep Power Down: The whole VDD_CORE voltage domain is power gated.
Please select wakeup source:
Press A to select TIMER as wakeup source;
Press B to select WAKE-UP-BUTTON as wakeup source;
Waiting for wakeup source select...
Wakeup Button Selected As Wakeup Source.
Please press SW2 to wakeup.
Isolate power domains: VDD_USB.
CMC_GetSystemResetStatus(CMC) = 0x4010
CMC_GetStickySystemResetStatus(CMC) = 0x4011
CMC_GetWakeupSource(CMC) = 0x0
WUU_GetExternalWakeUpPinsFlag(WUU0) = 0x0
Normal Boot.
```
At the initial startup, the following values were printed:
CMC_GetSystemResetStatus(CMC) = 0x110
CMC_GetStickySystemResetStatus(CMC) = 0x110
CMC_GetWakeupSource(CMC) = 0x0
WUU_GetExternalWakeUpPinsFlag(WUU0) = 0x0
I then selected Deep Power-Down mode, selected WAKE-UP-BUTTON as the wake-up source, and pressed SW2.
The MCU successfully woke up, and the application restarted, but the following values were printed:
CMC_GetSystemResetStatus(CMC) = 0x4010
CMC_GetStickySystemResetStatus(CMC) = 0x4011
CMC_GetWakeupSource(CMC) = 0x0
WUU_GetExternalWakeUpPinsFlag(WUU0) = 0x0
My interpretation of the CMC reset status is:
- 0x00004010: Software Reset + Warm Reset
- 0x00004011: Software Reset + Warm Reset + Deep Power-Down Wake-up Reset
If this interpretation is correct, the sticky status appears to indicate that a Deep Power-Down wake-up reset occurred first, followed by a software warm reset.
I checked the application startup code, system_MCXA266.c, and the example sources, but I could not find NVIC_SystemReset(), SYSRESETREQ, or an SCB->AIRCR write.
I also added a counter to SystemInitHook() using a retained NOLOAD variable. SystemInitHook() was executed only once after wake-up, so I could not find evidence of a software reset after SystemInit().
My questions are:
My current interpretation of the CMC reset status is as follows, but please correct me if I have misunderstood the bit definitions:
English is not my first language, so please let me know if any part of my explanation is unclear.
Thank you.
Hello @ka-2020
Thanks for your question. I will reproduce the test on my side using the same setup and investigate the behavior. Once I have the results, I will get back to you with my findings and answers to all of your questions.
Thank you for your patience and support.
BR
Alice