[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-chat] Serial Numbers with avrdude (or other?)
|
From: |
Andy Warner |
|
Subject: |
Re: [avr-chat] Serial Numbers with avrdude (or other?) |
|
Date: |
Wed, 14 Sep 2005 13:11:13 -0500 |
|
User-agent: |
Mutt/1.2.5i |
David Kelly wrote:
> I can see the need in the near future to embed a sequential serial
> number in either EEPROM or FLASH. Avrdude appears to be a good choice
> but doesn't list an explicit option to do this. It does have a means
> of counting erase cycles which is close but not quite what I'm after.
>
> The -U option might work without having to generate a hex or srec
> file for each and every serial number, but in the "m" immediate mode
> I don't see any means of specifying an address?
Here is an approach I use, consisting of two parts:
1. A perl script that formats my eeprom area (in my case this
was the _entire_ eeprom, consisting of a serial #, some default
parameter values and some manufacturing data (date, time, host etc))
This script uses pack to directly format a binary record of the
required size (after suitable argument cooking.) Serial # is
extracted directly from MySQL database, which is then updated
with manufacturing data.
2. pipe that directly to avrdude using this command:
-U eeprom:w:-:r
Works great, lasts a long time.
If I wanted to do something other than write from the beginning of
the eeprom, I'd use objcopy or a similar tool to locate the
binary data structure somewhere other than 0 and let avrdude
do it's thing.
--
address@hidden
Andy Warner Voice: (612) 801-8549 Fax: (208) 575-5634