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

Recovering from ble_bondmngr_init errors

I have the following code // bondmngr code comes here for now ble_bondmngr_init_t bondInitData;

bondInitData.flash_page_num_bond = FLASH_PAGE_BOND;
bondInitData.flash_page_num_sys_attr = FLASH_PAGE_SYS_ATTR;
bondInitData.evt_handler            = bond_manager_evt_handler;
bondInitData.error_handler          = bond_manager_error_handler;
bondInitData.bonds_delete           = erase; <-- parameter passed into function, usually false.

uint32_t    err = ble_bondmngr_init( &bondInitData);

which for most instances returns NRF_SUCCESS. On occasion, blé_bondmngr_init() fails with error 11 or #define NRF_ERROR_INVALID_DATA (NRF_ERROR_BASE_NUM + 11)

How should one recover without having to reload and restart?

Thanks

  • Hi,

    This may indicate that the CRC computed does not match. You can get into a situation like this if you're developing, then altering ble_bondmngr_cfg.h without clearing the flash section (keil does not do this by default, it only erases what's needed by the application), as the CRC will be altered.

    What I usually do in this situation is to check option "Erase full chip" inside J-Link settings -> Flash download.

    Best regards Håkon

Related