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

Generation of a serialized ID code at load time.

Hello Nordic Pros,

I am a retired old school hardware guy doing some firmware for an NRF51822 product using the Kiel IDE.  In my prior life, doing similar work, I recollect adding some lines to a linker script in the load section that increments a variable each time a load is performed to a new board, and then using the variable from with the c code as (part of) a unique ID field for the device.  Does anyone have an example or any ideas of how to such a thing these days?  

Thanks in advance,

RobIn@TL

  • Just use FICR->DEVICEID[0] and FICR->DEVICEID[1].

    These contain a 64 bit number that will be unique for each chip.

  • Hello Turbo,

    Thanks for that info. The ID  needs to be easily recognizable ID for our customers.  So we need to generate.  It is also being used as a count of boards in the field.

    Any other ideas are greatly appreciated. 

    Robin@TL

  • There's a customer area in the UICR you can use, there's 32 x 32 bit words there. The easiest way to program that would be to have a custom step after you flash the main software onto the board which just emits the right Segger commands to write a value in there. You can do that with the segger directly or you might find something useful in the Nordic python driver, don't know as I've never looked at it. 

    Yes you could also do it by stuffing a constant into a linker script and making a section which maps to the UICR and putting the value in however that's probably going to be more of a pain especially as most of the IDEs abstract the whole link process away. 

    I'd probably put this step in as part of the post flash board testing. 

  • Hello again Turbo, and other Nordic Pro's,

    So I have dropped the idea of generating my own unique idea, in favor of using something on the chip.  To test our boards we are using a BLE UART central device that reports a "target" ID number when it connects.  Do any of you know where this ID come from and whether or not is unique among chips, and where in the Nordic documentation maze that this information might reside?

    What a zoo trying to find this seemingly simple information!

    Thanks

    Robin

  • Hi,

    The nRF51 has a 64 bit DEVICE ID in FICR (see page 22 in nRF51 Reference Manual v3.0.1).

1 2 3