I'm trying to use the Kinetis VLP modes, and having an issue with the processor expert generated function "Cpu_VLPModeEnable()" not honoring the setting for "VLP exit on interrupt". I'm using the MK10DN512ZVLK10 CPU & CodeWarrior for MicroControllers v10.1.
In the PE settings for the CPU component, I have VLP mode entry set to "User" (as I wish to control the mode) and "VLP exit on interrupt" set to Disabled. These settings are under Clock configurations/Clock configuration 0/Very low power mode.
Here's the generated code:
LDD_TError Cpu_VLPModeEnable(void)
{
/* MC_PMCTRL: LPWUI=1,RUNM=2,??=0,??=0,LPLLSM=0 */
MC_PMCTRL = (uint8_t)0xC0U; /* Enable very low power mode */
while((PMC_REGSC & PMC_REGSC_VLPRS_MASK) == 0x00U) { /* Wait until in the Very Low Power run mode */
}
return ERR_OK;
}
This shows LPWUI=1, but I think it should have been 0 since I chose "Disabled". The generated code doesn't change if I chose "Enabled" instead.
If I change the VLP mode entry setting to "Auto", then it adds this code to the end of PE_low_level_init():
/* MC_PMCTRL: LPWUI=0,RUNM=2,??=0,??=0,LPLLSM=0 */
MC_PMCTRL = (uint8_t)0x40U; /* Enable Very low power mode */
This looks like what I expected: the LPWUI setting is 0.
So, am I missing something? Is this an issue with processor expert?
Here's my processor expert version:
** This file was created by Processor Expert 5.2 [04.49]
** for the Freescale Kinetis series of microcontrollers.
And up at the top of cpu.c it says this:
** Filename : Cpu.c
** Project : ProcessorExpert
** Processor : MK10DN512ZVLK10
** Component : MK10N512LK100
** Version : Component 01.002, Driver 01.03, CPU db: 3.00.001
** Datasheet : K10P144M100SF2RM, Rev. 4, 1 Mar 2011
** Compiler : CodeWarrior ARM C Compiler
** Date/Time : 2011-11-16, 14:08, # CodeGen: 4
Thanks.