<?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 structure - unaligned memory? hard fault in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/structure-unaligned-memory-hard-fault/m-p/690185#M42500</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I may be having an unalignment memory hard fault occurring. &amp;nbsp;I am using some code which has run fine on the KL devices, but is giving the K22 a hard fault. &amp;nbsp;I have narrowed down the issue to writing to a structure variable. &amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been happily naive about memory alignment and it appears it is time to learn more details about it in fixing my issue here. &amp;nbsp;I have attached the project which is running on the frdm-k22f board. &amp;nbsp;The main loop has a write to the structure and which seems to be casuing the issue. &amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone explain what is wrong with the structure defenition? &amp;nbsp;How I can avoid this in the future? &amp;nbsp;And how to fix it?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337272"&gt;test_sd.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jun 2017 22:32:20 GMT</pubDate>
    <dc:creator>mjg8t</dc:creator>
    <dc:date>2017-06-16T22:32:20Z</dc:date>
    <item>
      <title>structure - unaligned memory? hard fault</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/structure-unaligned-memory-hard-fault/m-p/690185#M42500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I may be having an unalignment memory hard fault occurring. &amp;nbsp;I am using some code which has run fine on the KL devices, but is giving the K22 a hard fault. &amp;nbsp;I have narrowed down the issue to writing to a structure variable. &amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been happily naive about memory alignment and it appears it is time to learn more details about it in fixing my issue here. &amp;nbsp;I have attached the project which is running on the frdm-k22f board. &amp;nbsp;The main loop has a write to the structure and which seems to be casuing the issue. &amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone explain what is wrong with the structure defenition? &amp;nbsp;How I can avoid this in the future? &amp;nbsp;And how to fix it?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337272"&gt;test_sd.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jun 2017 22:32:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/structure-unaligned-memory-hard-fault/m-p/690185#M42500</guid>
      <dc:creator>mjg8t</dc:creator>
      <dc:date>2017-06-16T22:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: structure - unaligned memory? hard fault</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/structure-unaligned-memory-hard-fault/m-p/690186#M42501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I read you code and found that pdev is a pointer. But I didn't see you initializing it. A pointer must point to a entity before you use it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jun 2017 07:54:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/structure-unaligned-memory-hard-fault/m-p/690186#M42501</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2017-06-19T07:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: structure - unaligned memory? hard fault</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/structure-unaligned-memory-hard-fault/m-p/690187#M42502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for having a look! &amp;nbsp;Very glad it was a something so simple. &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2017 17:04:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/structure-unaligned-memory-hard-fault/m-p/690187#M42502</guid>
      <dc:creator>mjg8t</dc:creator>
      <dc:date>2017-06-21T17:04:13Z</dc:date>
    </item>
  </channel>
</rss>

