<?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>MQX Software Solutions中的主题 Encapsulate the generated image into a header and trailer</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Encapsulate-the-generated-image-into-a-header-and-trailer/m-p/215048#M5424</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to encapsulate the generated image into a header and trailer signature in order for the Boot Loader to recognize a valid image.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore, in the BSP library, in vectors.cw, I added:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;; CFM Flash Configuration Field…..// HeaderHEAD_SIG: .long   0xABCDEF12  // 4 bytes 0x418HEAD_LG1: .long   0x99999999 // 4 bytes 0x41C
HEAD_LG2: .long   0xAAAAAAAA // 4 bytes 0x420HEAD_LG3: .long   0xBBBBBBBB // 4 bytes 0x424HEAD_LG4: .long   0xCCCCCCCC // 4 bytes 0x428HEAD_LG5: .long   0xDDDDAAAA // 4 bytes 0x42C// 256 x 4 = 1024 (0x400) + 24 + 24 = 1064 = 0x430// " __boot" is at offset 0x430&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works fine as I can see my header in the s19 file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is the trailer. In one of the examples, web_hvac_m52259evb.mcp, I added a trailer.asm file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;_DEF_TRAILER_SIG    .set 0x1234ABCF    .global _Trail_Sig    .global _Tspare1    .global _Tspare2    .data   _Trail_Sig: .long _DEF_TRAILER_SIG  ; 2 word trailer signature_Tspare1:   .long 0_Tspare2:   .long 0 .end&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the linker file I added:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;FORCE_ACTIVE {_Trail_Sig, _Tspare1, _Tspare2}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; Now, where in the linker file (extmram_usb.lcf) I shoud add&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;trailer.ams (.data)&lt;/EM&gt;&amp;nbsp; in order to have the trailer signature at the very end of the image (s19 &amp;nbsp;file)? &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;S.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2011 05:05:32 GMT</pubDate>
    <dc:creator>SVC2</dc:creator>
    <dc:date>2011-06-15T05:05:32Z</dc:date>
    <item>
      <title>Encapsulate the generated image into a header and trailer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Encapsulate-the-generated-image-into-a-header-and-trailer/m-p/215048#M5424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to encapsulate the generated image into a header and trailer signature in order for the Boot Loader to recognize a valid image.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore, in the BSP library, in vectors.cw, I added:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;; CFM Flash Configuration Field…..// HeaderHEAD_SIG: .long   0xABCDEF12  // 4 bytes 0x418HEAD_LG1: .long   0x99999999 // 4 bytes 0x41C
HEAD_LG2: .long   0xAAAAAAAA // 4 bytes 0x420HEAD_LG3: .long   0xBBBBBBBB // 4 bytes 0x424HEAD_LG4: .long   0xCCCCCCCC // 4 bytes 0x428HEAD_LG5: .long   0xDDDDAAAA // 4 bytes 0x42C// 256 x 4 = 1024 (0x400) + 24 + 24 = 1064 = 0x430// " __boot" is at offset 0x430&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works fine as I can see my header in the s19 file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is the trailer. In one of the examples, web_hvac_m52259evb.mcp, I added a trailer.asm file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;_DEF_TRAILER_SIG    .set 0x1234ABCF    .global _Trail_Sig    .global _Tspare1    .global _Tspare2    .data   _Trail_Sig: .long _DEF_TRAILER_SIG  ; 2 word trailer signature_Tspare1:   .long 0_Tspare2:   .long 0 .end&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the linker file I added:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;FORCE_ACTIVE {_Trail_Sig, _Tspare1, _Tspare2}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; Now, where in the linker file (extmram_usb.lcf) I shoud add&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;trailer.ams (.data)&lt;/EM&gt;&amp;nbsp; in order to have the trailer signature at the very end of the image (s19 &amp;nbsp;file)? &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;S.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 05:05:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Encapsulate-the-generated-image-into-a-header-and-trailer/m-p/215048#M5424</guid>
      <dc:creator>SVC2</dc:creator>
      <dc:date>2011-06-15T05:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Encapsulate the generated image into a header and trailer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Encapsulate-the-generated-image-into-a-header-and-trailer/m-p/215049#M5425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SVC2,&lt;/P&gt;&lt;P&gt;Need how you are adding the header portion.&amp;nbsp; Thank you for sharing.&lt;/P&gt;&lt;P&gt;The way I have a trailer add in the linker (*.lcf) is in attached file.&lt;/P&gt;&lt;P&gt;Summary of it is here...look for #//DES in comments.&lt;/P&gt;&lt;P&gt;MEMORY&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; vectorrom&amp;nbsp;&amp;nbsp; (RX): ORIGIN = 0x00014000, LENGTH = 0x00000400&lt;BR /&gt;&amp;nbsp;&amp;nbsp; rom&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX): ORIGIN = 0x00014400, LENGTH = 0x0006BBF0&amp;nbsp; # Code + Const data&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; flash_done&amp;nbsp;&amp;nbsp; (R): ORIGIN = 0x0007FFF0, LENGTH = 0x00000010&amp;nbsp;# //DES Flash Program Verification String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ram&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW): ORIGIN = 0x20000000, LENGTH = 0x00010000&amp;nbsp; # SRAM - RW data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; # kernel space starts after RAM variables (Location of MQX Kernel data + MQX heap)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end_of_kd&amp;nbsp;&amp;nbsp; (RW): ORIGIN = 0x2000FFF0, LENGTH = 0x00000000&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; # Boot stack reused by MQX Kernel data&lt;BR /&gt;&amp;nbsp;&amp;nbsp; bstack&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW): ORIGIN = 0x2000FA00, LENGTH = 0x00000200&amp;nbsp; # Boot stack&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end_bstack&amp;nbsp; (RW): ORIGIN = 0x2000FBFF, LENGTH = 0x00000000&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;.flash_written :&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;WRITEW(0x46534c4d);&amp;nbsp;&amp;nbsp;# //DES FSLM&lt;BR /&gt;&amp;nbsp;&amp;nbsp;WRITEW(0x51582055);&amp;nbsp;&amp;nbsp;# //DES QX U&lt;BR /&gt;&amp;nbsp;&amp;nbsp;WRITEW(0x53422073);&amp;nbsp;&amp;nbsp;# //DES SB s&lt;BR /&gt;&amp;nbsp;&amp;nbsp;WRITEW(0x7469636b);&amp;nbsp;&amp;nbsp;# //DES tick&lt;BR /&gt;&amp;nbsp;} &amp;gt; flash_done&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 19:29:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Encapsulate-the-generated-image-into-a-header-and-trailer/m-p/215049#M5425</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2011-06-15T19:29:45Z</dc:date>
    </item>
  </channel>
</rss>

