<?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>MCU BootloaderのトピックRe: stuck in (altered) bootloader FRDM K64</title>
    <link>https://community.nxp.com/t5/MCU-Bootloader/stuck-in-altered-bootloader-FRDM-K64/m-p/630565#M230</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed that the memory sections m_data and m_data_20020000 overlap in the bootloader, m_data goes from 0x1FFF0000 to 0x20030000. Please make sure the memory sections on you projects does not overlap, you could use the following document as guidance:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-104433"&gt;https://community.nxp.com/docs/DOC-104433&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Carlos Mendoza&lt;BR /&gt;Technical Support Engineer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Mar 2017 23:50:29 GMT</pubDate>
    <dc:creator>Carlos_Mendoza</dc:creator>
    <dc:date>2017-03-13T23:50:29Z</dc:date>
    <item>
      <title>stuck in (altered) bootloader FRDM K64</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/stuck-in-altered-bootloader-FRDM-K64/m-p/630564#M229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In continuous to &lt;A _jive_internal="true" href="https://community.nxp.com/message/884521"&gt;this &lt;/A&gt;post, I've currently working with the Release version of the freedom_bootloader (with led's used for debug), and I cannot exit the bootloader mode.&lt;/P&gt;&lt;P&gt;I've altered the freedom_bootloader file so I chose a place in the flash (address 0x20020000) in which both my application and the boot loader will point to it, as follows:&lt;/P&gt;&lt;P&gt;In &lt;SPAN style="color: #0000ff;"&gt;bl_main.c&lt;/SPAN&gt; (and in my application) I've added this line:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt;unsigned char __attribute__((section (".appFlag"))) appFlag = 0x55;&amp;nbsp;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In freedom_bootloader linker file:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt;/* Specify the memory areas */&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt;MEMORY&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt;{&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt; m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt; m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt; m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x000FFBF0&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt; m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00040000&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt; m_data_20020000 (RW) : ORIGIN = 0x20020000, LENGTH = 0x00000400&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt;}&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt;/* Define output sections */&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt;SECTIONS&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt;{&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt; /* placing appFlag section at given address: */&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt; .appFlag 0x20020000 :&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt; {&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt; KEEP(*(.appFlag)) /* keep my variable even if not referenced */&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM style="font-size: 15px;"&gt; } &amp;gt; m_data_20020000&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my app linker file I placed it under m_data_2:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt;MEMORY&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt; m_interrupts (RX) : ORIGIN = 0x0000A000, LENGTH = 0x00000400&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt; m_text (RX) : ORIGIN = 0x0000A400, LENGTH = 0x00075C00&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt; m_data (RW) : ORIGIN = 0x1FFF0000, LENGTH = 0x00010000&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt; m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00030000&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt;/* Define output sections */&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt;SECTIONS&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt; /* placing appFlag section at given address: */&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG style="color: #0000ff;"&gt;&lt;EM&gt; .appFlag 0x20020000 :&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt; {&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt; KEEP(*(.appFlag)) /* keep my variable even if not referenced */&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt; } &amp;gt; m_data_2&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I also modified the linker file as explained nicely by @&lt;A _jive_internal="true" href="https://community.nxp.com/people/Jorge_Gonzalez"&gt;Jorge&lt;/A&gt; &lt;A href="https://community.nxp.com/docs/DOC-256669"&gt;Adapting KDS project for KBOOT flash resident bootloader&lt;/A&gt;‌&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I want the option to get back to the bootloader from my app. This is my goal...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;In the boot loader I've added these lines (see line 367, 405). The appFlag will be altered so only if it is equal to 0x55 it will jump to app. If it equals to 0x22, it will do nothing (line 405).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_13.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/15631i43989E53A2124EB3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_13.png" alt="pastedImage_13.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is it get stuck in boot loader mode. For the time being I'm working with the &lt;SPAN style="text-decoration: underline;"&gt;freedom_led_demo_A000&lt;/SPAN&gt; project.&lt;/P&gt;&lt;P&gt;If I comment line 367 and un-comment line 368 (set the 'If' to 'true'), it works fine and jump to application as expected, led starts to blink. &lt;SPAN style="text-decoration: underline;"&gt;This I totally do not understand&lt;/SPAN&gt;. The &lt;STRONG&gt;appFlag&lt;/STRONG&gt; does equal to 0x55 (as it gets initialized in _attribute_ , see start of my message).&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;Thanks, if you managed to read this far... :smileyhappy:&lt;/P&gt;&lt;P&gt;Roy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Mar 2017 21:51:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/stuck-in-altered-bootloader-FRDM-K64/m-p/630564#M229</guid>
      <dc:creator>roymessinger</dc:creator>
      <dc:date>2017-03-07T21:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: stuck in (altered) bootloader FRDM K64</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/stuck-in-altered-bootloader-FRDM-K64/m-p/630565#M230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed that the memory sections m_data and m_data_20020000 overlap in the bootloader, m_data goes from 0x1FFF0000 to 0x20030000. Please make sure the memory sections on you projects does not overlap, you could use the following document as guidance:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-104433"&gt;https://community.nxp.com/docs/DOC-104433&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Carlos Mendoza&lt;BR /&gt;Technical Support Engineer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2017 23:50:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/stuck-in-altered-bootloader-FRDM-K64/m-p/630565#M230</guid>
      <dc:creator>Carlos_Mendoza</dc:creator>
      <dc:date>2017-03-13T23:50:29Z</dc:date>
    </item>
  </channel>
</rss>

