<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/36915/how-will-i-pass-command-line-arguments-to-cross-compiler-code</link><description> 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 &amp;amp; not by</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/154938?ContentTypeID=1</link><pubDate>Mon, 15 May 2006 07:38:04 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:555ecbfc-151e-4f67-bd8d-798533f6751e</guid><dc:creator>Karl Hamsher</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;Now, without performing a complete erase of the chip, is it possible to program only a few addresses ...&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Yes, as long as those &amp;quot;few addresses&amp;quot; are in an erased state, they can be programmed separately from the existing code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/154940?ContentTypeID=1</link><pubDate>Mon, 15 May 2006 07:37:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:dc9cdc11-e9a9-4cf8-95fa-deb6f401a071</guid><dc:creator>Karl Hamsher</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;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?&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
It sounds like you are still intent on not using something like the DS2411 or EEPROM.  In that case, one would normally use a fixed ROM address and not worry about trying to &amp;quot;find&amp;quot; where the linker placed a const code object (and thus located it in a HEX file).  Then you can simply add a HEX record to the hex file or generate &amp;quot;overlay&amp;quot; hex files as described in one of the links I provided previously.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.htsoft.com/forum/all/showflat.php/Cat/0/Number/14440" target="_blank"&gt;http://www.htsoft.com/forum/all/showflat.php/Cat/0/Number/14440&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
By the way, the program described therein is provided in source form, so you can modify it to do your &amp;quot;random&amp;quot; thing rather than generate sequential serial numbers.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;quot;Another question, Is it possible to write scripts, which would automatically goto a particular line &amp;amp; particular column in a hex file and make the required changes?&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Yes, 010 Editor (URL provided previously) has the means to read in a HEX file, programmatically modify it, and write it back out.  One could do similar things with Awk, Perl, etc. scripts and of course C (even using the source code mentioned above as a starting point).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/154941?ContentTypeID=1</link><pubDate>Mon, 15 May 2006 07:35:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1e45be64-e70f-4513-9954-2700c3e539a8</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;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?&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Why??&lt;br /&gt;
That&amp;#39;s a totally impracticaly way of handling 25000 per month!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/154451?ContentTypeID=1</link><pubDate>Mon, 15 May 2006 06:13:48 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:89367fb0-ade9-42b6-86fe-3c415f6c2a7d</guid><dc:creator>Jinen Dedhia</dc:creator><description>&lt;p&gt;&amp;quot;Again is it possible to program a particular address without affecting rest of the code?&lt;br /&gt;
&lt;br /&gt;
Again, what do you mean by that? &amp;quot;&lt;br /&gt;
&lt;br /&gt;
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)?&lt;br /&gt;
&lt;br /&gt;
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&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/154450?ContentTypeID=1</link><pubDate>Mon, 15 May 2006 06:02:17 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0710d397-541e-4d16-bc0d-966487067185</guid><dc:creator>Jinen Dedhia</dc:creator><description>&lt;p&gt;People,&lt;br /&gt;
&lt;br /&gt;
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?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another question, Is it possible to write scripts, which would automatically goto a particular line &amp;amp; particular column in a hex file and make the required changes?&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Jinen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/153904?ContentTypeID=1</link><pubDate>Sat, 13 May 2006 15:51:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:78322acc-5659-4a93-b812-5b9dc97e7f37</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;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.&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Why?&lt;br /&gt;
If you&amp;#39;re doing 25k/month, you need a command-line utility that can be called from a script; you do &lt;i&gt;&lt;b&gt;not&lt;/b&gt;&lt;/i&gt; want a manual GUI!!&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;quot;Can you provide some more inputs on DS2411?&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
The link I gave is to Maxim&amp;#39;s product page - that gives you the Datasheet, relevant App Notes, and ordering information.&lt;br /&gt;
What more could you want???&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;quot;Is there a way, that I can program my EEPROM by normal C-compiler?&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
What do you mean by that?&lt;br /&gt;
The C compiler will not program anything!&lt;br /&gt;
The C compiler just translates your source code into object code.&lt;br /&gt;
&lt;br /&gt;
Of course you can write &amp;#39;C&amp;#39; source code to program an EEPROM! You would then need to use a &amp;#39;C&amp;#39; compiler to convert your source code into something executable to actually do the programming&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;quot;Again is it possible to program a particular address without affecting rest of the code?&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Again, what do you mean by that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/153902?ContentTypeID=1</link><pubDate>Sat, 13 May 2006 15:00:44 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:bd5b11a1-ea61-4feb-8154-8fd7aa30c895</guid><dc:creator>Karl Hamsher</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;Is there a windows based tool for editing a hex file?&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
One Windows-based programmable binary (and HEX) file editor is:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.sweetscape.com/010editor/" target="_blank"&gt;http://www.sweetscape.com/010editor/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Another toolchain vendor has some free software to deal with serial numbers in HEX files:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.htsoft.com/forum/all/showflat.php/Cat/0/Number/12986" target="_blank"&gt;http://www.htsoft.com/forum/all/showflat.php/Cat/0/Number/12986&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.htsoft.com/forum/all/showflat.php/Cat/0/Number/14440" target="_blank"&gt;http://www.htsoft.com/forum/all/showflat.php/Cat/0/Number/14440&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;quot;Can you provide some more inputs on DS2411?&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
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?&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;quot;Is there a way, that I can program my EEPROM by normal C-compiler?&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Yes.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;quot;Again is it possible to program a particular address without affecting rest of the code?&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Yes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/153268?ContentTypeID=1</link><pubDate>Sat, 13 May 2006 14:22:34 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:975c9cbf-ed26-4a23-9dea-e3f44102b597</guid><dc:creator>Jinen Dedhia</dc:creator><description>&lt;p&gt;People,&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Can you provide some more inputs on DS2411?&lt;br /&gt;
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?&lt;br /&gt;
&lt;br /&gt;
Thanks alot people for your valuable inputs.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Jinen.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/152570?ContentTypeID=1</link><pubDate>Sat, 13 May 2006 04:37:25 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7f8bc1f6-4079-4dad-9352-79b4396f4100</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;Most programer have a serial number generator ... Or you can edit the hex file.&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Both of those come under &amp;#39;C&amp;#39; (see &amp;#39;2&amp;#39; in my original list)&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;m sure that any programming facility suited to volumes of 25k/month should have no problem doing this for you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/151783?ContentTypeID=1</link><pubDate>Sat, 13 May 2006 00:09:55 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4bc70b88-8103-435f-ac13-5e861716a0dc</guid><dc:creator>Neil Kurzmam</dc:creator><description>&lt;p&gt;B C or D&lt;br /&gt;
&lt;br /&gt;
Most programer have a serial number generator.  They can put a unique number in the  the flash.&lt;br /&gt;
&lt;br /&gt;
Or you can edit the hex file.  It is not that hard to do.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/151048?ContentTypeID=1</link><pubDate>Fri, 12 May 2006 18:16:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b5450e89-fb0d-44e6-ac85-69c268d16155</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;What i need to manufacture is in 1000&amp;#39;s approx 25k a month.&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
So re-building the code for each individual unit to give a unique image for every single one (Option A) is clearly impractical!!&lt;br /&gt;
&lt;br /&gt;
Therefore you need to look at options like B or C...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/151780?ContentTypeID=1</link><pubDate>Fri, 12 May 2006 17:16:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:06eed20f-428b-42c0-888e-a0b43d7a3f35</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;the simple solution would be to add a DS2411&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Yes - that&amp;#39;s the &amp;quot;silicon serial number&amp;quot; of my option &lt;b&gt;3&lt;/b&gt;:&lt;br /&gt;
&lt;a href="http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3711" target="_blank"&gt;http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3711&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
However, this may or may not meet the OP&amp;#39;s specific requirements for the type of number that he needs...?&lt;br /&gt;
&lt;br /&gt;
We await comments...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/151049?ContentTypeID=1</link><pubDate>Fri, 12 May 2006 16:30:13 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:24f7821e-0850-45be-b416-73983cc666b2</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;the simplesolution would be to add a DS2411&lt;br /&gt;
&lt;br /&gt;
Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/150573?ContentTypeID=1</link><pubDate>Fri, 12 May 2006 16:22:43 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:bcc319f9-6925-448b-9c9c-dd9763fc713a</guid><dc:creator>Jinen Dedhia</dc:creator><description>&lt;p&gt;Well, unique identity remains constant throughout the lifecycle of the product.&lt;br /&gt;
&lt;br /&gt;
What i need to manufacture is in 1000&amp;#39;s approx 25k a month.&lt;br /&gt;
&lt;br /&gt;
I am not really stuck on A,B or C... I am just trying to visualize different options.&lt;br /&gt;
&lt;br /&gt;
Thanks again for replying.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/150158?ContentTypeID=1</link><pubDate>Fri, 12 May 2006 06:10:44 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f3efc846-7be2-4485-b04d-8e6695632ffd</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;its like giving a unique identity to each and every unit manufactured&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
So how many units are we talking about - under 10?  dozens? hundreds? thousands...?&lt;br /&gt;
&lt;br /&gt;
Is the &amp;quot;unique identity&amp;quot; fixed for the entire product&amp;#39;s lifetime, or do units need to be able to have new identities?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/150157?ContentTypeID=1</link><pubDate>Fri, 12 May 2006 06:07:13 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:472fb584-a4aa-4dd9-9216-97fee7fd0b30</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;Is there a way for exporting a variable from my cross compiler to any .txt file?&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
What would be the point of that?&lt;br /&gt;
&lt;br /&gt;
What do you mean?&lt;br /&gt;
&lt;br /&gt;
You don&amp;#39;t want anything from the compiler other than the executable code.&lt;br /&gt;
&lt;br /&gt;
The options I outlined before boil down to basically 3 types:&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
B. Have your programming facility insert the code into the image at the time that you burn the Chips&lt;br /&gt;
&lt;br /&gt;
C. Have your code read the ID from its environment at runtime.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You seem to be stuck on A; I think B or C are where you need to be looking.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/149711?ContentTypeID=1</link><pubDate>Fri, 12 May 2006 03:10:20 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7a929cd6-3213-4a55-85d6-8eec324e7a7f</guid><dc:creator>Jinen Dedhia</dc:creator><description>&lt;p&gt;Thanks alot Neil,&lt;br /&gt;
&lt;br /&gt;
You have got it right, its like giving a unique identity to each and every unit manufactured.&lt;br /&gt;
&lt;br /&gt;
Is there a way for exporting a variable from my cross compiler to any .txt file?&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Jinen.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/149194?ContentTypeID=1</link><pubDate>Fri, 12 May 2006 02:35:15 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5c4cf279-b2ef-4d18-85b5-219ac8780c21</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;For manipulating Hex files, look at:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://srecord.sourceforge.net/" target="_blank"&gt;http://srecord.sourceforge.net/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I think it might be included in CodeVision?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/148778?ContentTypeID=1</link><pubDate>Fri, 12 May 2006 02:31:38 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:840b30d1-6135-4bf5-a548-1851d05c72cb</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;....U think that can help me....U may let me know....&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Who is &amp;quot;U&amp;quot; ?&lt;br /&gt;
Is he any relation of &amp;quot;M&amp;quot; or &amp;quot;Q&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
Or have you just worn your fingers out with typing all those dots.....................?&lt;br /&gt;
&lt;br /&gt;
You&amp;#39;ve made it an uppercase &amp;#39;U&amp;#39;, so it&amp;#39;s taking you 2 keystrokes anyway - would it be that hard to just hit one more key and make it a proper &amp;quot;you&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
You could always economise on the dots if you&amp;#39;re that desparate to conserve keystrokes................................!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/123244?ContentTypeID=1</link><pubDate>Fri, 12 May 2006 01:53:25 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ffc61048-fc94-4428-89a6-889c219b125b</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;the system that i am designing wouldnt remain connected to any system...hence there wont be any communication thing possible&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
That&amp;#39;s needn&amp;#39;t be the case.&lt;br /&gt;
Many products have an interface that is used only during the manufacturing process for test &amp;amp; configuration purposes.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;quot;its just during the burning of code into the chip...i need such a mechanism... so i can initialize my varaibles&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
So, it sounds like what you actually need is a unique identifier to be applied to each individual unit manufactured?&lt;br /&gt;
&lt;br /&gt;
Like a serial number, or the MAC address of an ethernet card?&lt;br /&gt;
&lt;br /&gt;
If so there are many possibilities:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1.&lt;/b&gt; 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.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2.&lt;/b&gt; 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.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3.&lt;/b&gt; have a hardware &amp;quot;module&amp;quot; that provides the unique ID, similar to the idea of the SIM in a GSM phone.&lt;br /&gt;
Or something like the Maxim/Dallas &amp;quot;silicon serial number&amp;quot; &lt;a href="http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3711" target="_blank"&gt;http://www.maxim-ic.com/quick_view2.cfm/qv_pk/3711&lt;/a&gt;&lt;br /&gt;
Or maybe something in your system already has a unique ID (eg, ethernet MAC)...&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;4.&lt;/b&gt; 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)&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;quot;i got SCCAVR, CVAVR &amp;amp; some other tools&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
These are all AVR tools - so why are you asking on the Keil site.&lt;br /&gt;
&lt;br /&gt;
The site is supposed to be for discussing Keil tools:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.keil.com/forum/"&gt;http://www.keil.com/forum/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/112104?ContentTypeID=1</link><pubDate>Fri, 12 May 2006 01:01:00 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:06a16424-b6b8-40db-b3cb-dc70fee7ac1e</guid><dc:creator>Jinen Dedhia</dc:creator><description>&lt;p&gt;Any clue on how to &amp;quot;make&amp;quot; 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 &amp;#39;make&amp;#39; to get a HEX file. is there a way of directly giving make as a command on command line and get a hex file?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/98091?ContentTypeID=1</link><pubDate>Thu, 11 May 2006 23:48:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:804f9c7b-eac1-4a3c-95c0-7c569eaf63bc</guid><dc:creator>Karl Hamsher</dc:creator><description>&lt;p&gt;Think about passing it to the compilation process as a defined value on the command line.  For example &amp;quot;-DRAND=nnnn&amp;quot;, where &amp;quot;nnnn&amp;quot; is a random value generated by an external program or script.  The program or script could invoke the compiler directly or could edit the &amp;#39;make&amp;#39; or &amp;#39;batch&amp;#39; file you build from.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/74033?ContentTypeID=1</link><pubDate>Thu, 11 May 2006 23:20:02 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1b2145ca-bfc3-4c81-919a-6383be4c5c18</guid><dc:creator>Jinen Dedhia</dc:creator><description>&lt;p&gt;Thanks people for your inputs.&lt;br /&gt;
&lt;br /&gt;
Let me explain this in some more details. I need to assign a value to a variable in my cross compiler code from command line. This value wouldnt be altered at any point of time. This value, that i would be passing with a command line, would itself be a random value (w.r.t time) generated by another code ( I need to remove manual entries...as it is more like a security driven application..)... once i assign this value to a variable in my cross compiler code....i wouldnt need to alter it...or take any more inputs from command line.....the system that i am designing wouldnt remain connected to any system...hence there wont be any communication thing possible....its just during the burning of code into the chip...i need such a mechanism...so i can initialize my varaibles...&lt;br /&gt;
&lt;br /&gt;
And yes...this is similar to argc, argv in main......but with a constraint....that they should be picked during compile time....and not run time...&lt;br /&gt;
&lt;br /&gt;
Thanks again for replying to my question.&lt;br /&gt;
&lt;br /&gt;
This is for andy.....compiler is no connstraint for me....i got SCCAVR, CVAVR &amp;amp; some other tools here with me....incase there is any other tool....U think that can help me....U may let me know....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/46055?ContentTypeID=1</link><pubDate>Thu, 11 May 2006 20:29:43 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4f2a7702-8506-426f-a5f4-b83a416227d4</guid><dc:creator>Drew Davis</dc:creator><description>&lt;p&gt;In the target system, who types a command line?  Do you actually have a command line interface task?&lt;br /&gt;
&lt;br /&gt;
Or do you mean you want to pass an argument to main() -- argc and argv?  These arguments are usually derived from a command line in an interactive OS by the C run-time system.  In an embedded system, they&amp;#39;re generally meaningless, unless that embedded system is running some sort of user shell.&lt;br /&gt;
&lt;br /&gt;
Does this value need to be altered dynamically?  That is, every time the system is powered on, or the user hits a key, or some such, you need to supply a value?  In this case, you&amp;#39;d need to describe your user interface hardware.  You probably have a UART somewhere on your microcontroller, for example.  Perhaps you use it for a human-readable CLI, or perhaps you just invent a protocol to send a few bytes across the serial port.&lt;br /&gt;
&lt;br /&gt;
If it is sufficient that the value be supplied at compile time, then all you really need to do is set a #define, or perhaps generate a small .c file with a suitable constant variable definition.  That hardwires in the value, and no communication is necessary.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How will I pass command line arguments to cross compiler code?</title><link>https://community.arm.com/thread/46054?ContentTypeID=1</link><pubDate>Thu, 11 May 2006 11:29:51 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:259d0b5a-79c3-4366-be77-4ea1fc3965c8</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;What toolset?&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;quot;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.&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
For a start, none of the Keil tools generates exe files.&lt;br /&gt;
exe files are specifically for execution on the PC; Keil tools generate image files to be loaded (somehow) into target hardware and run there - not on the PC.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;quot;The problem is, EXE file would be executed by the chip &amp;amp; not by the PC, hence giving any command line argument would need a connection between the chip &amp;amp; one of the ports on the PC.&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
An RS232 link is a very common way to interface a PC to an embedded system.&lt;br /&gt;
All sorts of other interfaces are also possible to control the embedded system, including keypads, buttons, etc, etc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;quot;Is there a way/mechanism by which I can give a command line argument during compile-time and not during the run-time?&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
If you give it at compile time, it becomes a fixed part of the generated code - so it can hardly be called an &amp;quot;argument&amp;quot;&lt;br /&gt;
What exactly do you mean?&lt;br /&gt;
&lt;br /&gt;
Perhaps if you described what you&amp;#39;re actually trying to achieve we could come up with some suggestions as to how to achieve that...?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>