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

Parents Reply Children
  • 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. 

Related