<?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: The case of the missing BCA (Boot Control Area) in MCU Bootloader</title>
    <link>https://community.nxp.com/t5/MCU-Bootloader/The-case-of-the-missing-BCA-Bootloader-Configuration-Area/m-p/700807#M516</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It occurs to me that the linker&amp;nbsp;might be optimizing out the BCA code since it's not referenced anywhere, but I do have a 'KEEP' directive in the .ld map:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt; .bca :
 {
 . = ALIGN(4);
 KEEP(*(.BootloaderConfig)) /* Bootloader Configuration Area (BCA) */
 . = ALIGN(4);
 } &amp;gt; m_bootloader_config&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Are there other things that would allow the linker to dead strip the .bca section?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 08 Oct 2017 14:23:10 GMT</pubDate>
    <dc:creator>robertpoor</dc:creator>
    <dc:date>2017-10-08T14:23:10Z</dc:date>
    <item>
      <title>The case of the missing BCA (Bootloader Configuration Area:)</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/The-case-of-the-missing-BCA-Bootloader-Configuration-Area/m-p/700806#M515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've prepared a project along the lines discussed in&amp;nbsp;&lt;A _jive_internal="true" data-containerid="11534" data-containertype="14" data-objectid="949978" data-objecttype="2" href="https://community.nxp.com/servlet/JiveServlet/download/11534-431122-816172-390514/How to adapt KDS applications for KBOOT.pdf" rel="nofollow noopener noreferrer" target="_blank"&gt;How To Adapt KDS Applications for KBOOT Bootloader&lt;/A&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually, I've prepared two, and the first one works and the second one doesn't.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Although both projects have identical .ld files, the working project successfully includes the Boot Control Area in the .srec file, the other project for some reason doesn't include the BCA.&amp;nbsp; Here's a snippet of the "good" .srec file: you can see the BCA starting a 0x83c0 ('6B 63 66 67 ...'), followed by the .text section at 0x8400:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt;...
S11380B09986000099860000998600009986000040
S11383C06B636667FFFFFFFFFFFFFFFFFFFFFFFF1A
S11383D001108813FFFFFFFFFFFFFFFFFFFFFE00F9
S11383E00000000000000000000000000000000089
S10783F00000000085
S113840010B5064C2378002B07D1054B002B02D066
...&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;My other project uses the identical .ld file and identical bootloader_support files (containing the BCA fields), yet produces the following .srec file.&amp;nbsp; As you can see, it doesn't include any records at 0x83c0:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt;...
S11380B051D100002D9200002D9200002D9200005D
S113840010B5064C2378002B07D1054B002B02D066
...&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Can you think of any reason the BCA is not getting linked in?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm attaching the .ld file as well as the bootloader_support.[hc] files used in both projects.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-339083" rel="nofollow noopener noreferrer" target="_blank"&gt;bootloader_support.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-339083" rel="nofollow noopener noreferrer" target="_blank"&gt;bootloader_support.h.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-339083" rel="nofollow noopener noreferrer" target="_blank"&gt;MKL27Z64xxx4_flash.ld.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Oct 2017 14:05:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/The-case-of-the-missing-BCA-Bootloader-Configuration-Area/m-p/700806#M515</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2017-10-08T14:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: The case of the missing BCA (Boot Control Area)</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/The-case-of-the-missing-BCA-Bootloader-Configuration-Area/m-p/700807#M516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It occurs to me that the linker&amp;nbsp;might be optimizing out the BCA code since it's not referenced anywhere, but I do have a 'KEEP' directive in the .ld map:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt; .bca :
 {
 . = ALIGN(4);
 KEEP(*(.BootloaderConfig)) /* Bootloader Configuration Area (BCA) */
 . = ALIGN(4);
 } &amp;gt; m_bootloader_config&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Are there other things that would allow the linker to dead strip the .bca section?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Oct 2017 14:23:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/The-case-of-the-missing-BCA-Bootloader-Configuration-Area/m-p/700807#M516</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2017-10-08T14:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: The case of the missing BCA (Boot Control Area)</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/The-case-of-the-missing-BCA-Bootloader-Configuration-Area/m-p/700808#M517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the "answering my own question" department, here's a solution but I don't know why it's required:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I changed:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;__attribute__&lt;/SPAN&gt;&lt;SPAN class=""&gt;((section(&lt;/SPAN&gt;".BootloaderConfig"&lt;SPAN class=""&gt;)))&lt;/SPAN&gt;
&lt;SPAN class=""&gt;const&lt;/SPAN&gt; &lt;SPAN class=""&gt;bootloader_config_t&lt;/SPAN&gt; BootloaderConfig =
{ ... }&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P class=""&gt;to&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;__attribute__&lt;/SPAN&gt;&lt;SPAN class=""&gt;((section(&lt;/SPAN&gt;".BootloaderConfig"&lt;SPAN class=""&gt;)))&lt;/SPAN&gt;
__attribute__&lt;SPAN class=""&gt;((used))&lt;/SPAN&gt;
&lt;SPAN class=""&gt;const&lt;/SPAN&gt; &lt;SPAN class=""&gt;bootloader_config_t&lt;/SPAN&gt; BootloaderConfig =
{ ... }&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P class=""&gt;and now it includes the BCA in the .srec file.&lt;/P&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;This solves my problem, but I would like to know why the KEEP directive in the .ld file was not sufficient.&amp;nbsp; (And why it worked without the &lt;SPAN style="font-family: 'andale mono', monospace;"&gt;__attribute__((used))&lt;/SPAN&gt; in the other project and not this one...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Oct 2017 14:55:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/The-case-of-the-missing-BCA-Bootloader-Configuration-Area/m-p/700808#M517</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2017-10-08T14:55:33Z</dc:date>
    </item>
  </channel>
</rss>

