<?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>topic Split up single application into loader and application which may be replaced at run time in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Split-up-single-application-into-loader-and-application-which/m-p/256589#M9813</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Setup: MC9S08JE128 + CW 10.2 + Cyclone Pro&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are currently developing an application whichs consists of loader and a application which can be replaced at runtime. We have found an interesting &lt;A _jive_internal="true" data-containerid="2028" data-containertype="14" data-objectid="46526" data-objecttype="1" href="https://community.nxp.com/thread/46526#47183"&gt;discussion&lt;/A&gt; in which it is suggested 'to split up those two separate pieces into separate elf files/build targets/applications to make 100% sure changing the application has no effect whatsoever on the loader'. In this way, each application uses its own copy of functions in ansi library (as well as propietary libraries). Additional discussions are referenced, however, we're afraid their links no longer work &lt;SPAN aria-label="Confused" class="emoticon-inline emoticon_confused" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt; . There some aspects which are not discussed and we would be really grateful if someone could please give us a hand on this issue.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We think we have carefully designed the interface between loader and application in the following way:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;loader uses certain functions in the app code through the application services table, which is located in a fixed ROM address (loader *.prm file guarantees this).&lt;/LI&gt;&lt;LI&gt;application uses certain functions in the loader code through the loader services table, which is located in a fixed ROM address (loader *.prm file guarantees this).&lt;/LI&gt;&lt;LI&gt;there is one single vector interrupt table: application ISRs have been redirected to a table in a fixed ROM address (loader *.prm file guarantees this) and loader ISRs are not accesible to application.&lt;/LI&gt;&lt;LI&gt;download and execution of application is managed by loader.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="11493" data-containertype="14" data-objectid="102244" data-objecttype="1" href="https://community.nxp.com/thread/102244#102244"&gt;&lt;BR /&gt;&lt;/A&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;What we consider one of the main drawbacks here is that there is one single entry point: loader's void main (void) function. We think, moreover, this is a key difference respect having a bootloader and an application (two entry points in this case) and that is why I am using the word 'loader' instead of 'bootloader'. In this other &lt;A _jive_internal="true" data-containerid="2031" data-containertype="14" data-objectid="74350" data-objecttype="1" href="https://community.nxp.com/thread/74350"&gt;discussion&lt;/A&gt;, which deals with a similar issue, it is mentioned the following: 'Just include bootloader hex or s19 file in application code using "HEXFILE bootloader.s19" command in prm file. One click and application is build and being downloaded to MCU with bootloader included.' Nevertheless, this discussion refers to the 'bootloader + app' setup case and there are some differences to take into consideration. This similar &lt;A _jive_internal="true" data-containerid="2016" data-containertype="14" data-objectid="29324" data-objecttype="1" href="https://community.nxp.com/thread/29324#29324"&gt;discussion&lt;/A&gt; is quite helpful too. There are some, let's say advantages, too: there is a single vector interrupt table and just one _Startup function (and therefore a single struct _tagStartup _startupData) and we don't have to worry about some of the points discussed. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Although we have no trouble compiling loader, compiling the application seems kind of tricky to us, as it is not an application in the strict sense of the term (it lacks of main entry point). According to what it is suggested either above as in many other discussions (&lt;A _jive_internal="true" data-containerid="11493" data-containertype="14" data-objectid="102244" data-objecttype="1" href="https://community.nxp.com/thread/102244#102244"&gt;Merge Bootloader + Application&lt;/A&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;, &lt;A _jive_internal="true" data-containerid="2016" data-containertype="14" data-objectid="105224" data-objecttype="1" href="https://community.nxp.com/thread/105224#105224"&gt;bootloader and application in seperate projects&lt;/A&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;,&amp;nbsp; among others) we have tried to include loader.s28 file in the application by using HEXFILE command. However, it seems mandatory to implement a main dummy function. Is there any way to avoid this (i.g. by using some special 'Build Configuration') ?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to compile and link loader.s28 file, we add a dummy application services table, which we know will be replaced with the real one when compiling and linking application. However, we cannot think in a way to inform application compile and link processes where the loader services table is located. In fact, compiler prints out the following message: 'WARNING L1823: External object application_services_table in C:/whatever_path/application_c.obj created by default'. Does this mean we have to add the file containing loader services table to the application compilation? Is there a way to avoid this? Are we simply working in the wrong direction? (I bet the answer to this last question is YES &lt;SPAN aria-label="Silly" class="emoticon_silly emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt;).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's suppose there is way to merge loader and application into a single *.s28 file. Is it possible to download and debug the resulting application? We are interested in debugging the application, not the loader, as we are sure the loader works fine. The following &lt;A _jive_internal="true" data-containerid="2023" data-containertype="14" data-objectid="303306" data-objecttype="1" href="https://community.nxp.com/thread/303306#312015"&gt;discussion&lt;/A&gt; talks about a similar issue. Since we are trying to download a single *.s28 file, we guess we do not have to worry about preserving any loader previously downloaded to MC9S08JE128. Are we right? Moreover, we have taken a look at the Advanced Options of the connection used in a certain Debug Configuration and it seems as if it can be preserved just three memory ranges.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help concerning this issue would be very much appreciated. Thanks a lot in advance.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Jul 2013 10:28:36 GMT</pubDate>
    <dc:creator>embeddeddavid</dc:creator>
    <dc:date>2013-07-05T10:28:36Z</dc:date>
    <item>
      <title>Split up single application into loader and application which may be replaced at run time</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Split-up-single-application-into-loader-and-application-which/m-p/256589#M9813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Setup: MC9S08JE128 + CW 10.2 + Cyclone Pro&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are currently developing an application whichs consists of loader and a application which can be replaced at runtime. We have found an interesting &lt;A _jive_internal="true" data-containerid="2028" data-containertype="14" data-objectid="46526" data-objecttype="1" href="https://community.nxp.com/thread/46526#47183"&gt;discussion&lt;/A&gt; in which it is suggested 'to split up those two separate pieces into separate elf files/build targets/applications to make 100% sure changing the application has no effect whatsoever on the loader'. In this way, each application uses its own copy of functions in ansi library (as well as propietary libraries). Additional discussions are referenced, however, we're afraid their links no longer work &lt;SPAN aria-label="Confused" class="emoticon-inline emoticon_confused" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt; . There some aspects which are not discussed and we would be really grateful if someone could please give us a hand on this issue.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We think we have carefully designed the interface between loader and application in the following way:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;loader uses certain functions in the app code through the application services table, which is located in a fixed ROM address (loader *.prm file guarantees this).&lt;/LI&gt;&lt;LI&gt;application uses certain functions in the loader code through the loader services table, which is located in a fixed ROM address (loader *.prm file guarantees this).&lt;/LI&gt;&lt;LI&gt;there is one single vector interrupt table: application ISRs have been redirected to a table in a fixed ROM address (loader *.prm file guarantees this) and loader ISRs are not accesible to application.&lt;/LI&gt;&lt;LI&gt;download and execution of application is managed by loader.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="11493" data-containertype="14" data-objectid="102244" data-objecttype="1" href="https://community.nxp.com/thread/102244#102244"&gt;&lt;BR /&gt;&lt;/A&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;What we consider one of the main drawbacks here is that there is one single entry point: loader's void main (void) function. We think, moreover, this is a key difference respect having a bootloader and an application (two entry points in this case) and that is why I am using the word 'loader' instead of 'bootloader'. In this other &lt;A _jive_internal="true" data-containerid="2031" data-containertype="14" data-objectid="74350" data-objecttype="1" href="https://community.nxp.com/thread/74350"&gt;discussion&lt;/A&gt;, which deals with a similar issue, it is mentioned the following: 'Just include bootloader hex or s19 file in application code using "HEXFILE bootloader.s19" command in prm file. One click and application is build and being downloaded to MCU with bootloader included.' Nevertheless, this discussion refers to the 'bootloader + app' setup case and there are some differences to take into consideration. This similar &lt;A _jive_internal="true" data-containerid="2016" data-containertype="14" data-objectid="29324" data-objecttype="1" href="https://community.nxp.com/thread/29324#29324"&gt;discussion&lt;/A&gt; is quite helpful too. There are some, let's say advantages, too: there is a single vector interrupt table and just one _Startup function (and therefore a single struct _tagStartup _startupData) and we don't have to worry about some of the points discussed. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Although we have no trouble compiling loader, compiling the application seems kind of tricky to us, as it is not an application in the strict sense of the term (it lacks of main entry point). According to what it is suggested either above as in many other discussions (&lt;A _jive_internal="true" data-containerid="11493" data-containertype="14" data-objectid="102244" data-objecttype="1" href="https://community.nxp.com/thread/102244#102244"&gt;Merge Bootloader + Application&lt;/A&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;, &lt;A _jive_internal="true" data-containerid="2016" data-containertype="14" data-objectid="105224" data-objecttype="1" href="https://community.nxp.com/thread/105224#105224"&gt;bootloader and application in seperate projects&lt;/A&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;,&amp;nbsp; among others) we have tried to include loader.s28 file in the application by using HEXFILE command. However, it seems mandatory to implement a main dummy function. Is there any way to avoid this (i.g. by using some special 'Build Configuration') ?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to compile and link loader.s28 file, we add a dummy application services table, which we know will be replaced with the real one when compiling and linking application. However, we cannot think in a way to inform application compile and link processes where the loader services table is located. In fact, compiler prints out the following message: 'WARNING L1823: External object application_services_table in C:/whatever_path/application_c.obj created by default'. Does this mean we have to add the file containing loader services table to the application compilation? Is there a way to avoid this? Are we simply working in the wrong direction? (I bet the answer to this last question is YES &lt;SPAN aria-label="Silly" class="emoticon_silly emoticon-inline" style="height:16px;width:16px;"&gt;&lt;/SPAN&gt;).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's suppose there is way to merge loader and application into a single *.s28 file. Is it possible to download and debug the resulting application? We are interested in debugging the application, not the loader, as we are sure the loader works fine. The following &lt;A _jive_internal="true" data-containerid="2023" data-containertype="14" data-objectid="303306" data-objecttype="1" href="https://community.nxp.com/thread/303306#312015"&gt;discussion&lt;/A&gt; talks about a similar issue. Since we are trying to download a single *.s28 file, we guess we do not have to worry about preserving any loader previously downloaded to MC9S08JE128. Are we right? Moreover, we have taken a look at the Advanced Options of the connection used in a certain Debug Configuration and it seems as if it can be preserved just three memory ranges.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help concerning this issue would be very much appreciated. Thanks a lot in advance.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2013 10:28:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Split-up-single-application-into-loader-and-application-which/m-p/256589#M9813</guid>
      <dc:creator>embeddeddavid</dc:creator>
      <dc:date>2013-07-05T10:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Split up single application into loader and application which may be replaced at run time</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Split-up-single-application-into-loader-and-application-which/m-p/256590#M9814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;We were working in the wrong direction. We are currently using flash programmer to download the loader and the application segments. We are able to debug the application using the debugger.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Jul 2013 19:15:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Split-up-single-application-into-loader-and-application-which/m-p/256590#M9814</guid>
      <dc:creator>embeddeddavid</dc:creator>
      <dc:date>2013-07-19T19:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Split up single application into loader and application which may be replaced at run time</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Split-up-single-application-into-loader-and-application-which/m-p/256591#M9815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello embeddeddavid!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assumed this means your project is running now, and that is great! (Please feel free to correct me if I'm wrong)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Monica.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jul 2013 00:46:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Split-up-single-application-into-loader-and-application-which/m-p/256591#M9815</guid>
      <dc:creator>Monica</dc:creator>
      <dc:date>2013-07-26T00:46:17Z</dc:date>
    </item>
  </channel>
</rss>

