<?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: Problem with setting a external memory location. in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problem-with-setting-a-external-memory-location/m-p/152958#M2201</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;To answer crasyCat.&lt;BR /&gt;&amp;nbsp;&amp;nbsp; MC9S12XDP512MAG is the processor with&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CodeWarrier IDE 5.7&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Freescale HC12,HC12x,HCS12x version 4.5&lt;BR /&gt;&lt;BR /&gt;To Answer Lundin reply. Yes have thought of the bit field and therefore changed it to a uchar as it would use that amount of visical memory anyway.&lt;BR /&gt;&lt;BR /&gt;This had no effect.&lt;BR /&gt;&lt;BR /&gt;To perplex it even further if cOutPointer is decleared at 0x281A then the code works but if it is at location 0x36A2 it dosnt work.&lt;BR /&gt;&lt;BR /&gt;Removing the volatile as the whole structure is decleared volatile seemed to allow a memory location of 0x36A2 to work as well also the bit field is deleared as an unsigned char unsigned int is no different.&lt;BR /&gt;&lt;BR /&gt;I shell try and set it up with bit masks and see what happens.&lt;BR /&gt;&lt;BR /&gt;Thanks for your surgestions&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 May 2008 03:48:27 GMT</pubDate>
    <dc:creator>NZ_Design</dc:creator>
    <dc:date>2008-05-06T03:48:27Z</dc:date>
    <item>
      <title>Problem with setting a external memory location.</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problem-with-setting-a-external-memory-location/m-p/152954#M2197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a structure in my external ram. I can set a byte in one line and the next line does not work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;typedef struct&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; volatile unsigned bOutFired:1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; volatile uchar&amp;nbsp;&amp;nbsp;&amp;nbsp; cOutExit;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; volatile uchar&amp;nbsp;&amp;nbsp;&amp;nbsp; cBatchExit;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; volatile uchar&amp;nbsp;&amp;nbsp;&amp;nbsp; cLabelPoint;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; volatile uchar&amp;nbsp;&amp;nbsp;&amp;nbsp; cFruitSize;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; volatile uint&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iFruitWeight;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}BED;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BEDFruitBed[16][512];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;uint iLoadcellPoint;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp; Gloabal variable&amp;nbsp; located at 0x225C42'G&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;uint cTstOut;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; // &amp;nbsp; Global variable&amp;nbsp; &amp;nbsp; located at 0x301A&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cLane is uchar passed into the routine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cOutPointer is uchar decleared in the routine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FruitBed[cLane][iLoadcellPoint].cOutExit = cTstOut;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Store outlet to exit in bed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; // This line loads the cTstExit into the memory location correctly every time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // This line is put in to test the next line. As this line works in another piece of code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FruitBed[cLane][iLoadcellPoint].cOutExit = cOutPointer;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Store outlet to exit in bed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // This line does nothing this is the line that needs to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried to declear cOutPointer as a volatile uchar. With no change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have any clues or have a rule for declearing data as I have found Codeworrier to be quite finiky about home data is decleared.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 07:46:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problem-with-setting-a-external-memory-location/m-p/152954#M2197</guid>
      <dc:creator>NZ_Design</dc:creator>
      <dc:date>2008-05-05T07:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with setting a external memory location.</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problem-with-setting-a-external-memory-location/m-p/152955#M2198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;- Which CPU are you targeting (HC08, HC12, Coldfire, ..)&lt;BR /&gt;- Which version of CodeWarrior are you using?&lt;BR /&gt;To retrieve that info:&lt;BR /&gt;- Start CodeWarrior&lt;BR /&gt;- Select Help -&amp;gt; About Freescale CodeWarrior&lt;BR /&gt;- Click on "Install Products"&lt;BR /&gt;- CodeWarrior version used is displayed on top in the Installed Products dialog.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;CrasyCat&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 18:41:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problem-with-setting-a-external-memory-location/m-p/152955#M2198</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2008-05-05T18:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with setting a external memory location.</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problem-with-setting-a-external-memory-location/m-p/152956#M2199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Spontaneously, I would say the problem is likely caused by the non-standard bitfield that is your struct. How that struct behaves when it comes to memory alignment, msb/lsb, big/little endian and struct padding is all completely undefined by the C standard. It might very well be a padding byte that is written to.&lt;BR /&gt;&lt;BR /&gt;So how that particular code behaves is entirely up to the non-standard parts of the specific version of Codewarrior that you have.&lt;BR /&gt;&lt;BR /&gt;The best solution to this is to get rid of bitfields entirely and use bit masks and the bitwise operators instead.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 20:21:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problem-with-setting-a-external-memory-location/m-p/152956#M2199</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2008-05-05T20:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with setting a external memory location.</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problem-with-setting-a-external-memory-location/m-p/152957#M2200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If Lundin's theory is correct, making the bit field the last element of the structure might have some effect&amp;nbsp;&amp;nbsp; Perhaps it needs to be declared as unsigned int.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Mac&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 23:43:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problem-with-setting-a-external-memory-location/m-p/152957#M2200</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-05-05T23:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with setting a external memory location.</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problem-with-setting-a-external-memory-location/m-p/152958#M2201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;To answer crasyCat.&lt;BR /&gt;&amp;nbsp;&amp;nbsp; MC9S12XDP512MAG is the processor with&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CodeWarrier IDE 5.7&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Freescale HC12,HC12x,HCS12x version 4.5&lt;BR /&gt;&lt;BR /&gt;To Answer Lundin reply. Yes have thought of the bit field and therefore changed it to a uchar as it would use that amount of visical memory anyway.&lt;BR /&gt;&lt;BR /&gt;This had no effect.&lt;BR /&gt;&lt;BR /&gt;To perplex it even further if cOutPointer is decleared at 0x281A then the code works but if it is at location 0x36A2 it dosnt work.&lt;BR /&gt;&lt;BR /&gt;Removing the volatile as the whole structure is decleared volatile seemed to allow a memory location of 0x36A2 to work as well also the bit field is deleared as an unsigned char unsigned int is no different.&lt;BR /&gt;&lt;BR /&gt;I shell try and set it up with bit masks and see what happens.&lt;BR /&gt;&lt;BR /&gt;Thanks for your surgestions&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2008 03:48:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problem-with-setting-a-external-memory-location/m-p/152958#M2201</guid>
      <dc:creator>NZ_Design</dc:creator>
      <dc:date>2008-05-06T03:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with setting a external memory location.</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problem-with-setting-a-external-memory-location/m-p/152959#M2202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;After a days work converting the bit fields over it is looking like it works.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2008 11:40:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problem-with-setting-a-external-memory-location/m-p/152959#M2202</guid>
      <dc:creator>NZ_Design</dc:creator>
      <dc:date>2008-05-06T11:40:43Z</dc:date>
    </item>
  </channel>
</rss>

