cancel
Showing results for 
Search instead for 
Did you mean: 

Programming each part with a different progressive serial number

marco239955_stm1_st
Associate II
Posted on February 26, 2015 at 14:51

Hello,

  we need to assign an unique 16 bit serial number to our production SMT32F051C6T6 parts.

I can't do this by calculating it from the 96 bit UID read from the Unique device ID register because I think that in this case I won't be sure that there will not exist two parts with the same 16 bit. 

This 16 bit serial number will be saved in a flash location and then read by the firmware.

The only idea I have is to write a special software that, every time a part is to be programmed, reads the original .hex file and overwrites the relevant location with a 16 bit number that is then incremented for the next programming operation. Then the obtained hex file is used with a standard programming utility such as ST-Link Utility. Probably I'll use the command-line version in order to automate this process.

Anyway, this is a quite common need so I suppose that maybe some tools of this kind already exist, are you aware of them?

Thanks in advance.

Best regards,

   Marco
5 REPLIES 5
Posted on February 26, 2015 at 15:21

Anyway, this is a quite common need so I suppose that maybe some tools of this kind already exist, are you aware of them?

In the world I live in the developers responsible for the project (ie me and the lads in the test group) write code for the final test process that program the device and log data and serialization into a database.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
marco239955_stm1_st
Associate II
Posted on February 26, 2015 at 15:47

Thank you for your reply.

Here we have most of the things you described, anyway till today we were working with Microchip and its programming utility had such a feature (they call it ''Serialized Quick Turn Programming''). Now we are about to switch to STM32 for the new projects and I'm working to make sure that everything will be ready for production.

So before writing the necessary code, I'm looking whether a solution already exists.

Thank you!

Chris1
Senior III
Posted on February 26, 2015 at 15:54

The J-Link or Flasher ARM from Segger comes with a Windows application [J-Flash] that has a feature for programming a serial number with incrementing.

marco239955_stm1_st
Associate II
Posted on February 26, 2015 at 16:09

Thank you Chris! This is what I was looking for!

Posted on February 26, 2015 at 16:20

While one can use a built-in function of the programming tool, or write a custom program manipulating the binary/hex, I prefer to write shell scripts and for this task the ''srecord'' suite of programs is fit.

See for example ''inserting a long'' in http://srecord.sourceforge.net/man/man1/srec_examples.html

JW