<?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>CodeWarrior Development ToolsのトピックRe: HCS08 linker INIT function disregards assembly relocatable sections</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-linker-INIT-function-disregards-assembly-relocatable/m-p/592585#M4807</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="cCode"&gt;INIT&lt;/CODE&gt; command in the prm file specifies the function as application entry point.&lt;/P&gt;&lt;P&gt;in prm, the code&lt;/P&gt;&lt;P&gt;INIT bootloader_main&lt;/P&gt;&lt;P&gt;means "bootloader_main" is&amp;nbsp; application entry point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CW for HCS08 has some predefined segments.&lt;/P&gt;&lt;P&gt;Predefined segment can be grouped into segments according to the runtime routines: &lt;A name="wp967783"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;segment "_PRESTART" is for application entry point is stored in the segment _PRESTART. This segment must also be associated with a READ_ONLY section.&amp;nbsp; that's to say, bootloader_main must be defined in "_PRESTART".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's take an example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2016-07-25_14-07-30.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37076i9EB3403CD0C0D2E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="2016-07-25_14-07-30.jpg" alt="2016-07-25_14-07-30.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in above prm file, _PRESTART is defined in ROM1(0xC000 to 0xFF9B), thus with code&lt;/P&gt;&lt;P&gt;INIT bootloader_main&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bootloader_main is defined in ROM1 section.&lt;/P&gt;&lt;P&gt;if you want to relocate bootloader_main to other section, we just need change _PRESTART placement in prm file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does this answer your question?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jul 2016 06:12:27 GMT</pubDate>
    <dc:creator>ZhangJennie</dc:creator>
    <dc:date>2016-07-25T06:12:27Z</dc:date>
    <item>
      <title>HCS08 linker INIT function disregards assembly relocatable sections</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-linker-INIT-function-disregards-assembly-relocatable/m-p/592584#M4806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I just ran into a weird problem that caused me some serious bootloader headaches.&amp;nbsp; I recently ported an HCS08 project from CW6.2 to CW10.6 and did quite a bit of cleanup, partly to make use of PE functions.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem I discovered is that if I use the INIT command in the linker configuration file to designate my bootloader_main assembly function as the program entry point, the linker apparently disregards the SECTION specifier in the .asm file.&amp;nbsp; The start of the bootloader looks like this:&lt;/P&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style=""&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;BOOTSTRAP_ROM:&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SECTION&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;XDEF&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;bootloader_main&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;bootloader_main:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;; code here&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The LCF places BOOTSTRAP_ROM into section BROM at 0xFE00.&amp;nbsp; The reset vector points to bootloader_main and all is well - unless I set INIT bootloader_main.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only reason I did this was for the sake of having the debugger start there while I was doing some troubleshooting.&amp;nbsp; As far as I can tell from the documentation, it shouldn't have any effect on placement.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without the INIT command, everything is fine, bootloader_main gets placed at 0xFE00 and calls PE's _EntryPoint when it's done.&amp;nbsp; With INIT set, it gets placed at the start of DEFAULT_ROM, along with its constants that were also declared in BOOTSTRAP_ROM.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use ORG $FE00 to place bootloader_main in an absolute section, the linker honors it.&amp;nbsp; It's only the relocatable section that's ignored.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got it working again by removing the INIT command, but I'd like to know &lt;EM&gt;why&lt;/EM&gt; this happens.&amp;nbsp; Does INIT have some other significance that's not covered in the manual?&amp;nbsp; Why would it ignore the defined sections?&amp;nbsp; Particularly for the constants, which have their own BOOTSTRAP_ROM: SECTION placement and aren't directly named by INIT.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2016 20:59:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-linker-INIT-function-disregards-assembly-relocatable/m-p/592584#M4806</guid>
      <dc:creator>scottm</dc:creator>
      <dc:date>2016-07-20T20:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 linker INIT function disregards assembly relocatable sections</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-linker-INIT-function-disregards-assembly-relocatable/m-p/592585#M4807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="cCode"&gt;INIT&lt;/CODE&gt; command in the prm file specifies the function as application entry point.&lt;/P&gt;&lt;P&gt;in prm, the code&lt;/P&gt;&lt;P&gt;INIT bootloader_main&lt;/P&gt;&lt;P&gt;means "bootloader_main" is&amp;nbsp; application entry point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CW for HCS08 has some predefined segments.&lt;/P&gt;&lt;P&gt;Predefined segment can be grouped into segments according to the runtime routines: &lt;A name="wp967783"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;segment "_PRESTART" is for application entry point is stored in the segment _PRESTART. This segment must also be associated with a READ_ONLY section.&amp;nbsp; that's to say, bootloader_main must be defined in "_PRESTART".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's take an example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2016-07-25_14-07-30.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37076i9EB3403CD0C0D2E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="2016-07-25_14-07-30.jpg" alt="2016-07-25_14-07-30.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in above prm file, _PRESTART is defined in ROM1(0xC000 to 0xFF9B), thus with code&lt;/P&gt;&lt;P&gt;INIT bootloader_main&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;bootloader_main is defined in ROM1 section.&lt;/P&gt;&lt;P&gt;if you want to relocate bootloader_main to other section, we just need change _PRESTART placement in prm file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does this answer your question?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2016 06:12:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-linker-INIT-function-disregards-assembly-relocatable/m-p/592585#M4807</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2016-07-25T06:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 linker INIT function disregards assembly relocatable sections</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-linker-INIT-function-disregards-assembly-relocatable/m-p/592586#M4808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That seems to have fixed it, thanks.&amp;nbsp; Is there any reason other than having the debugger start there that you'd want to use INIT to set the entry point?&amp;nbsp; It doesn't affect the reset vector.&amp;nbsp; I can't see that it has any other effect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The bootloader in question was forked from the example in app note AN2295 more than 10 years ago.&amp;nbsp; I went back and looked at AN2295 (circa 2008) and it has INIT pointing to main().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, if you check DOC-93391, the link given for the latest version of AN2295SW says it covers HCS08, Coldfire, and Kinetis.&amp;nbsp; The ZIP file only appears to contain the Kinetis version, though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jul 2016 18:00:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-linker-INIT-function-disregards-assembly-relocatable/m-p/592586#M4808</guid>
      <dc:creator>scottm</dc:creator>
      <dc:date>2016-07-28T18:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 linker INIT function disregards assembly relocatable sections</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-linker-INIT-function-disregards-assembly-relocatable/m-p/592587#M4809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Scott,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INIT defines the initialization entry point for the application. the specific function defined by INIT is specified as application entry point. and the debugger will also start from this function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in 8bit MCU, the reset vector address is 0XFFFE, this address will store the application initialization entry point address. in an2295sw for hcs08,&amp;nbsp; address 0xFFFE stores start-address of main function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to get an2295 full version, please download it from NXP web site by searching AN2295SW on NXP web site.&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.nxp.com/files/microcontrollers/doc/app_note/AN2295SW.zip" title="http://cache.nxp.com/files/microcontrollers/doc/app_note/AN2295SW.zip"&gt;http://cache.nxp.com/files/microcontrollers/doc/app_note/AN2295SW.zip&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/21904i1FAD062F7EDE94FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does this answer your questions?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2016 07:12:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-linker-INIT-function-disregards-assembly-relocatable/m-p/592587#M4809</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2016-07-29T07:12:25Z</dc:date>
    </item>
  </channel>
</rss>

