<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>ColdFire/68K Microcontrollers and ProcessorsのトピックMCF5282 Position-Independent Code</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5282-Position-Independent-Code/m-p/146120#M3205</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;I am trying to achieve the following scheme on the MCF5282.&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Internal Flsah: Sector 0 (16KB): Boot Loader&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Internal Flsah: Sector 1 (16KB): Inventory and Sytem Data&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Internal Flsah: Sector&amp;nbsp; 2 to 16 inclusively: Image A&amp;nbsp; (240 Kbytes)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Internal Flsah: Sector 17 to 32 inclusively: Image B (240 Kbytes)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;When the system boots up, the BootLoader checks a byte in Sector 1 at a specific address and, based on the value read at a specific address (say 1 or 0),&amp;nbsp; decides to jump to Image A or Image B.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Thus, I will burn:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Image A starting address 0x0000 8000&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Image B starting address 0x0004 4000&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;The Data of both Image A and B will be in SRAM at specific address.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;&lt;STRONG style="text-decoration: underline;"&gt;Questions&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Is this scheme possible?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;There is very little explanation in “&lt;EM&gt;CodeWarrior Build Tools Reference ColdFire Architectures Edition&lt;/EM&gt;” manual on the Position-Independent Code. Very vague and unclear. Is there more explanation on this Position-Independent Code and data?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;How do I set up my linker file for Image A and Image B to be address independent? In other words, &lt;STRONG&gt;I don’t want to have a specific linker file for Image A and a specific linker file for Image B but rather a “generic” linker file for both&lt;/STRONG&gt;. Is it possible?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;This “generic” linker file should therefore specify the Data that will be at fix address in SRAM. Nevertheless, the address of a)&lt;/SPAN&gt; &lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Vector table, b)&lt;/SPAN&gt; &lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Constants and c)&lt;/SPAN&gt; &lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;code, sho&lt;/SPAN&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;uld be relative to the stating address of the image in Flash.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Is this feasible?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Simon&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by SVC1 on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-04-11&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;03:58 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Apr 2008 21:57:23 GMT</pubDate>
    <dc:creator>SVC1</dc:creator>
    <dc:date>2008-04-11T21:57:23Z</dc:date>
    <item>
      <title>MCF5282 Position-Independent Code</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5282-Position-Independent-Code/m-p/146120#M3205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;I am trying to achieve the following scheme on the MCF5282.&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Internal Flsah: Sector 0 (16KB): Boot Loader&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Internal Flsah: Sector 1 (16KB): Inventory and Sytem Data&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Internal Flsah: Sector&amp;nbsp; 2 to 16 inclusively: Image A&amp;nbsp; (240 Kbytes)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Internal Flsah: Sector 17 to 32 inclusively: Image B (240 Kbytes)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;When the system boots up, the BootLoader checks a byte in Sector 1 at a specific address and, based on the value read at a specific address (say 1 or 0),&amp;nbsp; decides to jump to Image A or Image B.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Thus, I will burn:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Image A starting address 0x0000 8000&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Image B starting address 0x0004 4000&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;The Data of both Image A and B will be in SRAM at specific address.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;&lt;STRONG style="text-decoration: underline;"&gt;Questions&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Is this scheme possible?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;There is very little explanation in “&lt;EM&gt;CodeWarrior Build Tools Reference ColdFire Architectures Edition&lt;/EM&gt;” manual on the Position-Independent Code. Very vague and unclear. Is there more explanation on this Position-Independent Code and data?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;How do I set up my linker file for Image A and Image B to be address independent? In other words, &lt;STRONG&gt;I don’t want to have a specific linker file for Image A and a specific linker file for Image B but rather a “generic” linker file for both&lt;/STRONG&gt;. Is it possible?&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;This “generic” linker file should therefore specify the Data that will be at fix address in SRAM. Nevertheless, the address of a)&lt;/SPAN&gt; &lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Vector table, b)&lt;/SPAN&gt; &lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;Constants and c)&lt;/SPAN&gt; &lt;SPAN style="color: #000000; font-family: 'Times New Roman'; font-size: 3;"&gt;code, sho&lt;/SPAN&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;uld be relative to the stating address of the image in Flash.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Is this feasible?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3; font-family: 'Times New Roman';"&gt;Simon&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by SVC1 on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-04-11&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;03:58 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 21:57:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5282-Position-Independent-Code/m-p/146120#M3205</guid>
      <dc:creator>SVC1</dc:creator>
      <dc:date>2008-04-11T21:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: MCF5282 Position-Independent Code</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5282-Position-Independent-Code/m-p/146121#M3206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;see this thread:&lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=3814" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=3814&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;You can definitely do it with two linker files and non-PIC code.&lt;BR /&gt;&lt;BR /&gt;When you link PIC code, you don't get a ready-to-execute file. You get a binary plus relocation tables, and the runtime is expected to copy the virgin image to RAM, then walk the relocation tables performing fixups on the code before starting it (in RAM). The only ways this could work with execute from flash would be to write your code so that no relocations are needed, or perform the fixups sometime before writing the flash.&lt;BR /&gt;&lt;BR /&gt;The vector table that is actually used must start on a 1M address boundary, so that limits the vectors to&amp;nbsp; the start of flash or the start of some other memory area (RAM).&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Apr 2008 03:50:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/MCF5282-Position-Independent-Code/m-p/146121#M3206</guid>
      <dc:creator>bkatt</dc:creator>
      <dc:date>2008-04-12T03:50:45Z</dc:date>
    </item>
  </channel>
</rss>

