<?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: no_init in Coldfire CW6.3 LCF linker command file? in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/no-init-in-Coldfire-CW6-3-LCF-linker-command-file/m-p/310049#M6687</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to piece together a working solution out of a lot of research.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, I modified the my LCF linker command file as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MEMORY &lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; NVRAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW)&amp;nbsp; : ORIGIN = 0x00800000, LENGTH = 0x00000100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SECTIONS &lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp; .no_init : &lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.no_init)&lt;/P&gt;&lt;P&gt;&amp;nbsp; } &amp;gt; NVRAM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ....&amp;nbsp; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, within my code, I declared my persistent data (in this case, a clock structure) as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#pragma define_section NO_INIT ".no_init" ".no_init"&lt;/P&gt;&lt;P&gt;__declspec(NO_INIT) volatile T_CLK&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tClk;&amp;nbsp;&amp;nbsp; //uninitialized!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, at least in preliminary tests, my clock will survive a PIN reset to keep counting, but of course I'll have to do something specific on any other reset (POR, COP, etc.),&amp;nbsp; but I'm willing to deal with that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Good luck to all in your non-CW 6.3, non-MCF51 implementations.&amp;nbsp; I've had to experiment with a number of community posts to come up with the above.&amp;nbsp; Some of the offerings seemed to do nothing.&amp;nbsp; Others produced linker error messages I just don't care to deal with.&amp;nbsp; LCF documentation was marginally helpful (I thank whomever I ripped off the above from, wherever you are).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jun 2014 19:07:51 GMT</pubDate>
    <dc:creator>dougpaulsen</dc:creator>
    <dc:date>2014-06-03T19:07:51Z</dc:date>
    <item>
      <title>no_init in Coldfire CW6.3 LCF linker command file?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/no-init-in-Coldfire-CW6-3-LCF-linker-command-file/m-p/310048#M6686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems like it should be straightforward, but I'm having difficultly understanding how to declare un-initialized RAM in LCF-type linker files.&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The use of the NO_INIT keyword in PRM linker files is discussed here and there in the forums and I've used it in other 8-bit CW projects, but my current interest is for Coldfire processors.&amp;nbsp; Under CW 6.3, these deploy a LCF linker command file.&amp;nbsp; I not been able to locate any documentation indicating the NO_INIT (or similar) keyword is valid there.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Obviously, there are a few variables which would be vary helpful to persist over a PIN reset.&amp;nbsp; The CW default is for all un-initialized variables to be cleared to zero, which I understand and appreciate.&amp;nbsp; This is my first Coldfire project, but other experiences with other micro/compiler combinations make declaring un-initialized variables quite easy.&amp;nbsp; One wonders why CW makes it so obtuse in the case of Coldfire processors.&amp;nbsp; Is there perhaps a hardware restraint?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regardless, I would appreciate any comments/directions on setting up uninitialized segments in LCF files.&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;Doug&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jun 2014 14:20:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/no-init-in-Coldfire-CW6-3-LCF-linker-command-file/m-p/310048#M6686</guid>
      <dc:creator>dougpaulsen</dc:creator>
      <dc:date>2014-06-02T14:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: no_init in Coldfire CW6.3 LCF linker command file?</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/no-init-in-Coldfire-CW6-3-LCF-linker-command-file/m-p/310049#M6687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to piece together a working solution out of a lot of research.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, I modified the my LCF linker command file as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MEMORY &lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; NVRAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW)&amp;nbsp; : ORIGIN = 0x00800000, LENGTH = 0x00000100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SECTIONS &lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp; .no_init : &lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.no_init)&lt;/P&gt;&lt;P&gt;&amp;nbsp; } &amp;gt; NVRAM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ....&amp;nbsp; &lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, within my code, I declared my persistent data (in this case, a clock structure) as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#pragma define_section NO_INIT ".no_init" ".no_init"&lt;/P&gt;&lt;P&gt;__declspec(NO_INIT) volatile T_CLK&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tClk;&amp;nbsp;&amp;nbsp; //uninitialized!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, at least in preliminary tests, my clock will survive a PIN reset to keep counting, but of course I'll have to do something specific on any other reset (POR, COP, etc.),&amp;nbsp; but I'm willing to deal with that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Good luck to all in your non-CW 6.3, non-MCF51 implementations.&amp;nbsp; I've had to experiment with a number of community posts to come up with the above.&amp;nbsp; Some of the offerings seemed to do nothing.&amp;nbsp; Others produced linker error messages I just don't care to deal with.&amp;nbsp; LCF documentation was marginally helpful (I thank whomever I ripped off the above from, wherever you are).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 19:07:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/no-init-in-Coldfire-CW6-3-LCF-linker-command-file/m-p/310049#M6687</guid>
      <dc:creator>dougpaulsen</dc:creator>
      <dc:date>2014-06-03T19:07:51Z</dc:date>
    </item>
  </channel>
</rss>

