Hi All, I've got a large project that has unique data for each device (e.g. serial number, params etc). I can enter the unique data and compile in uVision but this involves linking the whole project each time which takes too long (I have 1000 unique IDs that need to be programmed)... So I located my unique data at fixed addresses and created data hex files which can then be merged with the code hex file before flashing (using hex2bin, bin2hex) and I was wondering if there is a better or more elegant way to do this? thanks, Malcom
That's the way I'd do it for mass production. Your flash programmer should let you program two different hex files in two different places in two different passes. So you don't actually have to merge the hex files before programming. Merging first might be just as easy in practice, unless you have a way to mass program lots of flash parts with the (same) code, and then update each one individually. For debug/lab use, it's sometimes convenient if you can afford some sort of parameter display/editor built into the user interface of the device, assuming it has one. That it, maybe it has a serial port with a command line interface, and you throw in some debug commands to let you fiddle with the parameter field values. But you don't want to have to have a human execute some manual process for each board for the production boards.
Hi Drew, I'm using the Philips LPC2000 flash utility to flash the boards. I dont think it has the ability to load consecutive hex files without erasing the device first. Also it's limited to 38400 baud and takes about 4 times longer than the ULINK to program the same code. I'm thinking of making a press on JTAG header so that boards can be flashed quickley. I could also use uVision to merge the data files that way. thanks again, Malcom
Unless your programmer has a broken Intel Hex implementation that requires addresses in order, can't you just open a command prompt and do
copy code.hex + data.hex both.hex
Seems like another good thread to throw in a plug for SRecord. http://srecord.sourceforge.net/ SRecord is a utility that understands a lot of EEPROM/flash file formats, and can combine, split, merge, slice, chop, and puree them in a variety of ways.