Low Power Wakeup with Bootloader

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

Low Power Wakeup with Bootloader

905 Views
brendanmerna
Contributor IV

Hey there,

I'm using a MK22F512FN12 chip on a custom boards. The micro controller needs to go into a low power state and wakeup with one of 2 pin interrupts. It also uses the kinetis flash loader to be able to update via USB. I've gotten the device to go into low power and even wake up from low power. The issue is it seems to take two interrupts to fully bring up the application firmware.

Example:
- Go into low power mode.
- Press button, observe an increase in current
- Press button again, the device runs the main application code

In the flash loader, I have a check to look at a byte in flash to see if its has a certain value to either fall into flash loader or jump to the application. (This is so you can launch the flash loader from the application.) If it goes into the flash loader and someone doesn't want to update the device they also need to be able to exit the boot loader with the button press rather than updating the device. There is a LED that is supposed to turn on to indicate when the device is in flash loader.

What I think is happening after the first button press the application wakes up and runs through the flash loader check code, but I don't see the flash loader LED turn on. I'm not doing any handling of low wake up bits in the interrupt, so I was thinking this might cause some fault in how the code runs. But, it's still able to check the button to exit the boot loader.

My main question is: Is there special handling of low wake up bits that you have to do in the flash loader when the device wakes up? Because I know after reset it starts with the flash loader code before it loads the application.

Any ideas or clarifications needed? Thanks!

Labels (1)
Tags (2)
0 Kudos
3 Replies

790 Views
brendanmerna
Contributor IV

Found the solution. The flash loader firmware loaded on the device was old firmware and when updated with the correct firmware the device worked as expected.

0 Kudos

790 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

What low power mode do you go into?

There is a power_mode_switch demo in SDK, can you try it and find some difference?

Regards,

Jing

0 Kudos

790 Views
brendanmerna
Contributor IV

Hey Jing,

Going into this mode, kSMC_AllowPowerModeVlls (Very Low Leakage Stop Mode).

I've tried the power switch demo and gotten it to work on the FRDM-K22F board. Haven't tried any of that on our custom board because my code seems to be working at the very least of going into low power and coming out of it. Just not to the exact functionality I require because of the flash loader.

-Brendan

0 Kudos