<?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>Locating Code</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/42528/locating-code</link><description> I wish to install a bootloader in a specific sector of the LPC2106. How can I place a section of code to start at a specific address? 
 
Thanks 
 
Rich </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Locating Code</title><link>https://community.arm.com/thread/134513?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2005 12:56:43 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:aa964d30-9bf4-47d7-ac44-ac1d49b7c66b</guid><dc:creator>Rich Soennichsen</dc:creator><description>&lt;p&gt;I have this ALMOST working.  I am writing a bootloader to update on-chip flash.  I have the BL code located in an upper sector and it all works well except that the IAP calls result in a code fetch from sector 0 which has been erased.  Although I was able to locate the BL code to an upper sector there is still a segment called ?PR?C?SDIV which remains.  The pragma/User class method does not cover this segment.  So I am back to trying to locate this segment manually and have had no luck so far.&lt;br /&gt;
&lt;br /&gt;
Rich&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Locating Code</title><link>https://community.arm.com/thread/122692?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2005 13:19:32 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8d4e4391-051e-4f17-954f-ecee2b87caca</guid><dc:creator>Rich Soennichsen</dc:creator><description>&lt;p&gt;Reinhard,&lt;br /&gt;
       You are correct on both counts, the classes are the way to go and I had to workout the details:&lt;br /&gt;
&lt;br /&gt;
#pragma .....&lt;br /&gt;
&lt;br /&gt;
plus class definition in LA Locate&lt;br /&gt;
&lt;br /&gt;
Thanks for the good support&lt;br /&gt;
(Even now that I am on the &amp;quot;outside&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Richard&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Locating Code</title><link>https://community.arm.com/thread/111298?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2005 01:42:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:18eba8da-13a9-4ecb-849e-a0092cd34f1c</guid><dc:creator>Keil Software Support Intl.</dc:creator><description>&lt;p&gt;Richard,&lt;br /&gt;
&lt;br /&gt;
The user class stuff is definetly better that using wildcards with segment names.&lt;br /&gt;
&lt;br /&gt;
I think you have just a minor problem and you have entered it on the wrong place.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reinhard&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Locating Code</title><link>https://community.arm.com/thread/111297?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2005 17:29:59 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:34ed20d0-9006-4c81-aeb8-52112b6685a8</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;&lt;i&gt;According to the MAP file this worked. Buuuut when I add this:&lt;br /&gt;
&lt;br /&gt;
CODE_IAP (0x5000-0x6000)&lt;br /&gt;
&lt;br /&gt;
to the user class window I get a syntax error.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
What version of the ARM tools are you using?  I tried this with the V2 stuff and everything works just fine.&lt;br /&gt;
&lt;br /&gt;
You can download the V2 eval software from &lt;a href="http://www.keil.com/demo/"&gt;http://www.keil.com/demo&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Locating Code</title><link>https://community.arm.com/thread/96934?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2005 17:28:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8f03f596-c3e3-401e-aa64-2715ec5fcf28</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;&lt;i&gt;First, do I have to manually locate every function when I want an entire portion of C code located in a certain area?&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
You may use wildcards in the segment specifications.  For example, ?PR?*?MYFILE selects all program segments from the MYFILE source file.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;The above results in a linker error L110 cannot find segment error.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Compile and link without using the SEGMENTS directive.  Scan thru the MAP file for the segment name to use.  You should only specify the physical address.  The C: prefix which is required in the 8051 tools is not allowed in the ARM tools (since memory is von Neumann).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Locating Code</title><link>https://community.arm.com/thread/96944?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2005 16:25:24 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d300e90d-3363-4849-b2c4-2ca0959fecd7</guid><dc:creator>Rich Soennichsen</dc:creator><description>&lt;p&gt;I am loading:&lt;br /&gt;
&lt;br /&gt;
DATA (0x40000000-0x4000FFFF),&lt;br /&gt;
CODE (0x1E000-0x1EF00), CONST (0x1C000-0x1D000))&lt;br /&gt;
&lt;br /&gt;
into the User Class box in the locate tab.  This works as expected.  I have created a user class with this:&lt;br /&gt;
&lt;br /&gt;
#pragma userclass (code = IAP)    // generates CODE_IAP class&lt;br /&gt;
&lt;br /&gt;
According to the MAP file this worked.  Buuuut when I add this:&lt;br /&gt;
&lt;br /&gt;
CODE_IAP (0x5000-0x6000)&lt;br /&gt;
&lt;br /&gt;
to the user class window I get a syntax error.&lt;br /&gt;
&lt;br /&gt;
Rich&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Locating Code</title><link>https://community.arm.com/thread/73043?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2005 15:57:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b90c8076-415c-469a-aedb-5dac119b68a2</guid><dc:creator>Rich Soennichsen</dc:creator><description>&lt;p&gt;I am having no luck getting this to work.  I have added the line:  LA IAP.OBJ SEGMENTS (?PR?Copy_RAM_Flash?(C:0x1E000))  to the User segments box in the LA locate tab.  First, do I have to manually locate every function when I want an entire portion of C code located in a certain area?  The above results in a linker error L110 cannot find segment error.&lt;br /&gt;
&lt;br /&gt;
Rich&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Locating Code</title><link>https://community.arm.com/thread/73042?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2005 15:30:40 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cb765579-d04f-4ff0-a97e-93beddfc69b8</guid><dc:creator>Rich Soennichsen</dc:creator><description>&lt;p&gt;Thanks all for the help.&lt;br /&gt;
&lt;br /&gt;
Rich&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Locating Code</title><link>https://community.arm.com/thread/43553?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2005 14:58:00 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:66314fff-26dd-4aa9-a56b-7a4248d9d546</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;Take a look at the &lt;b&gt;SEGMENTS&lt;/b&gt; linker directive.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.keil.com/support/man/docs/la/la_segments.htm"&gt;http://www.keil.com/support/man/docs/la/la_segments.htm&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Locating Code</title><link>https://community.arm.com/thread/96935?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2005 14:50:54 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:57a13551-7d7b-46a3-b5d4-9f3ee7bf8fca</guid><dc:creator>Jay Daniel</dc:creator><description>&lt;p&gt;You&amp;#39;d do this by sending a CODE() directive to the linker.  For instance, if you had a file named BAR.C with a function FOO() in it, you&amp;#39;d specify:&lt;br /&gt;
&lt;br /&gt;
CODE(?PR?FOO?BAR(0xXXXX))&lt;br /&gt;
&lt;br /&gt;
  where 0xXXXX is the memory address you want the function located at.  There are some variations in the way the compiler might name the segments, but that&amp;#39;s the general jist of it.&lt;br /&gt;
&lt;br /&gt;
  If you want to do this in uVision, you&amp;#39;d go to Project-&amp;gt;Options for Target and choose the BL51 locate tab and type something in the edit box next to the word &amp;quot;code.&amp;quot;  (ie. put ?PR?FOO?BAR(0xXXXX) there.&lt;br /&gt;
&lt;br /&gt;
  For more information about how things are named and what you can do to locate program and data segments at different places, just look in the compiler and linker manuals.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Locating Code</title><link>https://community.arm.com/thread/73044?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2005 14:26:30 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:abe0427a-0354-4731-a046-eaf6f40fb711</guid><dc:creator>Rich Soennichsen</dc:creator><description>&lt;p&gt;Yes, that is true.  the question remains........&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Locating Code</title><link>https://community.arm.com/thread/43547?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2005 14:25:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:570d387d-7bb9-4239-8edb-0a597439a25f</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;That&amp;#39;ll be a job for the Linker/Locator&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>