<?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: ECC RAM initialization and S32DS startup in S32K</title>
    <link>https://community.nxp.com/t5/S32K/ECC-RAM-initialization-and-S32DS-startup/m-p/1090761#M7902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Edward,&lt;/P&gt;&lt;P&gt;The SRAM ECC is initialized in the startup_S32K144.S file and this is done by 32b writes.&lt;/P&gt;&lt;P&gt;I was able to reproduce your test results only when I removed the ECC initialization.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/113549i43E422164D0408AA/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know which version of S32DS you are using.&lt;/P&gt;&lt;P&gt;As far as I know, the first version of the startup code didn't include the ECC initialization, it was added later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Aug 2020 11:24:22 GMT</pubDate>
    <dc:creator>danielmartynek</dc:creator>
    <dc:date>2020-08-14T11:24:22Z</dc:date>
    <item>
      <title>ECC RAM initialization and S32DS startup</title>
      <link>https://community.nxp.com/t5/S32K/ECC-RAM-initialization-and-S32DS-startup/m-p/1090760#M7901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AN12522 states about ECC RAM:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;2.2 Used ECC algorithm&lt;BR /&gt;The ECC implementation for the SRAM uses a Modified Hamming Code scheme with 40-bit check base that consists of &lt;STRONG&gt;32-bits&lt;/STRONG&gt; of data plus 8-parity bits.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clearly RAM initialization should be done in 32-bits aligned word writes. I thought that initializing RAM writing byte by byte could easily trigger ECC error flags set in ERM (I'm using S32K144 and S32K148). But S32DS startup code&amp;nbsp;indeed seems initializing RAM byte by byte:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-size: small;"&gt;uint8_t&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; * data_ram;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-size: small; "&gt;uint8_t&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; * code_ram;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-size: small; "&gt;uint8_t&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; * bss_start;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small;"&gt;/* Copy initialized data from ROM to RAM */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;while&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; (data_rom_end != data_rom)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;*data_ram = *data_rom;&lt;/P&gt;&lt;P&gt;data_ram++;&lt;/P&gt;&lt;P&gt;data_rom++;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; "&gt;/* Copy functions from ROM to RAM */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;while&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt; (code_rom_end != code_rom)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;*code_ram = *code_rom;&lt;/P&gt;&lt;P&gt;code_ram++;&lt;/P&gt;&lt;P&gt;code_rom++;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-size: small; "&gt;/* Clear the zero-initialized data section */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #7f0055; font-size: small; "&gt;while&lt;/STRONG&gt;&lt;SPAN style="font-size: small;"&gt;(bss_end != bss_start)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;*bss_start = 0;&lt;/P&gt;&lt;P&gt;bss_start++;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: small; "&gt;Since it is told that out of power on SRAM isn't initialized and ECC bits are most likely not OK, I decided to check it. Cloning flash Debug configuration and making debugger not reload flash but connect without reset to running MCU, powering MCU down for a while, then powering on, connecting debugger and inspecting ERM status registers I found that indeed status bits do report ECC problems. Then I added loop code into startup_S32K144.S to step through the rest of startup and figuring out what actually triggers&amp;nbsp;ECC flags. ECC errors start flipping&amp;nbsp;from&amp;nbsp;the first byte&amp;nbsp;by byte initialization loop.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question&amp;nbsp;are here. "Modified Hamming Code scheme with 40-bit check base that consists of &lt;STRONG&gt;32-bits&lt;/STRONG&gt; of data plus 8-parity bits.". Does it mean that 1) every RAM byte has dedicated&amp;nbsp;8/4=2 ECC bits? 2) Is it safe to write just single byte to uninitialized RAM DWORD and expect to read the same byte value after writing remaining 3 bytes of the same RAM DWORD?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Edward&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Aug 2020 13:37:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/ECC-RAM-initialization-and-S32DS-startup/m-p/1090760#M7901</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2020-08-13T13:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: ECC RAM initialization and S32DS startup</title>
      <link>https://community.nxp.com/t5/S32K/ECC-RAM-initialization-and-S32DS-startup/m-p/1090761#M7902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Edward,&lt;/P&gt;&lt;P&gt;The SRAM ECC is initialized in the startup_S32K144.S file and this is done by 32b writes.&lt;/P&gt;&lt;P&gt;I was able to reproduce your test results only when I removed the ECC initialization.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/113549i43E422164D0408AA/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know which version of S32DS you are using.&lt;/P&gt;&lt;P&gt;As far as I know, the first version of the startup code didn't include the ECC initialization, it was added later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Aug 2020 11:24:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/ECC-RAM-initialization-and-S32DS-startup/m-p/1090761#M7902</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2020-08-14T11:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: ECC RAM initialization and S32DS startup</title>
      <link>https://community.nxp.com/t5/S32K/ECC-RAM-initialization-and-S32DS-startup/m-p/1090762#M7903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank You! I started from creating new "S32DS Project from Example". Example projects seem being not updated and&amp;nbsp; use old startup files. Creating new "S32DS Application Project" I see what you provided in startup*.S file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Initializing only used locations could make startup bit faster. As well ECC handler could be used to detect unexpected accesses to locations which shouldn't be used (not initialized locations)... But initializing all available RAM is quite good as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Edward&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Aug 2020 20:42:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/ECC-RAM-initialization-and-S32DS-startup/m-p/1090762#M7903</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2020-08-15T20:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: ECC RAM initialization and S32DS startup</title>
      <link>https://community.nxp.com/t5/S32K/ECC-RAM-initialization-and-S32DS-startup/m-p/1090763#M7904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Edward, &lt;/P&gt;&lt;P&gt;I see, the non-SDK examples haven't been updated.&lt;/P&gt;&lt;P&gt;Let me report that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;BR, Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2020 10:50:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/ECC-RAM-initialization-and-S32DS-startup/m-p/1090763#M7904</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2020-08-17T10:50:13Z</dc:date>
    </item>
  </channel>
</rss>

