<?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: S32K312 Bootloader jump to application address in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K312-Bootloader-jump-to-application-address/m-p/1783170#M30242</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/225130"&gt;@Vishnu3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To jump from the bootloader to the application I suggest referring to&amp;nbsp;the &lt;A href="https://community.nxp.com/t5/S32K-Knowledge-Base/Unified-bootloader-Demo/ta-p/1423099" target="_blank" rel="noopener"&gt;Unified Bootloader Demo&lt;/A&gt;.&amp;nbsp;There is Boot_JumpToApp(const uint32 i_AppAddr) in boot_Cfg.c (S32K344_CAN_Bootloader_RTD100\src\S32K344_CAN\boot\src\)&lt;/P&gt;
&lt;P&gt;Also, you can try the following code:&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;func = *(UINT32 volatile *)(ADDR_APP + 0xC);
func = *(UINT32 volatile *)(((UINT32)func) + 0x4);  //add this line of code.
func = (((UINT32)func) &amp;amp; 0xFFFFFFFEU);
(* (void (*) (void)) func)();&lt;/LI-CODE&gt;
&lt;P&gt;Additionally, check the following post. This is a discussion related to the topic.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S32K/How-to-jump-to-application-from-bootloader-after-update-image-in/td-p/1651716" target="_blank" rel="noopener"&gt;How to jump to the application from the bootloader after updating an image in S32K312.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;B.R.&lt;/P&gt;
&lt;P&gt;VaneB&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jan 2024 18:30:49 GMT</pubDate>
    <dc:creator>VaneB</dc:creator>
    <dc:date>2024-01-04T18:30:49Z</dc:date>
    <item>
      <title>S32K312 Bootloader jump to application address</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-Bootloader-jump-to-application-address/m-p/1783107#M30237</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have been trying to develop a UART bootloader for the S32K312 evaluation board. My project has the following components:&lt;/P&gt;&lt;P&gt;1. Bootloader project with UART (Using RTD 3.0.0)&lt;/P&gt;&lt;P&gt;2. Application project (just a LED blinky) (Using RTD 3.0.0)&lt;/P&gt;&lt;P&gt;3. UART python utility to send the SREC file.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Generate an SREC file from application project. I have configured the linker file in this project with the pflash origin=0x00500000 with a length of 32 Kb. I make no other changes in the linker file or startup code. I get an SREC file which has 24bit address.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 2:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I configure the bootloader project with the linker file as follows pflash origin = 0x00400000 with a length of 64Kb. In the bootloader I have setup the UART to receive the SREC file and write it to flash (using c40 ) at the corresponding memory address with 16 byte alignment. Once the SREC file is completely received, the bootloader jumps to the address 0x0050000 (start address of the app).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Outcome:&lt;/STRONG&gt;&lt;BR /&gt;1. My utility is able to send the SREC file line by line and the bootloader is writing it to the flash successfully. I checked the memory address and the data matches with that of the SREC file.&lt;/P&gt;&lt;P&gt;2. The bootloader jumps to the application address, but stops executing when the program reaches 0x00500800. Gives the error that is attached in the picture below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-right" image-alt="MicrosoftTeams-image.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/256723iA9D02BCC736C923A/image-size/large?v=v2&amp;amp;px=999" role="button" title="MicrosoftTeams-image.png" alt="MicrosoftTeams-image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 15:54:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-Bootloader-jump-to-application-address/m-p/1783107#M30237</guid>
      <dc:creator>Vishnu3</dc:creator>
      <dc:date>2024-01-04T15:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 Bootloader jump to application address</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-Bootloader-jump-to-application-address/m-p/1783170#M30242</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/225130"&gt;@Vishnu3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To jump from the bootloader to the application I suggest referring to&amp;nbsp;the &lt;A href="https://community.nxp.com/t5/S32K-Knowledge-Base/Unified-bootloader-Demo/ta-p/1423099" target="_blank" rel="noopener"&gt;Unified Bootloader Demo&lt;/A&gt;.&amp;nbsp;There is Boot_JumpToApp(const uint32 i_AppAddr) in boot_Cfg.c (S32K344_CAN_Bootloader_RTD100\src\S32K344_CAN\boot\src\)&lt;/P&gt;
&lt;P&gt;Also, you can try the following code:&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;func = *(UINT32 volatile *)(ADDR_APP + 0xC);
func = *(UINT32 volatile *)(((UINT32)func) + 0x4);  //add this line of code.
func = (((UINT32)func) &amp;amp; 0xFFFFFFFEU);
(* (void (*) (void)) func)();&lt;/LI-CODE&gt;
&lt;P&gt;Additionally, check the following post. This is a discussion related to the topic.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S32K/How-to-jump-to-application-from-bootloader-after-update-image-in/td-p/1651716" target="_blank" rel="noopener"&gt;How to jump to the application from the bootloader after updating an image in S32K312.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;B.R.&lt;/P&gt;
&lt;P&gt;VaneB&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 18:30:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-Bootloader-jump-to-application-address/m-p/1783170#M30242</guid>
      <dc:creator>VaneB</dc:creator>
      <dc:date>2024-01-04T18:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 Bootloader jump to application address</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-Bootloader-jump-to-application-address/m-p/1783171#M30243</link>
      <description>&lt;P&gt;Hi Vane,&lt;/P&gt;&lt;P&gt;Thank you for the response. My code is able to jump to the specified address (0x00500000) however it is not able to execute the instruction at 0x00500800, as I have pointed out in the attached picture in my original post. Also, I have already gone through the discussion that you have pointed me to.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Vishnu&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 18:36:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-Bootloader-jump-to-application-address/m-p/1783171#M30243</guid>
      <dc:creator>Vishnu3</dc:creator>
      <dc:date>2024-01-04T18:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 Bootloader jump to application address</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-Bootloader-jump-to-application-address/m-p/1784672#M30394</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/225130"&gt;@Vishnu3&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please correct me if I understood wrong. The below&amp;nbsp;situation occurs just after jumping from the bootloader to the app. Is that correct? In the following post, a similar situation has been discussed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S32K/bootloader-jump-to-app/td-p/1755476" target="_blank" rel="noopener"&gt;bootloader jump to app&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Also, if you debug the code, can you detect if a specific instruction causes the fault?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 21:59:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-Bootloader-jump-to-application-address/m-p/1784672#M30394</guid>
      <dc:creator>VaneB</dc:creator>
      <dc:date>2024-01-08T21:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: S32K312 Bootloader jump to application address</title>
      <link>https://community.nxp.com/t5/S32K/S32K312-Bootloader-jump-to-application-address/m-p/1802062#M31455</link>
      <description>&lt;P&gt;Hi Vane,&lt;/P&gt;&lt;P&gt;Sorry for the long pause. I was able to use the code that you had provided (thanks a ton for that) and my bootloader is jumping to the application address (0x00500000). In the application I am blinking an LED in a while loop and it is executing properly. However, now there is a new issue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I added UART callback in my application code, along with the blinking LED, it works fine when I am testing it by flashing it into my board using Design Studio. However when I flash it through my bootloader and jump to the application, the LED blinks, however, the UART callback is not triggered. I suspect that the IVT is not being initialized properly and thus the UART callback is not working.&lt;BR /&gt;&lt;BR /&gt;Following is my jump to application code: [Using RTD 2.0.0]&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;void Jump(uint32 address_location){&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;  uint32 ADDR_APP = address_location;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;  Intrrupt_DeInit();&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;  __asm("cpsid i");&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;  S32_SCB-&amp;gt;VTOR =ADDR_APP;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;  __asm("ldr&amp;nbsp; r0, =0x00500000");&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;  __asm("msr msp, r0");&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;  func = *(uint32 volatile *)(ADDR_APP + 0xC);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;  func = *(uint32 volatile *)(((uint32)func) + 0x4);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;  func = (((uint32)func) &amp;amp; 0xFFFFFFFEU | 1U);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;  (* (void (*) (void)) func)();&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My application linker file is set to start at 0x00500000. This is the only change I have made in the application project (the one with LED and UART). I have not made any changes to the startup code.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any pointers will be really appreciated. Been at it for almost a week now. This is the only blocking point in my application &lt;LI-EMOJI id="lia_grinning-face-with-smiling-eyes" title=":grinning_face_with_smiling_eyes:"&gt;&lt;/LI-EMOJI&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 17:30:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K312-Bootloader-jump-to-application-address/m-p/1802062#M31455</guid>
      <dc:creator>Vishnu3</dc:creator>
      <dc:date>2024-02-05T17:30:15Z</dc:date>
    </item>
  </channel>
</rss>

