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.
Any clue on how to "make" a file from command line? Am able to invoke compiler from command line, but then am not too sure whether it is compiling the file. After compilation i got to 'make' to get a HEX file. is there a way of directly giving make as a command on command line and get a hex file?
"the system that i am designing wouldnt remain connected to any system...hence there wont be any communication thing possible" That's needn't be the case. Many products have an interface that is used only during the manufacturing process for test & configuration purposes. "its just during the burning of code into the chip...i need such a mechanism... so i can initialize my varaibles" So, it sounds like what you actually need is a unique identifier to be applied to each individual unit manufactured? Like a serial number, or the MAC address of an ethernet card? If so there are many possibilities: 1. you could re-compile the code for every single unit unit produced, changing a command-line define each time. This is unlikely to be practical. 2. post-process the hex file to add the unique ID at the time that each device is programmed. Any decent commercial batch programming facility should be able to do this. 3. have a hardware "module" that provides the unique ID, similar to the idea of the SIM in a GSM phone. Or something like the Maxim/Dallas "silicon serial number" http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3711 Or maybe something in your system already has a unique ID (eg, ethernet MAC)... 4. provide a test/configuration interface whereby the serial number can be programmed during manufacture; eg, to be stored in EEPROM (or flash, if in-application programming is possible) "i got SCCAVR, CVAVR & some other tools" These are all AVR tools - so why are you asking on the Keil site. The site is supposed to be for discussing Keil tools: http://www.keil.com/forum/
"....U think that can help me....U may let me know...." Who is "U" ? Is he any relation of "M" or "Q" ? Or have you just worn your fingers out with typing all those dots.....................? You've made it an uppercase 'U', so it's taking you 2 keystrokes anyway - would it be that hard to just hit one more key and make it a proper "you"? You could always economise on the dots if you're that desparate to conserve keystrokes................................!
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?