diff --git a/boards/nxp/frdm_mcxa153/board.c b/boards/nxp/frdm_mcxa153/board.c index 52968d73fabb..b2376eebbef7 100644 --- a/boards/nxp/frdm_mcxa153/board.c +++ b/boards/nxp/frdm_mcxa153/board.c @@ -7,6 +7,9 @@ #include #include #include +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) +#include +#endif #include /* Core clock frequency: 96MHz */ @@ -151,6 +154,9 @@ void board_early_init_hook(void) */ #if DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x1 CLOCK_SetupFRO16KClocking(kCLKE_16K_SYSTEM | kCLKE_16K_COREMAIN); +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) + VBAT_EnableFRO16k(VBAT0, true); +#endif #elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x3 CLOCK_SetClockDiv(kCLOCK_DivLPTMR0, 1u); CLOCK_AttachClk(kFRO12M_to_LPTMR0); diff --git a/boards/nxp/frdm_mcxa156/board.c b/boards/nxp/frdm_mcxa156/board.c index deb6f0eec449..f7170b62e9e6 100644 --- a/boards/nxp/frdm_mcxa156/board.c +++ b/boards/nxp/frdm_mcxa156/board.c @@ -1,5 +1,5 @@ /* - * Copyright 2024 NXP + * Copyright 2024-2025 NXP * SPDX-License-Identifier: Apache-2.0 */ #include @@ -7,6 +7,9 @@ #include #include #include +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) +#include +#endif #include /* Core clock frequency: 96MHz */ @@ -227,6 +230,9 @@ void board_early_init_hook(void) * 3 <- Combination of clocks configured in MRCC_LPTMR0_CLKSEL[MUX] field */ #if DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x1 +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) + VBAT_EnableFRO16k(VBAT0, true); +#endif CLOCK_SetupFRO16KClocking(kCLKE_16K_SYSTEM | kCLKE_16K_COREMAIN); #elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x3 CLOCK_SetClockDiv(kCLOCK_DivLPTMR0, 1u); diff --git a/boards/nxp/frdm_mcxa166/board.c b/boards/nxp/frdm_mcxa166/board.c index 44af603388f7..d339ff9a97f1 100644 --- a/boards/nxp/frdm_mcxa166/board.c +++ b/boards/nxp/frdm_mcxa166/board.c @@ -7,6 +7,9 @@ #include #include #include +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) +#include +#endif #include /* Core clock frequency: 180MHz */ @@ -250,6 +253,9 @@ void board_early_init_hook(void) */ #if DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x1 CLOCK_SetupFRO16KClocking(kCLKE_16K_SYSTEM | kCLKE_16K_COREMAIN); +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) + VBAT_EnableFRO16k(VBAT0, true); +#endif #elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x3 CLOCK_AttachClk(kFRO_LF_DIV_to_LPTMR0); CLOCK_SetClockDiv(kCLOCK_DivLPTMR0, 1u); diff --git a/boards/nxp/frdm_mcxa276/board.c b/boards/nxp/frdm_mcxa276/board.c index 56f551552dd4..7a61da389e30 100644 --- a/boards/nxp/frdm_mcxa276/board.c +++ b/boards/nxp/frdm_mcxa276/board.c @@ -7,6 +7,9 @@ #include #include #include +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) +#include +#endif #include /* Core clock frequency: 180MHz */ @@ -255,6 +258,9 @@ void board_early_init_hook(void) */ #if DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x1 CLOCK_SetupFRO16KClocking(kCLKE_16K_SYSTEM | kCLKE_16K_COREMAIN); +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) + VBAT_EnableFRO16k(VBAT0, true); +#endif #elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x3 CLOCK_AttachClk(kFRO_LF_DIV_to_LPTMR0); CLOCK_SetClockDiv(kCLOCK_DivLPTMR0, 1u); diff --git a/boards/nxp/frdm_mcxn236/board.c b/boards/nxp/frdm_mcxn236/board.c index f990251a4f33..7fcd31fd7e30 100644 --- a/boards/nxp/frdm_mcxn236/board.c +++ b/boards/nxp/frdm_mcxn236/board.c @@ -1,5 +1,5 @@ /* - * Copyright 2024 NXP + * Copyright 2024-2025 NXP * SPDX-License-Identifier: Apache-2.0 */ #include @@ -8,6 +8,10 @@ #include #include #include +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) +#include +#endif + #if CONFIG_USB_DC_NXP_EHCI #include "usb_phy.h" #include "usb.h" @@ -289,6 +293,9 @@ void board_early_init_hook(void) CLOCK_SetupClockCtrl(kCLOCK_FRO12MHZ_ENA); #elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x1 CLOCK_SetupClk16KClocking(kCLOCK_Clk16KToVsys); +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) + VBAT_EnableFRO16k(VBAT0, true); +#endif #elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x2 CLOCK_SetupOsc32KClocking(kCLOCK_Osc32kToVsys); #elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x3 diff --git a/boards/nxp/frdm_mcxn236/frdm_mcxn236-pinctrl.dtsi b/boards/nxp/frdm_mcxn236/frdm_mcxn236-pinctrl.dtsi index 19a06b8453fe..d970f0ad2837 100644 --- a/boards/nxp/frdm_mcxn236/frdm_mcxn236-pinctrl.dtsi +++ b/boards/nxp/frdm_mcxn236/frdm_mcxn236-pinctrl.dtsi @@ -1,5 +1,5 @@ /* - * Copyright 2024 NXP + * Copyright 2024-2025 NXP * SPDX-License-Identifier: Apache-2.0 */ @@ -14,6 +14,7 @@ slew-rate = "fast"; drive-strength = "low"; input-enable; + bias-pull-up; }; }; @@ -48,6 +49,7 @@ slew-rate = "fast"; drive-strength = "low"; input-enable; + bias-pull-up; }; }; diff --git a/boards/nxp/frdm_mcxn947/board.c b/boards/nxp/frdm_mcxn947/board.c index aa399db64ed8..7781b8c7ede7 100644 --- a/boards/nxp/frdm_mcxn947/board.c +++ b/boards/nxp/frdm_mcxn947/board.c @@ -1,5 +1,5 @@ /* - * Copyright 2024 NXP + * Copyright 2024-2025 NXP * SPDX-License-Identifier: Apache-2.0 */ #include @@ -8,6 +8,10 @@ #include #include #include +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) +#include +#endif + #if CONFIG_USB_DC_NXP_EHCI #include "usb_phy.h" #include "usb.h" @@ -365,6 +369,9 @@ void board_early_init_hook(void) CLOCK_SetupClockCtrl(kCLOCK_FRO12MHZ_ENA); #elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x1 CLOCK_SetupClk16KClocking(kCLOCK_Clk16KToVsys); +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) + VBAT_EnableFRO16k(VBAT0, true); +#endif #elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x2 CLOCK_SetupOsc32KClocking(kCLOCK_Osc32kToVsys); #elif DT_PROP(DT_NODELABEL(lptmr0), clk_source) == 0x3 diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947-pinctrl.dtsi b/boards/nxp/frdm_mcxn947/frdm_mcxn947-pinctrl.dtsi index b2597191d55a..f2c6718b5cf6 100644 --- a/boards/nxp/frdm_mcxn947/frdm_mcxn947-pinctrl.dtsi +++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947-pinctrl.dtsi @@ -1,5 +1,5 @@ /* - * Copyright 2024 NXP + * Copyright 2024-2025 NXP * SPDX-License-Identifier: Apache-2.0 */ @@ -62,6 +62,7 @@ slew-rate = "fast"; drive-strength = "low"; input-enable; + bias-pull-up; }; }; @@ -72,6 +73,7 @@ slew-rate = "fast"; drive-strength = "low"; input-enable; + bias-pull-up; }; }; diff --git a/modules/hal_nxp/mcux/mcux-sdk-ng/drivers/drivers.cmake b/modules/hal_nxp/mcux/mcux-sdk-ng/drivers/drivers.cmake index b794013ca972..dc4a4efa961a 100644 --- a/modules/hal_nxp/mcux/mcux-sdk-ng/drivers/drivers.cmake +++ b/modules/hal_nxp/mcux/mcux-sdk-ng/drivers/drivers.cmake @@ -164,6 +164,11 @@ endif() if(CONFIG_SOC_SERIES_MCXN OR CONFIG_SOC_SERIES_MCXA) set(CONFIG_MCUX_COMPONENT_driver.mcx_spc ON) + if(CONFIG_PM OR CONFIG_POWEROFF) + set(CONFIG_MCUX_COMPONENT_driver.mcx_cmc ON) + set(CONFIG_MCUX_COMPONENT_driver.mcx_vbat ON) + set(CONFIG_MCUX_COMPONENT_driver.wuu ON) + endif() endif() if(CONFIG_BT_NXP AND CONFIG_SOC_SERIES_MCXW OR CONFIG_IEEE802154_MCXW) diff --git a/samples/boards/nxp/mcx/poweroff/CMakeLists.txt b/samples/boards/nxp/mcx/poweroff/CMakeLists.txt new file mode 100644 index 000000000000..7ba7517a83f4 --- /dev/null +++ b/samples/boards/nxp/mcx/poweroff/CMakeLists.txt @@ -0,0 +1,8 @@ +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(frdm_mcx_poweroff) + +target_sources(app PRIVATE src/main.c) diff --git a/samples/boards/nxp/mcx/poweroff/Kconfig b/samples/boards/nxp/mcx/poweroff/Kconfig new file mode 100644 index 000000000000..d6a5a0567bea --- /dev/null +++ b/samples/boards/nxp/mcx/poweroff/Kconfig @@ -0,0 +1,6 @@ +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +mainmenu "NXP MCXA/N SERIES POWER OFF DEMO" + +source "Kconfig.zephyr" diff --git a/samples/boards/nxp/mcx/poweroff/README.rst b/samples/boards/nxp/mcx/poweroff/README.rst new file mode 100644 index 000000000000..701ac45277ca --- /dev/null +++ b/samples/boards/nxp/mcx/poweroff/README.rst @@ -0,0 +1,85 @@ +.. zephyr:code-sample:: nxp_mcx_poweroff + :name: NXP MCXA/N Series MCUs Poweroff + :relevant-api: sys_poweroff + + Use poweroff on NXP MCXA/N series MCUs. + +Overview +******** + +This example demonstrates how to power off NXP MCXA/N series MCUs. + +Building, Flashing and Running +****************************** + +Building and Running for NXP FRDM-MCXA153 +========================================= +Build the application for the :zephyr:board:`frdm_mcxa153` board. + +.. zephyr-app-commands:: + :zephyr-app: samples/boards/nxp/mcx/poweroff + :board: frdm_mcxa153 + :goals: build flash + :compact: + +Building and Running for NXP FRDM-MCXA156 +========================================= +Build the application for the :zephyr:board:`frdm_mcxa156` board. + +.. zephyr-app-commands:: + :zephyr-app: samples/boards/nxp/mcx/poweroff + :board: frdm_mcxa156 + :goals: build flash + :compact: + +Building and Running for NXP FRDM-MCXA166 +========================================= +Build the application for the :zephyr:board:`frdm_mcxa166` board. + +.. zephyr-app-commands:: + :zephyr-app: samples/boards/nxp/mcx/poweroff + :board: frdm_mcxa166 + :goals: build flash + :compact: + +Building and Running for NXP FRDM-MCXA276 +========================================= +Build the application for the :zephyr:board:`frdm_mcxa276` board. + +.. zephyr-app-commands:: + :zephyr-app: samples/boards/nxp/mcx/poweroff + :board: frdm_mcxa276 + :goals: build flash + :compact: + +Building and Running for NXP FRDM-MCXN236 +========================================= +Build the application for the :zephyr:board:`frdm_mcxn236/mcxn236` board. + +.. zephyr-app-commands:: + :zephyr-app: samples/boards/nxp/mcx/poweroff + :board: frdm_mcxn236/mcxn236 + :goals: build flash + :compact: + +Building and Running for NXP FRDM-MCXN947 +========================================= +Build the application for the :zephyr:board:`frdm_mcxn947/mcxn947/cpu0` board. + +.. zephyr-app-commands:: + :zephyr-app: samples/boards/nxp/mcx/poweroff + :board: frdm_mcxn947/mcxn947/cpu0 + :goals: build flash + :compact: + +Sample Output +============= +FRDM-MCXA153, FRDM-MCXA156, FRDM-MCXA166, FRDM-MCXA276 FRDM-MCXN236, FRDM-MCXN947 output +---------------------------------------------------------------------------------------- + +.. code-block:: console + + *** Booting Zephyr OS build v4.2.0-rc1-255-gf71b531cb990 *** + Will wakeup after 5 seconds + Press key to power off the system + Powering off diff --git a/samples/boards/nxp/mcx/poweroff/app.overlay b/samples/boards/nxp/mcx/poweroff/app.overlay new file mode 100644 index 000000000000..8623076f6fdb --- /dev/null +++ b/samples/boards/nxp/mcx/poweroff/app.overlay @@ -0,0 +1,14 @@ +/* + * Copyright 2025 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&lptmr0 { + status = "okay"; + timer-mode-sel = <0>; + clk-source = <1>; + clock-frequency = <16384>; + resolution = <32>; + wakeup-source; +}; diff --git a/samples/boards/nxp/mcx/poweroff/prj.conf b/samples/boards/nxp/mcx/poweroff/prj.conf new file mode 100644 index 000000000000..da097b4d6e28 --- /dev/null +++ b/samples/boards/nxp/mcx/poweroff/prj.conf @@ -0,0 +1,7 @@ +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_POWEROFF=y +CONFIG_COUNTER=y +CONFIG_CONSOLE_SUBSYS=y +CONFIG_CONSOLE_GETCHAR=y diff --git a/samples/boards/nxp/mcx/poweroff/sample.yaml b/samples/boards/nxp/mcx/poweroff/sample.yaml new file mode 100644 index 000000000000..598ba4b86df2 --- /dev/null +++ b/samples/boards/nxp/mcx/poweroff/sample.yaml @@ -0,0 +1,16 @@ +# Copyright 2025 NXP +# SPDX-License-Identifier: Apache-2.0 + +sample: + name: Poweroff demo for NXP MCXA/N series +common: + tags: power +tests: + sample.boards.nxp.mcx.poweroff: + platform_allow: + - frdm_mcxa156 + - frdm_mcxa153 + - frdm_mcxa166 + - frdm_mcxa276 + - frdm_mcxn236/mcxn236 + - frdm_mcxn947/mcxn947/cpu0 \ No newline at end of file diff --git a/samples/boards/nxp/mcx/poweroff/src/main.c b/samples/boards/nxp/mcx/poweroff/src/main.c new file mode 100644 index 000000000000..a422d24af7f1 --- /dev/null +++ b/samples/boards/nxp/mcx/poweroff/src/main.c @@ -0,0 +1,51 @@ +/* + * Copyright 2025 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include +#include +#include +#include +#include + +int main(void) +{ + int ret; + const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(lptmr0)); + + struct counter_top_cfg top_cfg = { + .ticks = counter_us_to_ticks(dev, 5000000), + .callback = NULL, + .user_data = NULL, + .flags = 0, + }; + + console_init(); + + if (!device_is_ready(dev)) { + printf("Counter device not ready\n"); + return 0; + } + + ret = counter_set_top_value(dev, &top_cfg); + + printf("Will wakeup after 5 seconds\n"); + printf("Press key to power off the system\n"); + console_getchar(); + + ret = counter_start(dev); + if (ret < 0) { + printf("Could not start wakeup counter (%d)\n", ret); + return 0; + } + + printf("Powering off\n"); + + sys_poweroff(); + + return 0; +} diff --git a/soc/nxp/mcx/mcxa/CMakeLists.txt b/soc/nxp/mcx/mcxa/CMakeLists.txt index 34a926751a7b..4d600b37e132 100644 --- a/soc/nxp/mcx/mcxa/CMakeLists.txt +++ b/soc/nxp/mcx/mcxa/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright 2024 NXP +# Copyright 2024-2025 NXP # # SPDX-License-Identifier: Apache-2.0 # @@ -8,3 +8,7 @@ zephyr_sources(soc.c) zephyr_include_directories(.) set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "") + +if(CONFIG_POWEROFF) + zephyr_sources(power.c) +endif() diff --git a/soc/nxp/mcx/mcxa/Kconfig b/soc/nxp/mcx/mcxa/Kconfig index ba6b74c44500..6b6cea892455 100644 --- a/soc/nxp/mcx/mcxa/Kconfig +++ b/soc/nxp/mcx/mcxa/Kconfig @@ -9,6 +9,7 @@ config SOC_SERIES_MCXA select CPU_CORTEX_M_HAS_SYSTICK select CPU_CORTEX_M_HAS_DWT select SOC_RESET_HOOK + select HAS_POWEROFF config SOC_MCXA153 select CPU_CORTEX_M33 diff --git a/soc/nxp/mcx/mcxa/power.c b/soc/nxp/mcx/mcxa/power.c new file mode 100644 index 000000000000..77920e9b4c3a --- /dev/null +++ b/soc/nxp/mcx/mcxa/power.c @@ -0,0 +1,28 @@ +/* + * Copyright 2025 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include "fsl_cmc.h" +#include "fsl_spc.h" +#include "fsl_vbat.h" +#include "fsl_wuu.h" + +void z_sys_poweroff(void) +{ + cmc_power_domain_config_t cmc_config = { + .clock_mode = kCMC_GateAllSystemClocksEnterLowPowerMode, + .main_domain = kCMC_DeepPowerDown, + }; + + WUU_SetInternalWakeUpModulesConfig(WUU0, 6U, kWUU_InternalModuleInterrupt); + SPC_SetLowPowerWakeUpDelay(SPC0, 0x5B); + + CMC_SetPowerModeProtection(CMC, kCMC_AllowDeepPowerDownMode); + CMC_EnterLowPowerMode(CMC, &cmc_config); + + CODE_UNREACHABLE; +} diff --git a/soc/nxp/mcx/mcxa/soc.c b/soc/nxp/mcx/mcxa/soc.c index 363a9dad44e0..dde940a92828 100644 --- a/soc/nxp/mcx/mcxa/soc.c +++ b/soc/nxp/mcx/mcxa/soc.c @@ -1,5 +1,5 @@ /* - * Copyright 2024 NXP + * Copyright 2024-2025 NXP * * SPDX-License-Identifier: Apache-2.0 */ @@ -16,10 +16,23 @@ #include #include #include +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) +#include +#include +#endif #ifdef CONFIG_SOC_RESET_HOOK void soc_reset_hook(void) { +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) + /* Release the I/O pads and certain peripherals to normal run mode state, + * for in Power Down mode they will be in a latched state. + */ + if ((CMC_GetSystemResetStatus(CMC) & kCMC_WakeUpReset) != 0UL) { + SPC_ClearPeriphIOIsolationFlag(SPC0); + } +#endif + SystemInit(); } #endif diff --git a/soc/nxp/mcx/mcxn/CMakeLists.txt b/soc/nxp/mcx/mcxn/CMakeLists.txt index e432bad982f8..42c25c0f06fa 100644 --- a/soc/nxp/mcx/mcxn/CMakeLists.txt +++ b/soc/nxp/mcx/mcxn/CMakeLists.txt @@ -34,3 +34,7 @@ endif() zephyr_include_directories(.) set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "") + +if(CONFIG_POWEROFF) + zephyr_sources(power.c) +endif() diff --git a/soc/nxp/mcx/mcxn/Kconfig b/soc/nxp/mcx/mcxn/Kconfig index 0a771aafac8a..f82627d9c691 100644 --- a/soc/nxp/mcx/mcxn/Kconfig +++ b/soc/nxp/mcx/mcxn/Kconfig @@ -10,6 +10,7 @@ config SOC_SERIES_MCXN select CPU_CORTEX_M_HAS_SYSTICK select CPU_CORTEX_M_HAS_DWT select HAS_MCUX_MCX_CMC + select HAS_POWEROFF config SOC_MCXN947_CPU0 select CPU_CORTEX_M33 diff --git a/soc/nxp/mcx/mcxn/power.c b/soc/nxp/mcx/mcxn/power.c new file mode 100644 index 000000000000..07d941b3cef7 --- /dev/null +++ b/soc/nxp/mcx/mcxn/power.c @@ -0,0 +1,29 @@ +/* + * Copyright 2025 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include "fsl_cmc.h" +#include "fsl_spc.h" +#include "fsl_vbat.h" +#include "fsl_wuu.h" + +void z_sys_poweroff(void) +{ + cmc_power_domain_config_t cmc_config = { + .clock_mode = kCMC_GateAllSystemClocksEnterLowPowerMode, + .main_domain = kCMC_DeepPowerDown, + .wake_domain = kCMC_DeepPowerDown, + }; + + WUU_SetInternalWakeUpModulesConfig(WUU0, 6U, kWUU_InternalModuleInterrupt); + SPC_SetLowPowerWakeUpDelay(SPC0, 0x637); + + CMC_SetPowerModeProtection(CMC0, kCMC_AllowDeepPowerDownMode); + CMC_EnterLowPowerMode(CMC0, &cmc_config); + + CODE_UNREACHABLE; +} diff --git a/soc/nxp/mcx/mcxn/soc.c b/soc/nxp/mcx/mcxn/soc.c index 91156e1c2f29..f2b752be5412 100644 --- a/soc/nxp/mcx/mcxn/soc.c +++ b/soc/nxp/mcx/mcxn/soc.c @@ -16,11 +16,23 @@ #include #include #include +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) +#include +#include +#endif #ifdef CONFIG_SOC_RESET_HOOK void soc_reset_hook(void) { +#if defined(CONFIG_PM) || defined(CONFIG_POWEROFF) + /* Release the I/O pads and certain peripherals to normal run mode state, + * for in Power Down mode they will be in a latched state. + */ + if ((CMC_GetSystemResetStatus(CMC0) & kCMC_WakeUpReset) != 0UL) { + SPC_ClearPeriphIOIsolationFlag(SPC0); + } +#endif SystemInit(); }