Just done some more testing. If you build the bootloader without any
additional syscfg files, the default BSP syscfg will take effect. For the
nRF52DK board, this automatically turns on TIMER_0 (which subsequently
enables the HFXO) and enables the UART (each of which consumes significant
power, especially the UART). When the bootloader jumps to the main
application, these peripherals are not de-initialised and thus remain on
during the main app, consuming extra current and causing confusion
regarding the source of the power consumption.

In order to build the hello_world app with minimal power consumption, the
following syscfg values need to be defined for *both* the bootloader and
hello_world targets:

# Settings this app overrides.
syscfg.vals:
    UART_0: 0
    CONSOLE_UART: 0
    TIMER_0: 0
    OS_CPUTIME_TIMER_NUM: -1

This disables the UART and TIMER_0. The CPU now consumes only 4uA while
running.

I think it would be a good idea for the bootloader code to include a
deinitialise function that brings the hardware back to the reset state
before running the main app. I've submitted an Issue on Github at
https://github.com/apache/mynewt-core/issues/1264.

Amr

Reply via email to