Changes to Nordic's Example Applications - PowerFilm-Solar/REF-IN-BLE-NS_4 GitHub Wiki

Many changes have been made to Nordic's example applications in order to for them to run below 20 uA. Changes are commented with the phrase "mod pf", allowing them to be easily searched and apparent. All of the provided PowerFilm examples have these modifications to them:

Change to code Benefit File Location
#define APP_ADV_INTERVAL 1600 Sets the advertising interval to 2000 ms. Reduces the amount of time the radio is powered on while advertising. main.c
#define MIN_CONN_INTERVAL 1000, #define MAX_CONN_INTERVAL 2000 Sets the minimum and maximum connection intervals to 1000 and 2000 ms respectively. Reduces the amount of time the radio is powered on while connected to another device. main.c
#define FIRST_CONN_PARAMS_UPDATE_DELAY 500, #define NEXT_CONN_PARAMS_UPDATE_DELAY 500, #define MAX_CONN_PARAMS_UPDATE_COUNT 10 Allows the device to quickly change the connection parameters (Connection interval, slave latency, and connection supervisory timeout) if the host device allows for it. main.c
#define TX_POWER_LEVEL (-12) Reduces the transmit power of the radio main.c
sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE); Enables the DCDC converter, reducing power usage by up to 40% main.c
#define NRF_LOG_ENABLED 0 Disables the log, reducing power usage by 5uA on average sdk_config.h
#define PM_FLASH_BUFFERS 1 Reduces the amount of ram used to the minimum amount sdk_config.h

PF_ble_app_blinky

In addition to the above, the following changes have been made to ble_app_blinky:

  • Delay functions are exchanged for app timers
  • Buttonless DFU service to enter the bootloader's DFU mode without physical contact with the board
  • PF_ble_app_blinky was built on top of the buttonless DFU service template, so it will differ more from Nordic's ble_app_blinky example, however the functionality and fundamental design is the same.

The modifications to PF_ble_app_blinky allow the application to run at an average of 11.1 uA at 2.5 V, or 27.8 uW, while advertising. While connected, it uses an average of 6.75 uA at 2.5 V, or 16.88 uW.

PF_ble_app_beacon

bsp.c and bsp_config.h were modified to disable the internal pullups on the buttons.

The modifications to PF_ble_app_beacon allow the application to run at an average of 7.92 uA at 2.5 V, effectively using 19.8 uW of power.

PF_ble_app_hrs

  • Known bug: The firmware will not request a connection parameter update from the central device. A temporary fix is manually setting the connection parameters on the central device before connecting to the firmware.

In addition to the above, the following changes have been made to PF_ble_app_hrs:

  • Similar to the beacon app, a modified bsp.c and bsp_config.h are added to the project folder.
  • The LED blinks to indicate if it is advertising or connected. It will blink once every three seconds to indicate advertising and blink twice every three seconds to indicate a connection.
  • App timer intervals are increased
  • Setting the TX power is done at the end of advertising init after m_advertising.adv_handle is set.
  • Disabled the peer manager due to it taking too much power to boot. Bonding/pairing functionality is disabled as a result.
  • Added case BLE_GATTS_EVT_SYS_ATTR_MISSING: to ble_evt_handler function. Needed after removing peer manager.

The modifications to PF_ble_app_hrs allow the application to run at an average of 13.55 uA at 2.5 V, or 33.875 uW, while advertising. While connected, it uses an average of 11.60 uA at 2.5 V, or 29 uW.