[MQX4.1] K20D50M Problem Exiting VLPR mode

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

[MQX4.1] K20D50M Problem Exiting VLPR mode

跳至解决方案
1,751 次查看
huishao2
Contributor IV

Hi-

My board is based on MK20DX128VFM5 and powered my MQX4.1.1.

Testing low power mode using VLPR by following demo code from Freescale_MQX_4_1\mqx\examples\lowpower. What I can see is the current consumption is decreased by 20mA on entering VLPR mode. But I can't get it back to RUN mode by using MQX APIs in the demo code. Here are what I used:

enter VLPR:

_lpm_set_clock_configuration(BSP_CLOCK_CONFIGURATION_2MHZ);

_lpm_set_operation_mode (LPM_OPERATION_MODE_WAIT);

exit  VLPR:

_lpm_set_operation_mode (LPM_OPERATION_MODE_RUN);

_lpm_set_clock_configuration(BSP_CLOCK_CONFIGURATION_DEFAULT);

THe code above crashed in API _lpm_set_clock_configuration(BSP_CLOCK_CONFIGURATION_DEFAULT), what is the reason for it?

How can I verify the ARM core is running at 4MHz?

Another question is, since my application enters VLPR mode immediately  after power on, the IAR used can't JTAG it to load a new code in because VLPR prevents from FLASH programming. Any solution to it?

Thanks!

Hui

标记 (1)
0 项奖励
回复
1 解答
1,382 次查看
huishao2
Contributor IV

Hi Sol

Thanks for your help. I worked around it by setting MCG_G2 to 0x25U (high gain to low power) so that my external crystal circuit can start oscillation again on the way back to RUN mode.

regards

Hui

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,382 次查看
huishao2
Contributor IV

some more info I just got from debugging:

My silicon SIM_SDID is 0x3012

prints on silicon is 3N86B

On resuming back to RUN mode, the processor hangs when it migrates  from FBI to FBE mode in Cpu_SetMCGModePBE() of bsp_cm.c:

...

      /* MCG_C1: CLKS=2,FRDIV=3,IREFS=0,IRCLKEN=0,IREFSTEN=0 */

      MCG_C1 = (uint8_t)0x98U;

...

0 项奖励
回复
1,382 次查看
soledad
NXP Employee
NXP Employee

Hello,

Please check the below thread: MQX Low Power Mode: stop from wait

Let me know if this helps!!!

Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,383 次查看
huishao2
Contributor IV

Hi Sol

Thanks for your help. I worked around it by setting MCG_G2 to 0x25U (high gain to low power) so that my external crystal circuit can start oscillation again on the way back to RUN mode.

regards

Hui

0 项奖励
回复