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

BLE address issue

Hi team,

My customer wants to read the BLE address (random address that is generated by nRF52) to generate a QR code for quick pairing in their application. Do we have any suggestion if they want to the mass read-out the random address? Or any code for reference?

Also, if they finally buy their own public address (The IEEE one), how can they write the public address into our chip, believe they do not need to generate/ write the public address one by one, right? Any reference code for mass production write-in?

Thanks!

Leon Wu

  • Hi Leon

    My customer wants to read the BLE address (random address that is generated by nRF52) to generate a QR code for quick pairing in their application. Do we have any suggestion if they want to the mass read-out the random address? Or any code for reference?

    When you use a random static BLE address it will be based on the DEVICEADDR[] fields in the FICR, which you can read out from the command line using nrfjprog (assuming you have a debugger connected to the nRF device):

    C:\Users\too1>nrfjprog --memrd 0x100000A4 --n 8
    0x100000A4: C155CC16 DDD62525                     |..U.%%..|

    Some bit manipulations are needed to convert the readout from nrfjprog to the 6-byte BLE address, but this can be automated in a script. 

    Also, if they finally buy their own public address (The IEEE one), how can they write the public address into our chip, believe they do not need to generate/ write the public address one by one, right? Any reference code for mass production write-in?

    If they decide to buy public addresses I expect they will get a range of public addresses they can use, not a bunch of random addresses. 

    The UICR field in the flash of the device has a series of CUSTOMER registers where the customer can write their own data as needed. It should be possible to program the public address into some of these registers, and update the Bluetooth firmware to read out these registers and update the BLE address accordingly. 

    In order to write to the UICR from the command line you can also use nrfjprog:

    // Write 0x12345678 to UICR->CUSTOMER[0]
    nrfjprog --memwr 0x10001080 --val 0x12345678
    
    // Write 0x87654321 to UICR->CUSTOMER[1]
    nrfjprog --memwr 0x10001084 --val 0x87654321
    

    To automate this it is possible to call nrfjprog from a script or application running on the PC side. 

    Best regards
    Torbjørn

Related