This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Adding a unique Device Serial number

Other Parts Discussed in Thread: CC2640

I need to add a custom unique device serial number to each device during manufacturing

I think there are a number of ways to do this,  just wondering which would work the best

1. Add a unique ID using the smart RF Programmer

Using its ability to load a modified Hex image

Joshua Newth provides a good write up on this

2. Use the CC2640 SVN persistent storage area

Add a Bluetooth characteristic to load it on the test station

3. Keep it in my on-board external EEPROM

Add a Bluetooth characteristic to load it on the test station

Thanks I would appreciate some recommendations

Brian

  • Hello Brian,

    Can you provide details on how you will use the unique number? You mention a BT characteristic but not how it will be used.

    Best wishes
  • We would like to add a unique serial number (sequential) to each manufactured device to support inventory and customer purposes

    We will still have the TI unique Mac address

    We want to add a 8-10 byte ascii ID (ABC0000002232)

    We will serialize the device on the last manufacturing test station

    We will be able to read out the serial number via either the standard device characteristic 0x2A25 or a custom characteristic

    We have an on-board FRAM we could use to store the serial number

    Or we could serialize the device using the Flash programmer and keep the serial number in flash memory

    or can we use the SNV memory ??

    Thanks
    Brian
  • On this site there is a detailed posting on how to add a serial number to program flash space by Joshua Newth shown below

    His step by step instruction is IAR based and I would like to replicate this with CCS

    How do I reserve a linker space using CCS ??

    What is the file name for the linker script ??

    Thanks
    Brian



    1. I edited the link file to reserve a 16-byte space in code.

    I updated my project to point to a new custom link file (in IAR, right-click on Project name > Options... > Linker > Config)
    First observe that I am using a (somewhat modified) version of the hal_sleep module. The hal_sleep module reserves an 8-byte partition at the end of the 32K CODE space like so:

    -D_SLEEP_CODE_SPACE_START=(_CODE_END-7)
    -D_SLEEP_CODE_SPACE_END=(_CODE_END)
    -Z(CODE)SLEEP_CODE=_SLEEP_CODE_SPACE_START-_SLEEP_CODE_SPACE_END

    A brief explanation here: _CODE_END is 0x7FFF. _SLEEP_CODE_SPACE_START is (0x7FFF - 7) = 0x7FF8. This effectively reserves the last 8 addresses for "sleep code". The mechanics of sleep are not relevant here. I then placed my 16-byte space just before that:
    -D_SERIAL_NUM_SPACE_END=(_SLEEP_CODE_SPACE_START-1)
    -D_SERIAL_NUM_SPACE_START=(_SERIAL_NUM_SPACE_END-F)
    -Z(CODE)SERIAL_NUM=_SERIAL_NUM_SPACE_START-_SERIAL_NUM_SPACE_END

    This creates a 16-byte space starting at _SERIAL_NUM_SPACE_START computed as (((0x7FFF - 7) - 1) - 0xF) = 0x7FE8.
    It is important to note that this places this reserved 16-byte space in bank 0, the root bank. Addressing this code later will be made much simpler because of this fact. In addition, the serial number will not be overwritten in a OAD update. This is a good thing.
  • Hello Brian,

    That example is for CC254x and won't apply to CC2640.

    I would suggest taking a look at how the linker is configured to store the CCFG table in the last sector. See the ccfg_appBLE.c file and the CCS linker section definition for the .ccfg section. You can define a similar structure and place it at a specific offset following this process.

    Best wishes
  • For mass production, I won't recommend method 2 and 3 since you have to connect each device. It just takes time. And time is very important in mass production line. It gets worse when you have many devices powered on at the same time. How do you know which one is the right one to write the serial number?

    Method 1 is acceptable but the interface is mainly for engineers, not for operators.

    My suggestion is to design a dedicated PC program for operators. The PC program uses the same RBL UART channel to program device. Yes, this method will take you some time to design at the beginning. But you can design a PC program with large font and button for operators to easily operate. The program can automatically generate the serial number, modify hex file, program the device, and then write the log back to ERP system.