在线时间3 小时
UID3148939
注册时间2018-9-2
NXP金币0
该用户从未签到
新手上路

- 积分
- 23
- 最后登录
- 2018-12-28
|
根据文档描述:
“If FlexCAN receives the global Stop mode request during Freeze mode, it sets the LPMACK bit, negates the FRZACK bit and then sends the Stop Acknowledge signal to the CPU, in order to shut down the clocks globally.”
要进入Stop模式,需要CPU发起一个global Stop mode request,查阅资料得到,需要配置System Mode Controller (SMC)寄存器,但是按照网上论坛上找到的资料结合文档,(下面是网上找到的一个参考代码,逻辑和文档上描述的差不多),但是实际中我配置好之后,去读(SMC_PMSTAT)这个寄存器,依旧处于RUN状态,未切换到Stop状态,麻烦各路大神指导一下是我理解错了吗?正确进入stop的方式是什么呢?
SMC->PMPROT |= SMC_PMPROT_AVLP(1);
/* Select VLPS mode */
SMC->PMCTRL = SMC_PMCTRL_STOPM(0b010);
/*wait for write to complete to SMC before stopping core */
dummyread = SMC->PMCTRL;
dummyread++;
/* Enable SLEEPDEEP bit in the core */
S32_SCB->SCR |= S32_SCB_SCR_SLEEPDEEP_MASK;
/* Waiting for next interrupt will get micro in sleep mode */
STANDBY();
|
|