[MQX4.1] K20D50M Problem Exiting VLPR mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[MQX4.1] K20D50M Problem Exiting VLPR mode

Jump to solution
949 Views
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

0 Kudos
1 Solution
580 Views
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

View solution in original post

0 Kudos
3 Replies
580 Views
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 Kudos
580 Views
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 Kudos
581 Views
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 Kudos