I need to add unique serial numbers to an application that has USB mass-storage functionality, is there any internal register in the AT91 that has a unique number to use?
Anyone dare to suggest an alternate solution to my problem? I would rather want to avoid modifying the .bin file for each unit if I can.
Hi
I don’t think that the requirement to have a unique serial number for USB mass storage requirements has any major conceptional differences to the requirement for a unique MAC address for the Ethernet interface.
In the case of MAC address it is up to the manufacturer to ensure that MAC addresses are used from the defined block that the manufacturer purchases and than addresses are used only once. For USB mass storage this is essentially the same apart from the fact that the unique serial number is not purchases - it still needs to be managed (unless silicon really can give a unique number).
MAC addresses are usually saved in a reserved sector of FLASH (or in a parameter system) and loaded during manufacturer (eg. via UART, USB, Ethernet or whatever method is chosen). It would be possible to modify each binary image to achieve the same thing but this is a rather extreme solution and may not work well when SW upgrades are also made at later dates.
If the MAC problem is solved the MAC address could probably be shared as serial number (this is often done) - or at least the serial number derived from it.
If there is no MAC (in your case the chip doesn’t have Ethernet so obviously not) the parameter system seems the standard way to go.
Regards
Mark
You can buy MAC addresses (in i2c or spi eeproms) from Microchip.
/mike
There’s a Device ID in the ARM7TDMI core, but unfortunately it’s only unique between revisions. I thought there might be some serial number of some kind, but it doesn’t look like it.
Does the number need to be the same for the chip all the time? Can it just generate a random number each power up?
If you need a unique number, maybe a startup routine that writes to internal flash a psuedo random generated number, or maybe a number pulsed over a gpio. That way you don’t need to mess with the bin file.