How to change the BLE mac address of NRF5430 at Real Time with NCS SDK?

  I follow below thread and refer to sample code and  the BLE mac address can be changed after system just boot up.

   devzone.nordicsemi.com/.../325131

   But after boot up, I want to change  the BLE mac address again, it doesn't work and the ble MAC address keep unchanged, it is expected?  Is it possible to change the desired BLE mac address at real time without HW reset?

Below is my Sudo code:

nrf5340 boot up,  

bt_enable(NULL);

bt_addr_t addr = {{0xFE, 0xCA, 0xA0, 0xAC, 0xDC, 0xBA}};
ble_set_mac(&addr);

settings_load();

ble_advertise();  //it works with ble addr = {{0xFE, 0xCA, 0xA0, 0xAC, 0xDC, 0xBA}}

ble_Stop_advertise();

bt_addr_t addr = {{0xFE, 0xCA, 0xA0, 0xAC, 0xDC, 0xBB}};
ble_set_mac(&addr);

settings_load();

ble_advertise(); //it doesn't work, ble address cant be changed.

found the ble's mac address is still  = {{0xFE, 0xCA, 0xA0, 0xAC, 0xDC, 0xBA}};

Related