<?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: Dtcm alignment hardfault in S32K</title>
    <link>https://community.nxp.com/t5/S32K/Dtcm-alignment-hardfault/m-p/2071199#M47323</link>
    <description>&lt;P&gt;Managed to pin it down a bit. It turns out that it is not the memcpy that fails but rather setting up the parameters for memcpy, specifically the misaligned destination address. This is unfortunate because it means I cannot replace the memcpy with an alternative.&lt;/P&gt;&lt;P&gt;Making a hardcoded memcpy to the same address works, but not the parameterised destination address. (Breakpoint at the instruction causing the hardfault.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ola_gook_1-1743425825005.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/330553iB3D1D3005D421277/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ola_gook_1-1743425825005.png" alt="ola_gook_1-1743425825005.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;/Ola&lt;/P&gt;</description>
    <pubDate>Mon, 31 Mar 2025 12:59:39 GMT</pubDate>
    <dc:creator>ola_gook</dc:creator>
    <dc:date>2025-03-31T12:59:39Z</dc:date>
    <item>
      <title>Dtcm alignment hardfault</title>
      <link>https://community.nxp.com/t5/S32K/Dtcm-alignment-hardfault/m-p/2071023#M47317</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am upgrading a project from DS3.4 to DS3.6 and have a problem.&lt;/P&gt;&lt;P&gt;DS3.6 example and system files all use dtcm as stack area, whereas 3.4 used sram. This makes sense and I would prefer to use dtcm also in my project.&lt;/P&gt;&lt;P&gt;However, as my SW uses numerous memcpy with stack as destination and sometimes with unaligned data, I get hardfaults when calling memcpy.&lt;/P&gt;&lt;P&gt;If I understand correctly, the dtcm is aligned differently than sram and that this cannot be changed.&lt;/P&gt;&lt;P&gt;Is there a way around this or do I need to replace all my memcpy calls with an aligned alternative memcpy?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 09:43:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Dtcm-alignment-hardfault/m-p/2071023#M47317</guid>
      <dc:creator>ola_gook</dc:creator>
      <dc:date>2025-03-31T09:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dtcm alignment hardfault</title>
      <link>https://community.nxp.com/t5/S32K/Dtcm-alignment-hardfault/m-p/2071199#M47323</link>
      <description>&lt;P&gt;Managed to pin it down a bit. It turns out that it is not the memcpy that fails but rather setting up the parameters for memcpy, specifically the misaligned destination address. This is unfortunate because it means I cannot replace the memcpy with an alternative.&lt;/P&gt;&lt;P&gt;Making a hardcoded memcpy to the same address works, but not the parameterised destination address. (Breakpoint at the instruction causing the hardfault.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ola_gook_1-1743425825005.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/330553iB3D1D3005D421277/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ola_gook_1-1743425825005.png" alt="ola_gook_1-1743425825005.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;/Ola&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 12:59:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Dtcm-alignment-hardfault/m-p/2071199#M47323</guid>
      <dc:creator>ola_gook</dc:creator>
      <dc:date>2025-03-31T12:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dtcm alignment hardfault</title>
      <link>https://community.nxp.com/t5/S32K/Dtcm-alignment-hardfault/m-p/2073448#M47447</link>
      <description>&lt;P&gt;DTCM memory does not have any limitation for read/write accesses in the meaning of data aligment. There is only write access size requirements for ECC initialization that is 64-bit for SRAM and 32-bit for DTCM, but during runtime data accesses may be on any size and alignment.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 07:44:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Dtcm-alignment-hardfault/m-p/2073448#M47447</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2025-04-03T07:44:04Z</dc:date>
    </item>
  </channel>
</rss>

