<?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>i.MX ProcessorsのトピックRe: i.MX8X noinit variables</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8X-noinit-variables/m-p/823575#M126686</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For your reference, &lt;A href="https://community.nxp.com/docs/DOC-342136"&gt;https://community.nxp.com/docs/DOC-342136&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am thinking you may also need to add the .noinit in the linker file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Jan 2019 04:08:09 GMT</pubDate>
    <dc:creator>jimmychan</dc:creator>
    <dc:date>2019-01-08T04:08:09Z</dc:date>
    <item>
      <title>i.MX8X noinit variables</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8X-noinit-variables/m-p/823574#M126685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Environment:&lt;/P&gt;&lt;P&gt;MEK-MIMX8QX eval board and NXP rev 2.5.0 SDK.&lt;/P&gt;&lt;P&gt;Developing app in C for the Cortex-M4.&lt;/P&gt;&lt;P&gt;ARM GCC embedded compiler v5.4 2016q3.&amp;nbsp; (I would like to use a newer one but I believe this is the latest version the current SDK supports.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our application requires a few RAM variables declared with the gcc "noinit" attribute so they don't get cleared across a soft reboot of the Cortex-M4.&amp;nbsp; On the first access of any of these noinit variables, the application crashes.&amp;nbsp; I don't have a debugger currently so I'm not sure exactly what exception it's hitting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the attachment, I've modified the demo hello_world app to show what's going on. I'm building with the "build_release.bat" script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In hello_world.c I added:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px;"&gt;// Attempt #1 - This worked using NXP S32K Design Studio and gcc compiler ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px;"&gt;//int __attribute__ ((section("noinit"))) MyNoInitVariable;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px;"&gt;// Attempt #2 - This is what I've seen in various articles on the web ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px;"&gt;int __attribute__ ((section(".noinit"))) MyNoInitVariable;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px;"&gt; PRINTF("Before read ...\r\n");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px;"&gt; PRINTF("MyNoInitVariable=0x%08x\r\n", MyNoInitVariable);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px;"&gt; PRINTF("Before write ...\r\n");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px;"&gt; MyNoInitVariable = 0xAAAAAAAA;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace; font-size: 12px;"&gt; PRINTF("After write ...\r\n");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When this runs, only the "Before read ..." printf works, then the application hangs.&amp;nbsp; As you can see, I tried naming the noinit section "noinit" and also ".noinit" and both versions fail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: This exact same application works using the "noinit" section name when I compile and run on an NXP S32K146 eval board.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2018 21:03:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8X-noinit-variables/m-p/823574#M126685</guid>
      <dc:creator>lawsonbob</dc:creator>
      <dc:date>2018-12-20T21:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8X noinit variables</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8X-noinit-variables/m-p/823575#M126686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For your reference, &lt;A href="https://community.nxp.com/docs/DOC-342136"&gt;https://community.nxp.com/docs/DOC-342136&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am thinking you may also need to add the .noinit in the linker file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2019 04:08:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8X-noinit-variables/m-p/823575#M126686</guid>
      <dc:creator>jimmychan</dc:creator>
      <dc:date>2019-01-08T04:08:09Z</dc:date>
    </item>
  </channel>
</rss>

