Hi people, I have an interesting problem here. I need to generate a number (a 4-digit Integer) and give it as a command line argument to my exe file generated by the cross compiler. The problem is, EXE file would be executed by the chip & not by the PC, hence giving any command line argument would need a connection between the chip & one of the ports on the PC. Is there a way/mechanism by which I can give a command line argument during compile-time and not during the run-time? Is there any functionality provided by the tool on these lines? Regards, Jinen.
For manipulating Hex files, look at: http://srecord.sourceforge.net/ I think it might be included in CodeVision?
Thanks alot Neil, You have got it right, its like giving a unique identity to each and every unit manufactured. Is there a way for exporting a variable from my cross compiler to any .txt file? Regards, Jinen.
"Is there a way for exporting a variable from my cross compiler to any .txt file?" What would be the point of that? What do you mean? You don't want anything from the compiler other than the executable code. The options I outlined before boil down to basically 3 types: A. Rebuild the software every time to create a unique image for each unit. Unlikely to be practical unless you have only a very small number of units indeed. B. Have your programming facility insert the code into the image at the time that you burn the Chips C. Have your code read the ID from its environment at runtime. You seem to be stuck on A; I think B or C are where you need to be looking.
"its like giving a unique identity to each and every unit manufactured" So how many units are we talking about - under 10? dozens? hundreds? thousands...? Is the "unique identity" fixed for the entire product's lifetime, or do units need to be able to have new identities?
Well, unique identity remains constant throughout the lifecycle of the product. What i need to manufacture is in 1000's approx 25k a month. I am not really stuck on A,B or C... I am just trying to visualize different options. Thanks again for replying.
the simplesolution would be to add a DS2411 Erik
"the simple solution would be to add a DS2411" Yes - that's the "silicon serial number" of my option 3: http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3711 However, this may or may not meet the OP's specific requirements for the type of number that he needs...? We await comments...
"What i need to manufacture is in 1000's approx 25k a month." So re-building the code for each individual unit to give a unique image for every single one (Option A) is clearly impractical!! Therefore you need to look at options like B or C...
B C or D Most programer have a serial number generator. They can put a unique number in the the flash. Or you can edit the hex file. It is not that hard to do.
"Most programer have a serial number generator ... Or you can edit the hex file." Both of those come under 'C' (see '2' in my original list) I'm sure that any programming facility suited to volumes of 25k/month should have no problem doing this for you!
People, Is there a windows based tool for editing a hex file? SRecord is certainly good. But I think I need to look at windows based solution aswell. Can you provide some more inputs on DS2411? Is there a way, that I can program my EEPROM by normal C-compiler? Again is it possible to program a particular address without affecting rest of the code? Thanks alot people for your valuable inputs. Regards, Jinen.
"Is there a windows based tool for editing a hex file?" One Windows-based programmable binary (and HEX) file editor is: http://www.sweetscape.com/010editor/ Another toolchain vendor has some free software to deal with serial numbers in HEX files: http://www.htsoft.com/forum/all/showflat.php/Cat/0/Number/12986 http://www.htsoft.com/forum/all/showflat.php/Cat/0/Number/14440 "Can you provide some more inputs on DS2411?" After having following the link to the Dallas/Maxim site and downloading and reviewing the datasheet and application notes, what more input could you possibly need? "Is there a way, that I can program my EEPROM by normal C-compiler?" Yes. "Again is it possible to program a particular address without affecting rest of the code?" Yes.
"Is there a windows based tool for editing a hex file? SRecord is certainly good. But I think I need to look at windows based solution aswell." Why? If you're doing 25k/month, you need a command-line utility that can be called from a script; you do not want a manual GUI!! "Can you provide some more inputs on DS2411?" The link I gave is to Maxim's product page - that gives you the Datasheet, relevant App Notes, and ordering information. What more could you want??? "Is there a way, that I can program my EEPROM by normal C-compiler?" What do you mean by that? The C compiler will not program anything! The C compiler just translates your source code into object code. Of course you can write 'C' source code to program an EEPROM! You would then need to use a 'C' compiler to convert your source code into something executable to actually do the programming "Again is it possible to program a particular address without affecting rest of the code?" Again, what do you mean by that?
People, I am trying to use a windows based hex-editor. Is there a smart way for identifying where in the hex file I would need to make changes? Another question, Is it possible to write scripts, which would automatically goto a particular line & particular column in a hex file and make the required changes? Regards, Jinen
"Again is it possible to program a particular address without affecting rest of the code? Again, what do you mean by that? " Let me reframe my question. I have a particular code burnt into a chip. Now, without performing a complete erase of the chip, is it possible to program only a few addresses (maybe burning some data or altogether a new code, without affecting the current code)? I think, Dan has to say YES (provided DAN got it correctly in the 1st instance). If you have a different opinion or answer, then please reply for the same
"I am trying to use a windows based hex-editor. Is there a smart way for identifying where in the hex file I would need to make changes?" Why?? That's a totally impracticaly way of handling 25000 per month!!!