Hi,
I configured System Control Register for Deep sleep but system is not going to deep sleep.
status = ASMC_SetPowerModeStop(BBS_SIM, kASMC_PartialStop1);
/*!
* brief Configure the system to Stop power mode.
*
* param base ASMC peripheral base address.
* param option Partial Stop mode option.
* return ASMC configuration error code.
*/
status_t ASMC_SetPowerModeStop(ASMC_Type *base, asmc_partial_stop_option_t option)
{
uint32_t reg;
PRINTF("%s ++++++++++++++++++++++++++\r\n", __func__);
/* configure the Partial Stop mode in Normal Stop mode */
reg = base->STOPCTRL;
reg &= ~ASMC_STOPCTRL_PSTOPO_MASK;
reg |= ((uint32_t)option << ASMC_STOPCTRL_PSTOPO_SHIFT);
base->STOPCTRL = reg;
/* configure Normal Stop mode */
reg = base->PMCTRL;
reg &= ~ASMC_PMCTRL_STOPM_MASK;
reg |= (kASMC_StopNormal << ASMC_PMCTRL_STOPM_SHIFT);
base->PMCTRL = reg;
/* Set the SLEEPDEEP bit to enable deep sleep mode (stop mode) */
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
PRINTF("%s ++++++++++++++++++++++++++ SCB->SCR: 0x%x\r\n", __func__, SCB->SCR);
/* read back to make sure the configuration valid before entering stop mode */
(void)base->PMCTRL;
__DSB();
__WFI();
__ISB();
PRINTF("%s ------------------------\r\n", __func__);
return kStatus_Success;
}
Ref: https://static.docs.arm.com/dui0553/a/DUI0553A_cortex_m4_dgug.pdf
Thanks & Regards,
VinothS,
Regards,
Vinothkumar Sekar