K10 PE_Generated Cpu_VLPModeEnable() issue

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

K10 PE_Generated Cpu_VLPModeEnable() issue

Jump to solution
1,206 Views
ScottW
Contributor II

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.

Labels (1)
Tags (1)
0 Kudos
1 Solution
901 Views
ProcessorExpert
Senior Contributor III

Hello,

thanks for reporting this. I have reproduced the behaviour and it is a bug in the latest version of ProcessorExpert. It will be fixed in the next release of CodeWarrior (CW V10.2).

For now as workaround please add additional speed mode in the CPU component. After this step, the value of LPWUI bit will be generated according to value of "VLP exit on interrutp" property correctly. I hope that this workaround will be sufficient for you.

 

We are sorry for the inconvenience.

 

best regards
Vojtech Filip
Processor Expert Support Team


View solution in original post

0 Kudos
1 Reply
902 Views
ProcessorExpert
Senior Contributor III

Hello,

thanks for reporting this. I have reproduced the behaviour and it is a bug in the latest version of ProcessorExpert. It will be fixed in the next release of CodeWarrior (CW V10.2).

For now as workaround please add additional speed mode in the CPU component. After this step, the value of LPWUI bit will be generated according to value of "VLP exit on interrutp" property correctly. I hope that this workaround will be sufficient for you.

 

We are sorry for the inconvenience.

 

best regards
Vojtech Filip
Processor Expert Support Team


0 Kudos