<?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>Kinetis Microcontrollers中的主题 Jump to Application</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jump-to-Application/m-p/1900226#M66520</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using MIMXRT1170-EVKB for our development activities. I am new to this controller.&lt;/P&gt;&lt;P&gt;I used the fsl_romapi example sdk as customized bootloader and integrated the uart example with that to receive the image (led blinky example) through uart and write it in the flash.&lt;/P&gt;&lt;P&gt;Currently I am able to write to write the binary format of image received via uart into the flash starting from 0x32000000 address.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I want to jump to this application. Currently I am using this piece of code from flashloader example to jump &lt;FONT face="arial,helvetica,sans-serif"&gt;to&lt;/FONT&gt; this application address.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here while calling this function, what I should pass in the arguements section. If you can let me know then it will be helpful. If you have some piece of code for jumping to application then you can give me some link.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;static void jump_to_application(uint32_t applicationAddress, uint32_t stackPointer)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;#if BL_FEATURE_OTFAD_MODULE&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;quadspi_cache_clear();&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;oftfad_resume_as_needed();&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;#endif&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;// Create the function call to the user application.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;// Static variables are needed since changed the stack pointer out from under the compiler&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;// we need to ensure the values we are using are not stored on the previous stack&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;static uint32_t s_stackPointer = 0;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;s_stackPointer = stackPointer;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;static void (*farewellBootloader)(void) = 0;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;farewellBootloader = (void (*)(void))applicationAddress;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;// Set the VTOR to the application vector table address.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;SCB-&amp;gt;VTOR = (uint32_t)APP_VECTOR_TABLE;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;// Set stack pointers to the application stack pointer.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;__set_MSP(s_stackPointer);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;__set_PSP(s_stackPointer);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;// Jump to the application.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;farewellBootloader();&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jul 2024 12:47:48 GMT</pubDate>
    <dc:creator>Abhisek20</dc:creator>
    <dc:date>2024-07-05T12:47:48Z</dc:date>
    <item>
      <title>Jump to Application</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jump-to-Application/m-p/1900226#M66520</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using MIMXRT1170-EVKB for our development activities. I am new to this controller.&lt;/P&gt;&lt;P&gt;I used the fsl_romapi example sdk as customized bootloader and integrated the uart example with that to receive the image (led blinky example) through uart and write it in the flash.&lt;/P&gt;&lt;P&gt;Currently I am able to write to write the binary format of image received via uart into the flash starting from 0x32000000 address.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I want to jump to this application. Currently I am using this piece of code from flashloader example to jump &lt;FONT face="arial,helvetica,sans-serif"&gt;to&lt;/FONT&gt; this application address.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here while calling this function, what I should pass in the arguements section. If you can let me know then it will be helpful. If you have some piece of code for jumping to application then you can give me some link.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;static void jump_to_application(uint32_t applicationAddress, uint32_t stackPointer)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;#if BL_FEATURE_OTFAD_MODULE&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;quadspi_cache_clear();&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;oftfad_resume_as_needed();&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;#endif&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;// Create the function call to the user application.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;// Static variables are needed since changed the stack pointer out from under the compiler&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;// we need to ensure the values we are using are not stored on the previous stack&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;static uint32_t s_stackPointer = 0;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;s_stackPointer = stackPointer;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;static void (*farewellBootloader)(void) = 0;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;farewellBootloader = (void (*)(void))applicationAddress;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;// Set the VTOR to the application vector table address.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;SCB-&amp;gt;VTOR = (uint32_t)APP_VECTOR_TABLE;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;// Set stack pointers to the application stack pointer.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;__set_MSP(s_stackPointer);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;__set_PSP(s_stackPointer);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;// Jump to the application.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;farewellBootloader();&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 12:47:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jump-to-Application/m-p/1900226#M66520</guid>
      <dc:creator>Abhisek20</dc:creator>
      <dc:date>2024-07-05T12:47:48Z</dc:date>
    </item>
    <item>
      <title>回复： Jump to Application</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jump-to-Application/m-p/1908484#M66562</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/234842"&gt;@Abhisek20&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for your interest in NXP MIMXRT series!&lt;/P&gt;
&lt;P&gt;The two arguments to the incoming function are the entry and SP pointers from your application project. You can find them from the map file you compiled earlier. Please refer to this link:&amp;nbsp;&lt;A href="https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/bootloader%E8%B7%B3%E8%BD%AC%E5%88%B0sdram%E7%9A%84%E9%97%AE%E9%A2%98/td-p/1564021" target="_blank"&gt;https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/bootloader%E8%B7%B3%E8%BD%AC%E5%88%B0sdram%E7%9A%84%E9%97%AE%E9%A2%98/td-p/1564021&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Gavin&lt;/P&gt;
&lt;DIV id="eJOY__extension_root" class="eJOY__extension_root_class" style="all: unset;"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 15 Jul 2024 08:09:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jump-to-Application/m-p/1908484#M66562</guid>
      <dc:creator>Gavin_Jia</dc:creator>
      <dc:date>2024-07-15T08:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Jump to Application</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jump-to-Application/m-p/1911113#M66584</link>
      <description>&lt;P&gt;Hello !&lt;BR /&gt;&lt;BR /&gt;The two arguments are the entry point of your new program and the stack pointer.&lt;BR /&gt;You can find them in the Vector Table of the program you just flashed.&lt;BR /&gt;&lt;BR /&gt;So basically, in my application I'm doing :&lt;BR /&gt;&lt;BR /&gt;new_StackPointer = read_Uint32 (New_Address);&lt;BR /&gt;new_ApplicationAddress = read_Uint32 (New_Address+4);&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;jump_to_application(new_StackPointer,new_ApplicationAddress);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="courier new,courier"&gt;Why ? :&lt;BR /&gt;Here is what I'm reading&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Devyy_0-1721288792156.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/289096iAB56883F0F2C6A0C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Devyy_0-1721288792156.png" alt="Devyy_0-1721288792156.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;When you flash your application at the address&amp;nbsp;&lt;SPAN&gt;0x32000000, the first thing in the memory is the Vector Table.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can replace&amp;nbsp;New_Address with&amp;nbsp;0x32000000 for your code.&lt;BR /&gt;&lt;BR /&gt;I hope it will help you,&lt;BR /&gt;&lt;BR /&gt;Devyy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2024 07:48:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Jump-to-Application/m-p/1911113#M66584</guid>
      <dc:creator>Devyy</dc:creator>
      <dc:date>2024-07-18T07:48:46Z</dc:date>
    </item>
  </channel>
</rss>

