This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Save settings

Just wondering,

What if I configure the Tx power level or some other attribute. What do I have to do to save the value to be used when the unit restarts?

  • Hi Leon,

    If you have some config settings or variables that are dynamic, you can store these to flash to set these when reset occurs.

    Pseudo:

    if ( *(uint32_t *) CONFIG_ADDRESS != 0xFFFFFFFF) NRF_REGISTER->REG = CONFIG_ADDRESS; else NRF_REGISTER->REG = DEFAULT_VAL;

    The ble_flash library can be used to store to flash. Most BLE-projects use this to store bonding information on disconnect.

    Best regards Håkon

Related