<?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>i.MX RT Crossover MCUsのトピックRe: How boot an RAM Image programatically</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-boot-an-RAM-Image-programatically/m-p/1512022#M21282</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.&lt;BR /&gt;If the image is linked to the RAM, it must be loaded to the destination address space prior to jumping.&lt;BR /&gt;Regarding your case, it needs to copy the image to RAM actually, further, the image doesn't need to contain the FCDB, IVT, etc, just having application is okay&lt;BR /&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks 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>Fri, 26 Aug 2022 02:20:34 GMT</pubDate>
    <dc:creator>jeremyzhou</dc:creator>
    <dc:date>2022-08-26T02:20:34Z</dc:date>
    <item>
      <title>How boot an RAM Image programatically</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-boot-an-RAM-Image-programatically/m-p/1511831#M21278</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;we want to have two Application Images which both are executed in DTC RAM burned into FlexSPI NOR Flash. I can generate the Images with Secure Provisioning Tool and both can be burned into FlexSPI NOR Flash at Base Address 0x30000000. But how i can burn the second image to Address 0x30140000?&lt;/P&gt;&lt;P&gt;And what do i have to call in the first Application to boot to the second one?&lt;/P&gt;&lt;P&gt;I first generated both images as XIP not run in RAM, there i could jump to second Application with the example from SDK where applicationAddress was 0x30140000:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;//! @brief Exits bootloader and jumps to the user application.
void jump_to_application(uint32_t applicationAddress, uint32_t stackPointer)
{
#if BL_FEATURE_OTFAD_MODULE
    quadspi_cache_clear();
    oftfad_resume_as_needed();
#endif

    typedef void (*application_callback_t)(void);
    static uint32_t s_stackPointer = 0;
    uint32_t applicationPointer;
    static application_callback_t s_appCallback;
    //shutdown_cleanup(kShutdownType_Shutdown);

    // Create the function call to the user application.
    // Static variables are needed since changed the stack pointer out from under the compiler
    // we need to ensure the values we are using are not stored on the previous stack



    shutdown_cleanup(kShutdownType_Shutdown);

    uint32_t *vectorTable = (uint32_t*)applicationAddress;

    s_stackPointer = vectorTable[0];
    applicationPointer = vectorTable[1];


    s_appCallback = (application_callback_t)applicationPointer;
    // Set the VTOR to the application vector table address.
    SCB-&amp;gt;VTOR = (uint32_t)vectorTable;

    // Set stack pointers to the application stack pointer.
    __set_MSP(s_stackPointer);
    __set_PSP(s_stackPointer);

    // Jump to the application.
    s_appCallback();
    // Dummy fcuntion call, should never go to this fcuntion call
    shutdown_cleanup(kShutdownType_Shutdown);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case the StackPointer is 0x20038000 and applicationPointer is 0x301404FD.&lt;/P&gt;&lt;P&gt;Now in the Image Linked to RAM and Image builded with Secure Provisioning Tool the StackPointer is 20040000 and applicationPointer is 0x200024FD.&lt;/P&gt;&lt;P&gt;I tryed to convert sie binary to a hex file and add the address offset, so i could program it to the address 0x30140000.&lt;/P&gt;&lt;P&gt;So the Stack and ApplicationPointer now located in Flash at 0x30141000 because the image generation adds the header with a length of 0x1000. When i try to jump to that application it fails. I loose connection to target even i do not see where the program hangs.&lt;/P&gt;&lt;P&gt;How can i jump now to that application? Do i manualy have to copy the Image to RAM? And how do i have to do this?&lt;/P&gt;&lt;P&gt;We work with MCUXpresso v11.6.0&lt;/P&gt;&lt;P&gt;SDK_2.x_MIMXRT1170-EVK v2.12.0&lt;/P&gt;&lt;P&gt;We have a EVK Board and a Custom board on both the same problem!&lt;/P&gt;&lt;P&gt;One difference i see is that we do not have the FCFB header at 0x30140000, is this a problem? But with XIP this was no Problem.&lt;/P&gt;&lt;P&gt;Thank you very much,&lt;/P&gt;&lt;P&gt;Florian&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 15:06:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-boot-an-RAM-Image-programatically/m-p/1511831#M21278</guid>
      <dc:creator>Flo1989</dc:creator>
      <dc:date>2022-08-25T15:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: How boot an RAM Image programatically</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-boot-an-RAM-Image-programatically/m-p/1512022#M21282</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.&lt;BR /&gt;If the image is linked to the RAM, it must be loaded to the destination address space prior to jumping.&lt;BR /&gt;Regarding your case, it needs to copy the image to RAM actually, further, the image doesn't need to contain the FCDB, IVT, etc, just having application is okay&lt;BR /&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks 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>Fri, 26 Aug 2022 02:20:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/How-boot-an-RAM-Image-programatically/m-p/1512022#M21282</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2022-08-26T02:20:34Z</dc:date>
    </item>
  </channel>
</rss>

