ksdk 1.3 vs 2.1 power manager example - wrong current on 2.1

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

ksdk 1.3 vs 2.1 power manager example - wrong current on 2.1

1,137件の閲覧回数
mjg8t
Contributor IV

Hi,

 

I am developing a low power application using the ksdk.  I started the project using 1.3 and have moved to using 2.1 with the new drivers.  Using FRDM-K22F to run measurements.  I have gotten started using the "power manager" demo application which runs well in sdk 1.3.  When going into VLPS I measure 6uA of current.  But when running the same demo in SDK 2.1 I get a current of 143uA in VLPS.

 

It seems that something is wrong with the SDK V2.1 demo version? 

ラベル(1)
0 件の賞賛
9 返答(返信)

660件の閲覧回数
fsl_jason_yu
NXP Employee
NXP Employee

Hi,

Could you please make sure the debugger is not connected during current measurement? Also, I recommend to remove the jumper J10/J13 during test.

Thanks.

0 件の賞賛

660件の閲覧回数
mjg8t
Contributor IV

The debugger is detached and the jumpers are properly set.  The same board configuration give proper VLPS current of 6uA using SDK 1.3.  As isaacavila has noted, there seems to be issues with the SDK driver.

0 件の賞賛

660件の閲覧回数
isaacavila
NXP Employee
NXP Employee

Hello Michael,

I got the same issue if I disconnect the debugger just after a debug session has started, then press reset and problem is found.

However, if you try to do a POR reset (disconnect the board and then connect it again), once program starts and select VLPS mode, MCU can enter to VLPS correctly and current is 6 uA (as desired).

Could you please try?

Regards,

Isaac

0 件の賞賛

660件の閲覧回数
mjg8t
Contributor IV

Hi Isaac,

I have followed your instructions, but still get high current 50uA (J13 did add extra current- not sure why this was not a problem with SDK1.3).  I did full POR and still 50uA.  Do you have further suggestions for debugging?

0 件の賞賛

660件の閲覧回数
isaacavila
NXP Employee
NXP Employee

Hello Michael,

In SDK 1.3, the demo disables the SWD CLK and DIO pin. The problem is, when users want to debug, they find that the debugger is disconnected, so in SDK 2.0, It was changed. (That is why J13 did not affect current consumption in KSDK 1.3).

Hope this helps!

Isaac

0 件の賞賛

660件の閲覧回数
isaacavila
NXP Employee
NXP Employee

Hello Michael,

You are using default example (without modifications), aren't you? If so there should be no problem on getting 6uA unless you are using any GPIO to control external hardware. Do you add additional hardware?

I added this code to verify that MCU entered to VLPS mode correctly:

case kAPP_PowerModeVlps:

            if (kStatus_Success != SMC_SetPowerModeVlps(SMC)) {

                /* Turn RED off to validate that VLPS mode has failed */

                SIM->SCGC5 |= SIM_SCGC5_PORTA_MASK;

                PORTA->PCR[1] = PORT_PCR_MUX(1);

                PTA->PDDR |= 1 << 1;

                PTA->PCOR |= 1 << 1;

                while (1) {

                }

            } else {

                /* Toggle Green LED */

                SIM->SCGC5 |= SIM_SCGC5_PORTA_MASK;

                PORTA->PCR[2] = PORT_PCR_MUX(1);

                PTA->PDDR |= 1 << 2;

                PTA->PTOR |= 1 << 2;

            }

            break;

So, Green LED is toggled every time I wake up from VLPS otherwse, Red LED will be turned on. Could you give a try to identify if VLPS is being entered correctly?

Regards,

Isaac

0 件の賞賛

660件の閲覧回数
mjg8t
Contributor IV

Hi Isaac.  Thanks for  working through this.  I was unsure of my current freedom board state, so I ordered a new one to run tests on just to make sure.  Note I also I have added your LED test code, ensured J10/13 (SWD disconnect) jumpers are removed and running "demo_apps/power_manager" example.  Based on the LED status the MCU powers down/wakes correctly as the green LED toggles (no red).  But, the power is still min of 32uA.  I thought this might be due to the lptmr running commented out the init code for lptmr, but the power stays the same.   I am not sure what else to do try and get the correct 6uA of vlps sleep current. 

Can you give me the bare steps to put the MCU into sleep without using the libraries that I might do some testing outside of using the SDK (very hard to understand the unerlying steps). 

Any other suggestions?

Thanks!

0 件の賞賛

660件の閲覧回数
isaacavila
NXP Employee
NXP Employee

Hello Michael Jones,

One important thing to notice is that FRDM-K22F does have a jumper to measure current for MCU (J15), however, this jumper has also some resistors that do not allow to measure all the current that is consuming K22 directly, you will need to remove these resistors (R62 and R63) and measure the current:

Current.jpg

So, when I measured current, I didn't remove then and I got 6uA but after removing them, I could measure 15.7 uA that is a valid value for VLPS mode according to K22's datasheet: http://cache.nxp.com/files/microcontrollers/doc/data_sheet/K22P121M120SF7.pdf .

I order to reach the minimum current value you should be aware to disable all pins that are not being used, and clock off al peripherals that will not be used.

Here is an application note that talks about Low Power Modes in Kinetis and it also shows some snippet codes to entering to every low power mode as well as other consideration to exit/enter from/to them, etc.  I hope you can find it useful: http://cache.nxp.com/files/32bit/doc/app_note/AN4503.pdf .

If you still have doubts, do not hesitate on contact us!

Regards,

Isaac

0 件の賞賛

660件の閲覧回数
isaacavila
NXP Employee
NXP Employee

Hello,

Indeed, it seems to be a problem when entering VLPS (debugger is not being disconnected when debugging and STOPA bit at SMC_PMCTRL register is set, meaning that previous STOP mode entry was aborted), I am investigating further on this topic.

I will let you know when something is found!

Regards,

Isaac

0 件の賞賛