Local BLE Address getting erased after flash and random address is showing instead

Hi Nordic Team,

My dev enviroment is as follow:

nRF52832(ble central)+ S132+ SES+ SDK 17.0

We are facing an issue regarding local BLE Address . When we are flashing code , our local ble address is getting wiped out and a random ble address is generating instead. 

Then we are manually feed our local ble address and again after flashing , our local ble address is getting wiped out and a random ble address is generating instead.

So how can we set our local ble address permanently so that it will remain even after flashing.

Kindly help me resolve this issue. Thank You.

Parents
  • Hi

    I assume you are referring to the BLE GAP address here, or what? If so, it sounds like you've set the address type to a random one so that it will be randomized after flashing the device. If you're referring to something else, can you specify what address this is?

    In order to save something between flashes, you need to store it in the UICR page, which shouldn't be erased when the device is programmed.

    Best regards,

    Simon

  • Yes, I am talking about Bluetooth Device address . We are using NINA B111 BLE Chip. 

    void set_addr(void)
    {
      uint32_t err_code;
      ble_gap_addr_t my_addr;
      err_code = sd_ble_gap_addr_get(&my_addr);
      APP_ERROR_CHECK(err_code);
    
    
    
      my_addr.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC;
     
      memcpy((uint8_t *)my_addr.addr, (uint8_t *)(NRF_UICR + 0x0080), BLE_GAP_ADDR_LEN);
    
      
    
      err_code = sd_ble_gap_addr_set(&my_addr);
      APP_ERROR_CHECK(err_code);
    
    }
     

    I have tried to set address using sd_ble_gap_addr_set() following few posts here. Is this the right way to do it?

Reply
  • Yes, I am talking about Bluetooth Device address . We are using NINA B111 BLE Chip. 

    void set_addr(void)
    {
      uint32_t err_code;
      ble_gap_addr_t my_addr;
      err_code = sd_ble_gap_addr_get(&my_addr);
      APP_ERROR_CHECK(err_code);
    
    
    
      my_addr.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC;
     
      memcpy((uint8_t *)my_addr.addr, (uint8_t *)(NRF_UICR + 0x0080), BLE_GAP_ADDR_LEN);
    
      
    
      err_code = sd_ble_gap_addr_set(&my_addr);
      APP_ERROR_CHECK(err_code);
    
    }
     

    I have tried to set address using sd_ble_gap_addr_set() following few posts here. Is this the right way to do it?

Children
No Data
Related