<?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 Bootload doesn't launch application in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootload-doesn-t-launch-application/m-p/1263778#M60249</link>
    <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I'm working on bootloader over KL27. I put the bootloader at address 0x0, and the application at 0x4000.&lt;/P&gt;&lt;P&gt;After I write the new application into flash memory, I try to restart the application by pointing to application startup address, but it fail and restart the code from 0 (from the bootloader).&lt;/P&gt;&lt;P&gt;The launch code is the following. Is it correct?&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;LI-CODE lang="c"&gt;appStartAddress = APPLICATION_START_ADDRESS;
p_appStartAddress = (uint32_t *) appStartAddress;

// Read the first location of application section
// which contains the address of stack pointer.
// If it is 0xFFFFFFFF then the application section is empty.
if (*p_appStartAddress == 0xFFFFFFFF)
{
    while (1)
    {
                // Wait indefinitely
    }
}

// Start address is valid...
// Pointer to the Application Section
void (*applicationCodeEntry)(void);

// Rebase the Stack Pointer
__set_MSP(*(uint32_t *) APPLICATION_START_ADDRESS);

// Rebase the vector table base address
SCB-&amp;gt;VTOR = ((uint32_t) APPLICATION_START_ADDRESS &amp;amp; SCB_VTOR_TBLOFF_Msk);

// Load the Reset Handler address of the application
applicationCodeEntry = (void (*)(void))(unsigned *)(*(unsigned *)(APPLICATION_START_ADDRESS + 4));

// Jump to user Reset Handler in the application
applicationCodeEntry();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Apr 2021 21:09:16 GMT</pubDate>
    <dc:creator>MarcoGiammarini</dc:creator>
    <dc:date>2021-04-16T21:09:16Z</dc:date>
    <item>
      <title>Bootload doesn't launch application</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootload-doesn-t-launch-application/m-p/1263778#M60249</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I'm working on bootloader over KL27. I put the bootloader at address 0x0, and the application at 0x4000.&lt;/P&gt;&lt;P&gt;After I write the new application into flash memory, I try to restart the application by pointing to application startup address, but it fail and restart the code from 0 (from the bootloader).&lt;/P&gt;&lt;P&gt;The launch code is the following. Is it correct?&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;LI-CODE lang="c"&gt;appStartAddress = APPLICATION_START_ADDRESS;
p_appStartAddress = (uint32_t *) appStartAddress;

// Read the first location of application section
// which contains the address of stack pointer.
// If it is 0xFFFFFFFF then the application section is empty.
if (*p_appStartAddress == 0xFFFFFFFF)
{
    while (1)
    {
                // Wait indefinitely
    }
}

// Start address is valid...
// Pointer to the Application Section
void (*applicationCodeEntry)(void);

// Rebase the Stack Pointer
__set_MSP(*(uint32_t *) APPLICATION_START_ADDRESS);

// Rebase the vector table base address
SCB-&amp;gt;VTOR = ((uint32_t) APPLICATION_START_ADDRESS &amp;amp; SCB_VTOR_TBLOFF_Msk);

// Load the Reset Handler address of the application
applicationCodeEntry = (void (*)(void))(unsigned *)(*(unsigned *)(APPLICATION_START_ADDRESS + 4));

// Jump to user Reset Handler in the application
applicationCodeEntry();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 21:09:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootload-doesn-t-launch-application/m-p/1263778#M60249</guid>
      <dc:creator>MarcoGiammarini</dc:creator>
      <dc:date>2021-04-16T21:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Bootload doesn't launch application</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootload-doesn-t-launch-application/m-p/1263925#M60254</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You can refer this link. &lt;A href="https://community.nxp.com/t5/Kinetis-Microcontrollers/Jump-to-app-failing-custom-bootloader/m-p/959251" target="_self"&gt;bootloader&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 days after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 02:02:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootload-doesn-t-launch-application/m-p/1263925#M60254</guid>
      <dc:creator>nxf56274</dc:creator>
      <dc:date>2021-04-19T02:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Bootload doesn't launch application</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootload-doesn-t-launch-application/m-p/1264246#M60265</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/71004"&gt;@nxf56274&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with the code suggested in the post, the MCU reset immediately with LOCKUP bit high.&lt;/P&gt;&lt;P&gt;What's wrong?&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 09:24:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootload-doesn-t-launch-application/m-p/1264246#M60265</guid>
      <dc:creator>MarcoGiammarini</dc:creator>
      <dc:date>2021-04-19T09:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Bootload doesn't launch application</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootload-doesn-t-launch-application/m-p/1264681#M60279</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please use the led demo as application. And show me how you go to application.&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 days after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 01:52:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Bootload-doesn-t-launch-application/m-p/1264681#M60279</guid>
      <dc:creator>nxf56274</dc:creator>
      <dc:date>2021-04-20T01:52:41Z</dc:date>
    </item>
  </channel>
</rss>

