<?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 Re: How to duplicate code for bootloader? CW10.2 in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-duplicate-code-for-bootloader-CW10-2/m-p/195118#M7175</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;Thanks for the reply. Could you please explain the comment below some more?&lt;/P&gt;&lt;P&gt;My fear is that the Application code functions will have changed locations in flash (but still located in Application code) and then the Bootloader will be jumping to invalid locations. Perhaps I simply don't have a full understanding of the usage of "extern".&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;tom_thompson wrote:&lt;/P&gt;
&lt;P&gt;you should be able to declare the files as extern in your boot loader header file.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:49:54 GMT</pubDate>
    <dc:creator>ignisuti</dc:creator>
    <dc:date>2020-10-29T09:49:54Z</dc:date>
    <item>
      <title>How to duplicate code for bootloader? CW10.2</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-duplicate-code-for-bootloader-CW10-2/m-p/195116#M7173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CW10.2&lt;/P&gt;&lt;P&gt;Windows 7&lt;/P&gt;&lt;P&gt;Kinetis MK10DN512CVLQ10&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm creating a bootloader and have &lt;STRONG&gt;copied&lt;/STRONG&gt; a number of files from my "App" folder to my new "Boot" folder. I then pre-fixed all the copied filenames with "BOOT__".&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The compiler now bombards me with "Multiply-Defined" errors!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example of an instance that generates this error:&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;UART__inititalize&lt;/STRONG&gt; function is in both my "Boot" folder and my normal "App" folder. It has the same name in both folders.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand why this is a problem. The only file in my "Boot" folder which accesses &lt;STRONG&gt;UART__inititalize&lt;/STRONG&gt; has &lt;STRONG&gt;#include &amp;lt;BOOT__UART.h&amp;gt;&lt;/STRONG&gt;, not &lt;STRONG&gt;#include &amp;lt;UART.h&amp;gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I breaking a C coding standard? Or, is the compiler not letting me do something which should be valid?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2012 16:38:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-duplicate-code-for-bootloader-CW10-2/m-p/195116#M7173</guid>
      <dc:creator>ignisuti</dc:creator>
      <dc:date>2012-09-18T16:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate code for bootloader? CW10.2</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-duplicate-code-for-bootloader-CW10-2/m-p/195117#M7174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are getting multiply-defined errors because you have two functions with the same name defined, and the linker is balking. If the functions used by the bootloader project are code-identical to the functions in the app project, you should be able to declare the files as extern in your boot loader header file. If they are different, then you need to rename the functions in your bootloader project to avoid the name collision.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2012 11:22:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-duplicate-code-for-bootloader-CW10-2/m-p/195117#M7174</guid>
      <dc:creator>tom_thompson</dc:creator>
      <dc:date>2012-09-20T11:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate code for bootloader? CW10.2</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-duplicate-code-for-bootloader-CW10-2/m-p/195118#M7175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;Thanks for the reply. Could you please explain the comment below some more?&lt;/P&gt;&lt;P&gt;My fear is that the Application code functions will have changed locations in flash (but still located in Application code) and then the Bootloader will be jumping to invalid locations. Perhaps I simply don't have a full understanding of the usage of "extern".&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;tom_thompson wrote:&lt;/P&gt;
&lt;P&gt;you should be able to declare the files as extern in your boot loader header file.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:49:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-duplicate-code-for-bootloader-CW10-2/m-p/195118#M7175</guid>
      <dc:creator>ignisuti</dc:creator>
      <dc:date>2020-10-29T09:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate code for bootloader? CW10.2</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-duplicate-code-for-bootloader-CW10-2/m-p/195119#M7176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;add extern in the .h file to make the functions globally avaiulable&lt;/P&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt;&amp;nbsp; Globally available functions.&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;extern void InitializeMyStuff(void);&lt;/P&gt;&lt;P&gt;extern void EnableMyStuff( value);&lt;/P&gt;&lt;P&gt;extern void MyStuff(output);&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2012 18:23:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-duplicate-code-for-bootloader-CW10-2/m-p/195119#M7176</guid>
      <dc:creator>loosePointer</dc:creator>
      <dc:date>2012-09-20T18:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate code for bootloader? CW10.2</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-duplicate-code-for-bootloader-CW10-2/m-p/195120#M7177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;James,&lt;/P&gt;&lt;P&gt;I still have the same concerns from my prior post. The address of these functions will be part of the Application code. Since that could change from Release 1.00 to 2.00, this strategy will eventually lead to a non-functional Bootloader. Am I mistaken?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2012 18:28:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-duplicate-code-for-bootloader-CW10-2/m-p/195120#M7177</guid>
      <dc:creator>ignisuti</dc:creator>
      <dc:date>2012-09-20T18:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate code for bootloader? CW10.2</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-duplicate-code-for-bootloader-CW10-2/m-p/195121#M7178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are going to have to nail down the location with the define of a structure and some magic in your linker command file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in one of your c modules....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&amp;nbsp; Note, this structure is not referenced by the main code but rather is &lt;/P&gt;&lt;P&gt;&amp;nbsp; used by the code in the FlashProgrammer and BootLoader project to locate&lt;/P&gt;&lt;P&gt;&amp;nbsp; entities within the main image. Changes here will require changes&lt;/P&gt;&lt;P&gt;&amp;nbsp; to of the other two projects. Changes will, void backwards&lt;/P&gt;&lt;P&gt;&amp;nbsp; compatibility */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;__declspec(rodata) const unsigned long myROData[SIZEOF_CONST_MY_DATA/sizeof(unsigned long)]=&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0, /* version */ //0x1004&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0, /* starting address for execution */ //0x1008&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0, /* addr of text section0 */ //0x100C&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0, /* size of text section0 */ //0x1010&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0, /* addr of text section1 */ //0x1014&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0, /* size of text section1 */ //0x1018&lt;/P&gt;&lt;P&gt; ,,,,,,,&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0, /* addr of application data */ //0x102C&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0, /* size of application data */ //0x1030&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0, /* addr of romp */ //0x1034&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0, /* size of romp */ //0x1038&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0, /* end of text section marker */ //0x103C&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0 /* filler */ //0x1040&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in your linker command file,,,&lt;/P&gt;&lt;P&gt;KEEP_SECTION{.My_ROData} # Force into image so WRTITEWs below will have a target&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;___SOFTWARE_REVISION = 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; #&lt;/P&gt;&lt;P&gt;&amp;nbsp; # The following structure is reference by _main in this application and by the&lt;/P&gt;&lt;P&gt;&amp;nbsp; # update manager (aka BootLoader). Check out both before changing it in any way.&lt;/P&gt;&lt;P&gt;&amp;nbsp; #&lt;/P&gt;&lt;P&gt;&amp;nbsp; .My_ROData : AT (0x1004)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(0x01000000+___SOFTWARE_REVISION);# MyAddr + version data 0x1004&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(__QSIstart); # Starting address for main 0x1008&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(ADDR(.application_text0)); # Start of section 0x100C&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(SIZEOF(.application_text0)+4); # size of secttion 0x1010&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(ADDR(.application_text1)); # Start of section 0x1014&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(SIZEOF(.application_text1)+4); # size of section 0x1018&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(ADDR(.application_text2));&amp;nbsp;&amp;nbsp; # Start of section 0x101C&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(SIZEOF(.application_text2)+4); # size of section 0x1020&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(ADDR(.application_text3));&amp;nbsp;&amp;nbsp; # Start of section 0x1024&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(SIZEOF(.application_text3)+4); # size of section 0x1028&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(application_data_ROM); # Start of section 0x102C&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(SIZEOF(.application_data)); # size of section 0x1030&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(__S_romp);&amp;nbsp;&amp;nbsp; # Start of section 0x1034&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(SIZEOF(.romp)); # size of section 0x1038&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(0); # end of RO sections 0x103C&lt;/P&gt;&lt;P&gt;&amp;nbsp; WRITEW(0); # filler, maintains pairings 0x1040&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; RODATA_SIZE = SIZEOF(.My_ROData);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this gets you on the right track.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2012 19:55:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-duplicate-code-for-bootloader-CW10-2/m-p/195121#M7178</guid>
      <dc:creator>loosePointer</dc:creator>
      <dc:date>2012-09-20T19:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate code for bootloader? CW10.2</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-duplicate-code-for-bootloader-CW10-2/m-p/195122#M7179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is an example, of a how to set up a boot loader,,,, but you can't "cross call" fucntions with it.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.wolinlabs.com/blog/bootloader.html" title="http://www.wolinlabs.com/blog/bootloader.html"&gt;Creating a Bootloader Environment (Freescale ColdFire Example) - from Wolin Labs&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Sep 2012 20:35:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/How-to-duplicate-code-for-bootloader-CW10-2/m-p/195122#M7179</guid>
      <dc:creator>loosePointer</dc:creator>
      <dc:date>2012-09-27T20:35:31Z</dc:date>
    </item>
  </channel>
</rss>

