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

Device address fro public device address format

Hi In current Desktop 2 project, We know that software device stack takes 48-bit random device address from FICR registers (DEVICEADDR[1: 0]) for BTLE. Each nRF51 has unigue address. We are planning to apply public device address (compny_assigned + company_id) from IEEE. How can we replace FICR device address by it in nRF51? Then, no side effect at all.

  • Hi there,

    EDIT: If what you want is to overwrite the random address in the FICR with your own, this is not possible as of today.

    After boot, your application can simply read the public address from flash (it's up to you where you store it) and then use this function:

    sd_ble_gap_address_set()

    to set it.

    Regards,

    Carles

  • A custom address can be put in UICR instead of FICR. As explained in the reference manual, addresses 0x080 - 0x0FC in UICR is reserved for custom usage, and can for example be written to using nrfjprog (see its --help for details). You'd still have to read the address from UICR and set it in the stack on boot, as Carles explains.

  • Hi I tried your method to change device address but it seems not working. The below is test code. Using debug mode and seting breakpoint in _NOP(), the pointer was never stopped.

    //Set new device address to software stack ble_gap_addr_t same_addr; same_addr.addr[0] = 0x00; same_addr.addr[1] = 0x01; same_addr.addr[2] = 0x02; same_addr.addr[3] = 0x03; same_addr.addr[4] = 0x04; same_addr.addr[5] = 0x05;

    sd_ble_gap_address_set(&same_addr);

    //Then, get the device address from software stack. err_code = sd_ble_gap_address_get(&ble_addr);
    ASSERT(err_code == NRF_SUCCESS);

    if((ble_addr.addr[0] ==0)&&(ble_addr.addr[1] ==1)&&(ble_addr.addr[2] ==2)&&(ble_addr.addr[3] ==3)&&     (ble_addr.addr[4] ==4)&&(ble_addr.addr[5] ==5)){
             __NOP();    
    }
    
  • Hi there,

    You need to set same_addr.addr_type to a value, in your case it would probably be:

    BLE_GAP_ADDR_TYPE_RANDOM_STATIC

    Hope this helps,

    Carles

  • Thanks for your quick reply. After I added the address type,the device address still not be updated. Shall I consider where to add sd_ble_gap_address_set(&same_addr) in the source code? like before enable softdevice or after?

    same_addr.addr_type = BLE_GAP_ADDR_TYPE_RANDOM_STATIC.

Related