<?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>Kinetis Design StudioのトピックCrash if an unused variable is commented out???</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Crash-if-an-unused-variable-is-commented-out/m-p/499809#M6274</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is unlike anything I've experienced before, so I was hoping that some of the ARM experts here could chime in and offer their perspective on my situation.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an application running on a MK22FN128VLL10.&amp;nbsp; I have a class A that has a uint32_t member variable.&amp;nbsp; I have another unrelated class B that pulls data in from the UART.&amp;nbsp; The problem I'm seeing is that if I comment out the uint32_t in class A, a method in class B literally causes a hard fault.&amp;nbsp; If I replace the uint32_t with a uint8_t, it also crashes.&amp;nbsp; However, if I use a uint8_t[4], then it runs just fine.&amp;nbsp; So it seems like a memory alignment issue; I did a hail mary and added the -mno-unaligned-access compiler flag, but that didn't fix the problem.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone suggest what's going on, or throw some potential search terms at me that will get me on the right track towards fixing this problem?&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;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Apr 2016 17:03:38 GMT</pubDate>
    <dc:creator>dave408</dc:creator>
    <dc:date>2016-04-13T17:03:38Z</dc:date>
    <item>
      <title>Crash if an unused variable is commented out???</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Crash-if-an-unused-variable-is-commented-out/m-p/499809#M6274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is unlike anything I've experienced before, so I was hoping that some of the ARM experts here could chime in and offer their perspective on my situation.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an application running on a MK22FN128VLL10.&amp;nbsp; I have a class A that has a uint32_t member variable.&amp;nbsp; I have another unrelated class B that pulls data in from the UART.&amp;nbsp; The problem I'm seeing is that if I comment out the uint32_t in class A, a method in class B literally causes a hard fault.&amp;nbsp; If I replace the uint32_t with a uint8_t, it also crashes.&amp;nbsp; However, if I use a uint8_t[4], then it runs just fine.&amp;nbsp; So it seems like a memory alignment issue; I did a hail mary and added the -mno-unaligned-access compiler flag, but that didn't fix the problem.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone suggest what's going on, or throw some potential search terms at me that will get me on the right track towards fixing this problem?&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2016 17:03:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Crash-if-an-unused-variable-is-commented-out/m-p/499809#M6274</guid>
      <dc:creator>dave408</dc:creator>
      <dc:date>2016-04-13T17:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Crash if an unused variable is commented out???</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Crash-if-an-unused-variable-is-commented-out/m-p/499810#M6275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dave,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you share your project so we can reproduce the issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Carlos Mendoza&lt;/P&gt;&lt;P&gt;Technical Support Engineer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2016 17:09:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Crash-if-an-unused-variable-is-commented-out/m-p/499810#M6275</guid>
      <dc:creator>Carlos_Mendoza</dc:creator>
      <dc:date>2016-04-14T17:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Crash if an unused variable is commented out???</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Crash-if-an-unused-variable-is-commented-out/m-p/499811#M6276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlos,&amp;nbsp; I can email you the project (cannot post here), but I do not think you will be able to reproduce the issue unless you have our hardware as well.&amp;nbsp; Do you still want to take a look at it?&amp;nbsp; If so, please send me a message with your NXP email address, or instructions for whatever process you prefer to use.&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2016 19:04:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Crash-if-an-unused-variable-is-commented-out/m-p/499811#M6276</guid>
      <dc:creator>dave408</dc:creator>
      <dc:date>2016-04-14T19:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Crash if an unused variable is commented out???</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Crash-if-an-unused-variable-is-commented-out/m-p/499812#M6277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi dave,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Carlos is on vacation this week.&lt;/P&gt;&lt;P&gt;from my experience, it's hard to root the problem without reproduction.&lt;/P&gt;&lt;P&gt;can you please develop a demo code that we can use to produce the problem on demo board?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Jennie Zhang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2016 07:19:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Crash-if-an-unused-variable-is-commented-out/m-p/499812#M6277</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2016-04-18T07:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Crash if an unused variable is commented out???</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/Crash-if-an-unused-variable-is-commented-out/m-p/499813#M6278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I see something like this and it's not a memory alignment issue, my first suspicion is a stack overflow or bad pointer somewhere.&amp;nbsp; Could be a value is getting trashed regardless but it's only something that causes a crash when you remove that one member.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something else that's given me headaches is a packing mismatch.&amp;nbsp; In one case I was running FatFS and in one part of the code the ff.h header was picking up a #pragma pack from another header that failed to reset the packing to default, and in the FatFS module itself ff.h didn't get that pack directive.&amp;nbsp; The result was that somewhere in the middle of the struct, the two pieces of code diverged in their ideas about where the next field was.&amp;nbsp; A long filename buffer was offset by one byte and caused horrible crashes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you know where the crash is happening, go through in instruction stepping mode and see if you can catch what it's doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jul 2016 19:15:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/Crash-if-an-unused-variable-is-commented-out/m-p/499813#M6278</guid>
      <dc:creator>scottm</dc:creator>
      <dc:date>2016-07-30T19:15:22Z</dc:date>
    </item>
  </channel>
</rss>

