<?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: structure paddinf : codewarrior compiler in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/structure-paddinf-codewarrior-compiler/m-p/353124#M17538</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unsigned char is 1 byte in CodeWarrior for HCS12. so, this struct will take 3 bytes after compiled.&lt;/P&gt;&lt;P&gt;maybe the better way to do that is to define the element y as unsigned int.&lt;/P&gt;&lt;P&gt;If you just want the generated struct is aligned with 2bytes, then, you can also add "ALIGN 2" in the prm file follows the memory address like below:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;EEPROM_00 &lt;/TD&gt;&lt;TD&gt;= READ_ONLY&amp;nbsp;&amp;nbsp; DATA_FAR IBCC_FAR&amp;nbsp; 0x000800 TO 0x000BFF ALIGN 2; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;then, all data in EEPROM_00 will be aligned with 2 bytes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Dec 2014 07:56:55 GMT</pubDate>
    <dc:creator>Rick_Li</dc:creator>
    <dc:date>2014-12-16T07:56:55Z</dc:date>
    <item>
      <title>structure paddinf : codewarrior compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/structure-paddinf-codewarrior-compiler/m-p/353123#M17537</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 have a doubt in strucure padding relavant to code warrior IDE.&amp;nbsp; I'm working on a 16 bit microcontroller mc9s12xhy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;typedef struct{&lt;/P&gt;&lt;P&gt;unsigned int x;&lt;/P&gt;&lt;P&gt;unsigned char y;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}Error_mode;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error_mode Error_mode_Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While compiler compiles the code, it shall allocate 4 bytes for Error_mode_Data ( with padding&amp;nbsp; refernce: .map file ). It doesnt seem to happen. It s allocating 3 bytes only. Hw to switch on/off padding in a code warrior compiler? this is critical coz of im using for EEPROM write/read! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 05:06:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/structure-paddinf-codewarrior-compiler/m-p/353123#M17537</guid>
      <dc:creator>FIDDO</dc:creator>
      <dc:date>2014-12-16T05:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: structure paddinf : codewarrior compiler</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/structure-paddinf-codewarrior-compiler/m-p/353124#M17538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unsigned char is 1 byte in CodeWarrior for HCS12. so, this struct will take 3 bytes after compiled.&lt;/P&gt;&lt;P&gt;maybe the better way to do that is to define the element y as unsigned int.&lt;/P&gt;&lt;P&gt;If you just want the generated struct is aligned with 2bytes, then, you can also add "ALIGN 2" in the prm file follows the memory address like below:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;EEPROM_00 &lt;/TD&gt;&lt;TD&gt;= READ_ONLY&amp;nbsp;&amp;nbsp; DATA_FAR IBCC_FAR&amp;nbsp; 0x000800 TO 0x000BFF ALIGN 2; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;then, all data in EEPROM_00 will be aligned with 2 bytes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 07:56:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/structure-paddinf-codewarrior-compiler/m-p/353124#M17538</guid>
      <dc:creator>Rick_Li</dc:creator>
      <dc:date>2014-12-16T07:56:55Z</dc:date>
    </item>
  </channel>
</rss>

