<?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>S32KのトピックRe: S32K3 sharing data between Bootloader and Application</title>
    <link>https://community.nxp.com/t5/S32K/S32K3-sharing-data-between-Bootloader-and-Application/m-p/1833466#M33337</link>
    <description>&lt;P&gt;hello, there is a&amp;nbsp; question to be wroked out , i want to know ,in S32K312 's link file , if i want to set a flag which is used for app vaild flag&amp;nbsp; &amp;nbsp;in ram ,and after soft reset,the flag will not clear , i must set the flag in&amp;nbsp; the standby ram or not?&amp;nbsp; in demo called unified_bootloader_demo_v2.1 ,i found&amp;nbsp; the flag was set in the lastest section as blew:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zq1_0-1711090569086.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269905i7EE2A5234FE899D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="zq1_0-1711090569086.png" alt="zq1_0-1711090569086.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zq1_1-1711090620877.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269906iCE6D83DA0F442AAE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="zq1_1-1711090620877.png" alt="zq1_1-1711090620877.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;hope your reply ,thank you very much.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Mar 2024 06:57:48 GMT</pubDate>
    <dc:creator>zq1</dc:creator>
    <dc:date>2024-03-22T06:57:48Z</dc:date>
    <item>
      <title>S32K3 sharing data between Bootloader and Application</title>
      <link>https://community.nxp.com/t5/S32K/S32K3-sharing-data-between-Bootloader-and-Application/m-p/1502773#M16958</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another Bootloader and application question.... How do I share data between bootloader and application.&lt;/P&gt;&lt;P&gt;I am using S32DS to build my application and have tried following "unified_bootloader_Demo_V2.0" as a reference.&lt;/P&gt;&lt;P&gt;My linker file looks as&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MEMORY 
{         
    int_flash                : ORIGIN = 0x00410400, LENGTH = 0x0007FC00     /* 511K - 176K (sBAF + HSE)*/
    int_itcm                 : ORIGIN = 0x00000000, LENGTH = 0x00010000    /* 32K */
    int_dtcm                 : ORIGIN = 0x20000000, LENGTH = 0x00020000    /* 64K */
    int_sram                 : ORIGIN = 0x20400000, LENGTH = 0x0002DF00    /* 183.9K */
    int_sram_fls_rsv         : ORIGIN = 0x2042DF00, LENGTH = 0x00000100    /* 0.1K */
    int_sram_stack_c0        : ORIGIN = 0x2042E000, LENGTH = 0x00001000    /* 4KB  */
    int_sram_stack_c1        : ORIGIN = 0x2042F000, LENGTH = 0x00001000    /* 4KB  */
    int_sram_no_cacheable    : ORIGIN = 0x20430000, LENGTH = 0x0000FF00    /* 64KB, needs to include int_results  */
    int_sram_results         : ORIGIN = 0x2043FF00, LENGTH = 0x00000100
    int_sram_shareable       : ORIGIN = 0x20440000, LENGTH = 0x00004000-0x80  /* 16KB */
    ram_rsvd2                : ORIGIN = 0x20443F80, LENGTH = 0                /* End of SRAM */
    ram_boot_apploader_share : ORIGIN = 0x20443F80, LENGTH = 0x00000080		  /* Reserve 128 bytes */
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;When I try to write data in bootloader&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;*(uint32_t*) 0x20443F80 = DataToShare;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it throws hard fault.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please let me know what I am missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;"unified_bootloader_Demo_V2.0" seems to do something similar but it writes to&amp;nbsp; 0x20443F80 + 14.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 19:14:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K3-sharing-data-between-Bootloader-and-Application/m-p/1502773#M16958</guid>
      <dc:creator>HemantKapoor</dc:creator>
      <dc:date>2022-08-08T19:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: S32K3 sharing data between Bootloader and Application</title>
      <link>https://community.nxp.com/t5/S32K/S32K3-sharing-data-between-Bootloader-and-Application/m-p/1503403#M16986</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The hard fault is die to IMPRECISERR and my best guess is that I have limited the int_sram_shareable to 0x00004000-0x80 so somehow RAM region from 0x20443F80 got inaccessible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't see how ""unified_bootloader_Demo_V2.0"" is getting away with this.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 15:31:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K3-sharing-data-between-Bootloader-and-Application/m-p/1503403#M16986</guid>
      <dc:creator>HemantKapoor</dc:creator>
      <dc:date>2022-08-09T15:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: S32K3 sharing data between Bootloader and Application</title>
      <link>https://community.nxp.com/t5/S32K/S32K3-sharing-data-between-Bootloader-and-Application/m-p/1531423#M18082</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/202580"&gt;@HemantKapoor&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I guess it's caused by ECC error because the SRAM is not initialized. The unified bootloader uses this code for SRAM initialization:&lt;/P&gt;
&lt;P&gt;RamInit:&lt;BR /&gt;/* Initialize SRAM ECC */&lt;BR /&gt;ldr r0, =__RAM_INIT&lt;BR /&gt;cmp r0, 0&lt;BR /&gt;/* Skip if __SRAM_INIT is not set */&lt;BR /&gt;beq SRAM_LOOP_END&lt;BR /&gt;ldr r1, =__INT_SRAM_START&lt;BR /&gt;ldr r2, =__INT_SRAM_END&lt;/P&gt;
&lt;P&gt;subs r2, r1&lt;BR /&gt;subs r2, #1&lt;BR /&gt;ble SRAM_LOOP_END&lt;/P&gt;
&lt;P&gt;movs r0, 0&lt;BR /&gt;movs r3, 0&lt;BR /&gt;SRAM_LOOP:&lt;BR /&gt;stm r1!, {r0,r3}&lt;BR /&gt;subs r2, 8&lt;BR /&gt;bge SRAM_LOOP&lt;BR /&gt;SRAM_LOOP_END:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Values __INT_SRAM_START and __INT_SRAM_END are defined like this in the linker file:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;__INT_SRAM_START = ORIGIN(int_sram);&lt;BR /&gt;__INT_SRAM_END = ORIGIN(ram_rsvd2);&lt;/P&gt;
&lt;P&gt;But you added your segment after the ram_rscd2:&lt;/P&gt;
&lt;P&gt;ram_rsvd2 : ORIGIN = 0x20443F80, LENGTH = 0 /* End of SRAM */&lt;BR /&gt;ram_boot_apploader_share : ORIGIN = 0x20443F80, LENGTH = 0x00000080 /* Reserve 128 bytes */&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;So, it's not touched by this SRAM initialization. You need to initialize also this piece of memory.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 04:48:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K3-sharing-data-between-Bootloader-and-Application/m-p/1531423#M18082</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2022-10-03T04:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: S32K3 sharing data between Bootloader and Application</title>
      <link>https://community.nxp.com/t5/S32K/S32K3-sharing-data-between-Bootloader-and-Application/m-p/1532337#M18115</link>
      <description>&lt;P&gt;Hello Lukas,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for the response.&lt;/P&gt;&lt;P&gt;I followed the unified bootloader linker file usage and it is also doing something similar,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ram_rsvd2 : ORIGIN = 0x20443FF0, LENGTH = 0 /* End of SRAM */&lt;BR /&gt;ExchangeInfo : ORIGIN = 0x20443FF0, LENGTH = 0x00000010&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So not sure what I have missed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hemant Kapoor&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 21:04:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K3-sharing-data-between-Bootloader-and-Application/m-p/1532337#M18115</guid>
      <dc:creator>HemantKapoor</dc:creator>
      <dc:date>2022-10-04T21:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: S32K3 sharing data between Bootloader and Application</title>
      <link>https://community.nxp.com/t5/S32K/S32K3-sharing-data-between-Bootloader-and-Application/m-p/1532756#M18128</link>
      <description>&lt;P&gt;Hi Hemant,&lt;/P&gt;
&lt;P&gt;I found this function in file boot_Cfg.c:&lt;/P&gt;
&lt;P&gt;/*when power on, clear all flag in RAM for ECC.*/&lt;BR /&gt;void Boot_PowerONClearAllFlag(void)&lt;BR /&gt;{&lt;BR /&gt;uint16 infoCrc = 0u;&lt;BR /&gt;uint8 index = 0u;&lt;/P&gt;
&lt;P&gt;/*clear RAM with 4 bytes for ECC*/&lt;BR /&gt;for(index = 0u; index &amp;lt; (gs_stBootInfo.infoDataLen &amp;gt;&amp;gt; 2u); index++)&lt;BR /&gt;{&lt;BR /&gt;*((uint32 *)gs_stBootInfo.infoStartAddr + index) = 0u;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;infoCrc = Boot_CalculateInfoCRC();&lt;BR /&gt;SetInforCRC(infoCrc); &lt;BR /&gt;} &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, this piece of memory is initialized only when needed - after power on reset.&lt;/P&gt;
&lt;P&gt;However, I think that it is not correct because RAM needs to be initialized by 64bit write as mentioned in the reference manual. I have already contacted authors of the unified bootloader if they can fix it.&lt;/P&gt;
&lt;P&gt;To initialize this piece of RAM, you can use something like (just copied from startup files, modify it as needed):&lt;/P&gt;
&lt;P&gt;/* Initialize STANDBY RAM if chip comes from POR */&lt;BR /&gt;if (MC_RGM-&amp;gt;DES &amp;amp; MC_RGM_DES_F_POR_MASK)&lt;BR /&gt;{&lt;BR /&gt;/* Initialize STANDBY RAM */&lt;BR /&gt;cnt = (( uint32_t)(&amp;amp;__STDBYRAM_SIZE)) / 8U;&lt;BR /&gt;pDest = (uint64_t *)(&amp;amp;__STDBYRAM_START);&lt;BR /&gt;while (cnt--)&lt;BR /&gt;{&lt;BR /&gt;&lt;STRONG&gt;*pDest = (uint64_t)0xDEADBEEFCAFEFEEDULL;&lt;/STRONG&gt;&lt;BR /&gt;pDest++;&lt;BR /&gt;}&lt;BR /&gt;MC_RGM-&amp;gt;DES = MC_RGM_DES_F_POR_MASK; /* Write 1 to clear F_POR */&lt;/P&gt;
&lt;P&gt;I can see that the access is translated to use STRD instruction which should generate 64bit write.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Lukas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 15:47:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K3-sharing-data-between-Bootloader-and-Application/m-p/1532756#M18128</guid>
      <dc:creator>lukaszadrapa</dc:creator>
      <dc:date>2022-10-05T15:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: S32K3 sharing data between Bootloader and Application</title>
      <link>https://community.nxp.com/t5/S32K/S32K3-sharing-data-between-Bootloader-and-Application/m-p/1537182#M18295</link>
      <description>&lt;P&gt;Hello Lukas,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your solution worked like a charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a ton.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 14:25:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K3-sharing-data-between-Bootloader-and-Application/m-p/1537182#M18295</guid>
      <dc:creator>HemantKapoor</dc:creator>
      <dc:date>2022-10-13T14:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: S32K3 sharing data between Bootloader and Application</title>
      <link>https://community.nxp.com/t5/S32K/S32K3-sharing-data-between-Bootloader-and-Application/m-p/1833466#M33337</link>
      <description>&lt;P&gt;hello, there is a&amp;nbsp; question to be wroked out , i want to know ,in S32K312 's link file , if i want to set a flag which is used for app vaild flag&amp;nbsp; &amp;nbsp;in ram ,and after soft reset,the flag will not clear , i must set the flag in&amp;nbsp; the standby ram or not?&amp;nbsp; in demo called unified_bootloader_demo_v2.1 ,i found&amp;nbsp; the flag was set in the lastest section as blew:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zq1_0-1711090569086.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269905i7EE2A5234FE899D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="zq1_0-1711090569086.png" alt="zq1_0-1711090569086.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zq1_1-1711090620877.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/269906iCE6D83DA0F442AAE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="zq1_1-1711090620877.png" alt="zq1_1-1711090620877.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;hope your reply ,thank you very much.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 06:57:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K3-sharing-data-between-Bootloader-and-Application/m-p/1833466#M33337</guid>
      <dc:creator>zq1</dc:creator>
      <dc:date>2024-03-22T06:57:48Z</dc:date>
    </item>
  </channel>
</rss>

