Content originally posted in LPCWare by MikeSimmonds on Sat Jun 01 14:32:49 MST 2013
[FONT=Tahoma][SIZE=2]In our applications, we use the 1st (4K) flash sector as a (basic) bootloader.
I have written a customised and company specific utility similar to 'FlashMagic'
to install this bootloader via the ISP uart. [It is not difficult, all the required info
is in the user manual. Look at the ISP section, and there is an AppNote about
X-Modem encoding.] Remember to fix-up the boot block checksum also.
On Windows, the (template) binary payload can be added to the executable
(to avoid mistakes), or called up as an external file (for flexibility).
I reserve a certain number of address bytes within the booatloader for a serial
number. The PC installer alters the bootloader binary image before each and
every download to a new board to increment the serial number. Thus all of our
boards has a unique serial number. The PC app 'remembers' the last used number
in an ini file.
The serial number is at a fixed place in (low) flash memory, any user application
in other flash sectors can read the number easily in either assembler or "C" code.
If you need complete control over serialisation, you could do something similar.
I think that the paid for version of flash magic can do this.
As a complete alternative, serveral support chips will also have either a unique
factory serial number or an OTP (one time programable) region.
E.g. SPI/I2C data flash, some Dallas RTC chips, PLD's/FPGA's etc.
I hope that this will give some ideas about serialisation of production boards.
Cheers, Mike
[/SIZE][/FONT]