Hi,
I tried the NXP SDK example of 'lpcxpresso55s69_power_manager_lpc'.
This nicely demonstrates most of the low power modes of LPC55s69, but I have a problem with the NXP library function: POWER_EnterDeepPowerDown()
On the example this function fails to set deep-power-down state and MPU current is same as running current. I suspect it's ending up in hard fault handler, but it's really difficult to debug because it's in library code AND because changing clocks etc prior to entering deep-power-down stops the debugger from being attached to the target.
Would it be possible to get a copy of source code for this function so I can get a better idea of what is going wrong.
Regards
Jon
Solved! Go to Solution.
Hello Jon,
Blow is some measure from SE team:
Settings for DeepPowerDown entry below from power_manager_lpc in deep power down mode.
With this setting I was able to measure on EVK Rev 2 around 0.9uA at P13.
As you can see I setup NO wakeup pin and 2x pull down+2x pull up which is in same level as external components.
DEMO_PreDeepPowerDown();
uint32_t wakeup_io_ctrl;
wakeup_io_ctrl = (LOWPOWER_WAKEUPIOSRC_DISABLE << LOWPOWER_WAKEUPIOSRC_PIO0_INDEX) |
(LOWPOWER_WAKEUPIOSRC_DISABLE << LOWPOWER_WAKEUPIOSRC_PIO1_INDEX) |
(LOWPOWER_WAKEUPIOSRC_DISABLE << LOWPOWER_WAKEUPIOSRC_PIO2_INDEX) |
(LOWPOWER_WAKEUPIOSRC_DISABLE << LOWPOWER_WAKEUPIOSRC_PIO3_INDEX) |
(LOWPOWER_WAKEUPIO_PULLUP << LOWPOWER_WAKEUPIO_PIO0_PULLUPDOWN_INDEX)|
(LOWPOWER_WAKEUPIO_PULLDOWN << LOWPOWER_WAKEUPIO_PIO1_PULLUPDOWN_INDEX)|
(LOWPOWER_WAKEUPIO_PULLUP << LOWPOWER_WAKEUPIO_PIO2_PULLUPDOWN_INDEX)|
(LOWPOWER_WAKEUPIO_PULLDOWN << LOWPOWER_WAKEUPIO_PIO3_PULLUPDOWN_INDEX);
POWER_EnterDeepPowerDown(APP_EXCLUDE_FROM_DEEPPOWERDOWN,
LOWPOWER_SRAMRETCTRL_RETEN_RAMX2 | LOWPOWER_SRAMRETCTRL_RETEN_RAMX3,
WAKEUP_RTC_LITE_ALARM_WAKEUP, wakeup_io_ctrl);
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Alice,
Thank you for your response, my understanding of how to set up for power-down and deep-power-down is much clearer now.
Thank you for your help, I really appreciate it.
We can close this thread now.
Best regards
Jon Green
Hi Alice,
Thanks for your response.
I have a further question... It the NXP example of 'lpcxpresso55s69_power_manager_lpc', debugger will lose connection in the function of DEMO_PreLowPower() at the line of CLOCK_AttachClk(kOSC32K_to_MAIN_CLK);
Or if I remove the steps to switch to 32kHz clock, debugger will lose connection on entry to power-down state.
3. What do I need to do for debugger to remain attached when MPU enter (and leave) MPU power-down state?
Thanks
Jon
Helo Jon,
-3. In power-down and deep power-down mode, we can't connect debugger, the debug port taken off.
-About consumption, I think it is hard to measure on the EVK board, below is some reply from SE team:
"You can see in schematic it is input power for VDDs, VDDA, VBAT inputs power supplies. Current consumption in DS are measured with optimized PIO current leakage. As you can see from schematic, we have assembled lot of pull-ups pull-downs in EVK board which are in low power modes source of leakage current through VDD."
Hi Alice, thanks for your responses.
I took a close look at the PIO leakage currents on my own hardware that use LPCX55S69JBD100.
I found an issue with PIO0_28 (pin 66). The LPC55S6x Data Sheet ( https://www.nxp.com/docs/en/data-sheet/LPC55S6x.pdf ) page 22 reports this pin is Hi-Z at reset, but I found it has a pull-down effect of ~50kohm.
It's the same in deep-power-down state.
In my application this is contributing around ~20uA to deep-power-down current.
Is there something special about PIO0_28 that I don't know about (and that isn't shown in data sheet) to have ~50k pull-down in reset state and deep-power-down state?
Are there other pins have PU or PD like this?
(I'm aware of PD on PIO0_2, PU on PIO0_5, PD on PIO0_11, PU on PIO0_12)
Regards
Jon
Hello Jon,
Blow is some measure from SE team:
Settings for DeepPowerDown entry below from power_manager_lpc in deep power down mode.
With this setting I was able to measure on EVK Rev 2 around 0.9uA at P13.
As you can see I setup NO wakeup pin and 2x pull down+2x pull up which is in same level as external components.
DEMO_PreDeepPowerDown();
uint32_t wakeup_io_ctrl;
wakeup_io_ctrl = (LOWPOWER_WAKEUPIOSRC_DISABLE << LOWPOWER_WAKEUPIOSRC_PIO0_INDEX) |
(LOWPOWER_WAKEUPIOSRC_DISABLE << LOWPOWER_WAKEUPIOSRC_PIO1_INDEX) |
(LOWPOWER_WAKEUPIOSRC_DISABLE << LOWPOWER_WAKEUPIOSRC_PIO2_INDEX) |
(LOWPOWER_WAKEUPIOSRC_DISABLE << LOWPOWER_WAKEUPIOSRC_PIO3_INDEX) |
(LOWPOWER_WAKEUPIO_PULLUP << LOWPOWER_WAKEUPIO_PIO0_PULLUPDOWN_INDEX)|
(LOWPOWER_WAKEUPIO_PULLDOWN << LOWPOWER_WAKEUPIO_PIO1_PULLUPDOWN_INDEX)|
(LOWPOWER_WAKEUPIO_PULLUP << LOWPOWER_WAKEUPIO_PIO2_PULLUPDOWN_INDEX)|
(LOWPOWER_WAKEUPIO_PULLDOWN << LOWPOWER_WAKEUPIO_PIO3_PULLUPDOWN_INDEX);
POWER_EnterDeepPowerDown(APP_EXCLUDE_FROM_DEEPPOWERDOWN,
LOWPOWER_SRAMRETCTRL_RETEN_RAMX2 | LOWPOWER_SRAMRETCTRL_RETEN_RAMX3,
WAKEUP_RTC_LITE_ALARM_WAKEUP, wakeup_io_ctrl);
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Alice, now I have made some more small changes to the example of 'lpcxpresso55s69_power_manager_lpc' to allow enter deep-power-down with no debugger keyboard input, now it can enter deep-power-down with no debugger connected.
The current will now drop to ~365uA in deep-power-down. But this is higher than ~15uA for power-down, and still much higher than data sheet value of ~790nA.
See attached screenshot, and here is my sequence of events...
So with code modified for no keyboard GETCHAR() input, this happen...
1. Time at start of trace (before ~4.8sec) is to load code into debugger - stop at main().
2. At the ~4.8sec point, I start execution. Code will go straight to code of 'case kPmu_Deep_PowerDown:' and set RTC alarm for 4sec. Current is ~1.4mA
3. No wakeup will occur! As I said before, "With debugger attached I found MPU it can't come out of deep-power-down state".
5. At ~23.5sec I hit reset button. Now code will execute with no debugger attached. From that point code will quickly enter deep-power-down and the wake up by RTC at 4 sec alarm. It then restart and the cycle will repeat.
6. So now I am confident that MPU will get to deep-power-down-state but the trace shows current is ~359uA (at the marker of "26 s 208.508 ms").
Two questions for you:
1. What do I need to do for MPU enter deep-power-down state when debugger is connected?
2. How to get current from ~359uA down to data sheet value of ~790uA?
A copy of my modified file of power_manager_lpc.c is attached
Please check.
WARNING: After run this code take care to fit EVK jumper J10 to force ISP mode because debugger can't load new code when MPU in deep-power-down state!
Regards
Jon
Hi Alice,
Any update on my questions...
> 1. What do I need to do for MPU enter deep-power-down state when debugger is connected?
> 2. How to get current from ~359uA down to data sheet value of ~790uA?
Also I found something strange for the function of POWER_EnterPowerDown().
If wakeup is by RTC interrupt then GPIO states are retained, but if wakeup is by e.g. GINT0 interrupt then GPIO states don't get retained and need to be re-initialised.
It really would be good to see source code for the NXP lib function of POWER_EnterPowerDown() so we can see some detail about what this function does at power-down and wakeup.
Regards
Jon
Hello Jon,
Sorry I just come back from holiday.
> 1. What do I need to do for MPU enter deep-power-down state when debugger is connected?
->The debugger can't work after enter deep-power-down mode. You can use standalone MCU mode without debugger,
use the UART transfer command to MCU.
> 2. How to get current from ~359uA down to data sheet value of ~790uA?
It really would be good to see source code for the NXP lib function of POWER_EnterPowerDown() so we can see some detail about what this function does at power-down and wakeup.
->I will continue work on this question, ask development team whether we can get the source of this function.
BR
Alice
Hi Alice, great to hear that you get MPU into deep-power-down state. Do you know what current you get in that state. For me it appeared to be ~1.1mA, but data sheet offers ~790nA.
> we need send 0x0D (HEX), or it won't enter Deep power down mode:
Yes I'm aware of that. On my MAC OS it will get '\n' which is why I made the small change I describe in my original posting to take account of that.
Also, I have some issue to run with debugger. With debugger attached I found MPU it can't come out of deep-power-down state but with debugger disconnected I can't send command to enter deep-power-down state. So please may I ask what I need to do to be able to enter and leave deep-power-down state with debugger connected???
> Could you please test it and measure the current
Yes I will do some more investigation and let you know my result.
Regards
Jon
Hello Jon Green ,
We can't see the source code for POWER_EnterDeepPowerDown().
And how do you measure the power consumption ? Could you please take a photo to show me,
also the result data, I will try to measure on my side.
BR
Alice
Hi Alice, Thank you for you reply. Here is more info about this issue.
Firstly, I use MCUxpresso SDK example of 'lpcxpresso55s69_power_manager_lpc'.
For this I need to make one small change because on MAC OS I get '\n' character (instead of 0x0D) as line-ending for semi-host GETCHAR() input. My change for this is in file power_manager_lpc.c at line 117:-
NXP original code: while (index != 0x0D)
My change: while (index != '\n' /*0x0D*/)
This change will have no effect on current measurements.
I measure MPU current using NXP LPC55S69-EVK. (See NXP doc UM11158.pdf see section 5.1) This has 2.43ohm resistor (R91) connected to P12 for current sensing.
My measurements and screenshots come from Otii product configured to measure current by reading voltage across the 2.43ohm resistor. See here for info about Otii: https://www.qoitech.com/products/standard
The 'lpcxpresso55s69_power_manager_lpc' example will offer a menu to choose an option for reduced power mode. Normal running current appears to be ~1.4mA.
If I choose option "3. power down mode" it will work well. I get a current ~15uA and MPU will wakeup ok. See my screenshot "Otii screenshot lpcxpresso55s69_power_manager_lpc (option 3)power-down mode.png".
If I choose option "4. Deep power down mode" (followed by number of seconds for wakeup) the current will drop to ~1.1mA (data sheet offers 790nA) and MPU won't wake up after RTC wakeup period has passed. See my screenshot "Otii screenshot lpcxpresso55s69_power_manager_lpc (option 4)deep-power-down mode.png".
It's my guess that deep-power-down will enter hard-fault handler, but can't say for sure due to the reasons I mention in my original posting.
Any questions then please ask.
Regards
Jon
Hello Jon,
I can reproduce it now, and will reply you .ASAP after I find the reason.
Sorry for the inconvenient to you.
BR
Alice
Hi Alice, thanks for your response.
As part of this issue, I just want to make you aware of something I noticed in the function of
DEMO_PreDeepPowerDown().
In this function it will switch MPU clock to FRO32K source, and call CLOCK_SetFLASHAccessCyclesForFreq(32768U).
I wonder if it would be better to set wait states before switching to lower clock frequency. Otherwise there is a short period when maybe not enough wait states for high clock freq.
Please check.
Thanks
Jon
.
Hello Jon Green,
Sorry I just find in the code, when we choose 4 Deep power down mode, after input the second
to wait, we need send 0x0D (HEX), or it won't enter Deep power down mode:
I test on my side again, it can wake up after some seconds.
Could you please test it and measure the current. Also take a screenshot about the result on your Terminal .