KL26 Power Mode Switch Demo

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

KL26 Power Mode Switch Demo

Jump to solution
6,771 Views
gsmgbl
Contributor IV

Hi NXP,

I am evaluating the KL26 to see if this MCU fits my design, so I am trying some demo project on the FRDM-KL26Z eval board. I am trying to develop some power saving function under the FreeRTOS and since i am planning to wake up the MCU by a few pins from port C, i have to use VLPW mode. Here are my problems and questions:

1. Power mode switch demo: For the VLPW, it cannot switch from RUN directly based on the power mode state diagram, see below. So the transition is RUN -> VLPR -> VLPW. 

gsmgbl_0-1644868018820.png

I am confused with the demo project because it didn't show this transition. The demo project shows the following:

case kAPP_PowerModeVlpw:
SMC_PreEnterWaitModes();
SMC_SetPowerModeVlpw(SMC);
SMC_PostExitWaitModes();
break;

I don't see any transition to the VLPR, then VLPW. Plus i don't see the current consumption down to the specified level, so I am wondering if the demo is missing something in the VLPW power saving mode.

2. The port C interrupt works on this individual power mode switch project under the demo folder. Unfortunately, it didn't work when i moved this power mode switch function under the FreeRTOS environment. None of the port C pin wakes up the MCU. I can only see the tickless project in FreeRTOS. Do you have any working demo that shows the power mode switching under FreeRTOS? Please advise.

3. I bought couple of FRDM-KL26Z eval boards and they both were not working. Then i searched about this in the forum and found that they are non-programmed on both the K20 and KL26. So i followed the thread: https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KL26Z-DOA/m-p/1249153#M59937 programmed both K20 and KL26, but i can only brought the board up to a maintenance drive when i plus in the USB to the OpenSDA port. I am still having trouble to bring it to a working condition. Can you help to guide me to bring up these eval board? please show as detail as possible.

BTW, I am doing all these under the IAR. Any tips and recommendation is greatly appreciated!

Thanks,

Gilbert     

 

Labels (1)
0 Kudos
Reply
1 Solution
6,739 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @gsmgbl ,

My operation is same as you, first manually step into VLPR and measure, than step into VLPW measure. The current drop from 1.38mA to 0.48mA. In run mode, the current is 9mA.

After you download the test code, you should disconnect SWD if you do not use on board openSDA.

 

Regards,

Jing

View solution in original post

0 Kudos
Reply
19 Replies
6,744 Views
gsmgbl
Contributor IV

Hi Jing,

1. From my test, I don't see this different after the transition from VLPR to VLPW. I simply set the clock for VLPR and then set PreEnterWaitModes, set VLPW and set PostExitWaitModes. See below. Can you take a look if i am using the correct steps? Am i missing something?

APP_SetClockVlpr();
SMC_SetPowerModeVlpr(SMC);
while (kSMC_PowerStateVlpr != SMC_GetPowerModeState(SMC))
{
}
SMC_PreEnterWaitModes();
SMC_SetPowerModeVlpw(SMC);
SMC_PostExitWaitModes();

2. OK, I will take a look at that demo project.

3. I tried both the binary from that thread and I can only brought the board as a maintenance drive when i plug in the USB to the OpenSDA port. Do you have the openSDA bootloader file that i can program the K20 directly? Can you send me the file? or send me the link?

Thank you!!

0 Kudos
Reply
6,764 Views
gsmgbl
Contributor IV

Hi NXP,

I would like to clarify my item #1 in my original post.

In order to change from Run mode to VLPW mode, I have to manually change from RUN -> VLPR, then manually change from VLPR -> VLPW again. But i don't see the power consumption difference when i measured on my board, so i am confused and wondering if there is anything missing in the project. Please advise. Thanks!

0 Kudos
Reply
6,740 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @gsmgbl ,

My operation is same as you, first manually step into VLPR and measure, than step into VLPW measure. The current drop from 1.38mA to 0.48mA. In run mode, the current is 9mA.

After you download the test code, you should disconnect SWD if you do not use on board openSDA.

 

Regards,

Jing

0 Kudos
Reply
6,724 Views
gsmgbl
Contributor IV

Hi Jing,

You are correct, i left my SWD connected to the eval board. Thanks for your advice!

For the OpenSDA, do you have any idea how I resume the OpenSDA port? I won't be able to bring back the bootloader function, it popped up as the maintenance drive everytime i plug in the USB into the openSDA. Please advise.

Thanks,

Gilbert

0 Kudos
Reply
6,712 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @gsmgbl ,

Have you download DAPlink firmware?

 

Regards,

Jing

0 Kudos
Reply
6,701 Views
gsmgbl
Contributor IV

Hi Jing,

I tried those two binary files called "0244_k20dx_bl_0x8000.bin" and "k20dx_frdmkl26z_if_crc.bin", but my KL26 eval board can still shows up as a maintenance drive only.

From the thread, it reminds us to program the hello world into the eval board and i did this too, the board still shows up as maintenance, see below.

gsmgbl_0-1645204261863.png

Please advise detail steps, as well as file location and link etc. Thanks!!

0 Kudos
Reply
6,663 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Just drag and drop k20dx_frdmkl26z_if_crc.bin to the virtual disk. No other special steps.

 

Regards,

Jing

0 Kudos
Reply
6,651 Views
gsmgbl
Contributor IV

Hi Jing,

I followed your instruction and simply drag and drop into the drive, after that, it closed itself and popped up the same as the maintenance drive again. I tried a few times and it does the same. Is there any problem with the board? Do you have any other recommendation to help me troubleshoot on this. In fact, we bought two of this eval board and they are both the same. Please advise.

Thank you very much!!

 

0 Kudos
Reply
6,637 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @gsmgbl ,

1.Please measure the pin 1 voltage of SW2. It should be 3.3v.

2. If #1 is fine, please try drag and drop on other computer. 

 

Regards,

Jing

0 Kudos
Reply
6,559 Views
gsmgbl
Contributor IV

Hi Jing,

Thanks for the help!

Unfortunately, it still doesn't work. I measured the voltage of SW2, it is confirmed 3.3V. After that i drag and drop the the file from my local drive to the board, then unplug and plug back the USB again, but it still shows up as maintenance drive.

Regards,

Gilbert

0 Kudos
Reply
6,555 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @gsmgbl ,

Please try the jlink firmware. https://www.segger.com/downloads/jlink/OpenSDA_FRDM-KL26Z

If it can't work too. Please send me the DETAILS.TXT in MAINTANCE.

 

Regards,

Jing

0 Kudos
Reply
6,541 Views
gsmgbl
Contributor IV

Hi Jing,

Unfortunately, the board is still shows up as maintenance.

Please see the attached details.txt.

FYI, i first drag and drop your binary file in the maintenance drive, then i have this text file.

After that, i tried to program the binary file directly into the K20 through SWD, then the board won't boot up as maintenance anymore. 

Again, greatly appreciated all your help and patience! Your support is impressive! Thank you!

0 Kudos
Reply
6,535 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @gsmgbl ,

This file looks fine. I'm really don't know why. Please try to drag and drop on the computer, win7 or even linux.

 

Regards,

Jing

0 Kudos
Reply
6,417 Views
gsmgbl
Contributor IV

Hi Jing,

Very unfortunate, no luck with your recommendation.

Is there any possible way to resolve this from NXP??

Please advise. Again, thank you very much for all your efforts!

 

0 Kudos
Reply
6,370 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @gsmgbl ,

Please contact the distributor you bought this board from.

 

Regards,

Jing

0 Kudos
Reply
6,691 Views
gsmgbl
Contributor IV

Hi Jing,

I bumped into a problem when I am working on the power mode switch and wake up with my pin interrupts. FYI, i am using the LPSCI UART0 as my communication channel, then I configured two GPIO pins PTC2 and PTC6 as my wake up interrupt pins. I found that the LPSCI CLK stopped after the power mode switched from normal RUN mode to VLPR, then both of my wake up pins no longer gets interrupt.

Do you have any idea what went wrong? any tips?

Greatly appreciate your patience and all the helps!!

Thank you again!!

0 Kudos
Reply
6,664 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @gsmgbl ,

But KL26 hasn't LPSCI or LPUART. When you switch to vlpr mode, please check if the uart0 clock source is changed.  It use UART0 too. In VLPR mode, GPIO is full funcition( table 7-2 in RM). The gpio interrupt still can work. Please refer to the power_mode_switch demo.

 

Regards,

Jing

6,654 Views
gsmgbl
Contributor IV

Hi Jing,

Thanks a lot! I've got this one done already.

Regards,

Gilbert

0 Kudos
Reply
6,750 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @gsmgbl ,

1. I tested on my FRDM-KL26 board. When in VLPR mode, the current on J5 is 1.36mA. When in VLPW mode, the current is 0.48mA.

2. No, there isn't such a demo project porting power_mode_switch into FreeRTOS. But I see that in K64F SDK, the freertos_tickless demo support wake up by a button. You can refer to it.

3.Have you managed to download openSDA bootloader to K20?

 

Regards,

Jing

0 Kudos
Reply