<?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>S12 / MagniV MicrocontrollersのトピックS12Z 32bit struct with bitfields</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-32bit-struct-with-bitfields/m-p/696005#M14472</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using S12Z microcontroller on CW 10.6 with these code generation options:&lt;/P&gt;&lt;P&gt;Memory Model: Small&lt;/P&gt;&lt;P&gt;Bit-field gap limit: 255&lt;/P&gt;&lt;P&gt;Bit-filed byte allocation from LSB to MSB: enabled&lt;/P&gt;&lt;P&gt;Bit-filed type size reduction: disabled&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This struct:&lt;/P&gt;&lt;P&gt;typedef struct _TestStruct&lt;BR /&gt;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;unsigned long field1 : 1;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;unsigned long filed2 : 31; &lt;BR /&gt;} tTestStruct;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;has size of 5bytes in map file. What is the reason?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your response!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Sep 2017 10:30:40 GMT</pubDate>
    <dc:creator>ecorini</dc:creator>
    <dc:date>2017-09-07T10:30:40Z</dc:date>
    <item>
      <title>S12Z 32bit struct with bitfields</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-32bit-struct-with-bitfields/m-p/696005#M14472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using S12Z microcontroller on CW 10.6 with these code generation options:&lt;/P&gt;&lt;P&gt;Memory Model: Small&lt;/P&gt;&lt;P&gt;Bit-field gap limit: 255&lt;/P&gt;&lt;P&gt;Bit-filed byte allocation from LSB to MSB: enabled&lt;/P&gt;&lt;P&gt;Bit-filed type size reduction: disabled&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This struct:&lt;/P&gt;&lt;P&gt;typedef struct _TestStruct&lt;BR /&gt;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;unsigned long field1 : 1;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;unsigned long filed2 : 31; &lt;BR /&gt;} tTestStruct;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;has size of 5bytes in map file. What is the reason?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your response!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Sep 2017 10:30:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-32bit-struct-with-bitfields/m-p/696005#M14472</guid>
      <dc:creator>ecorini</dc:creator>
      <dc:date>2017-09-07T10:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z 32bit struct with bitfields</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-32bit-struct-with-bitfields/m-p/696006#M14473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;the issue is being solved. There were some test done and it was reported to a CodeWarrior application team.&lt;/P&gt;&lt;P&gt;now it looks like "feature" but unacceptable. The CW Apps engineer has promised to get some info.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ladislav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Sep 2017 09:01:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-32bit-struct-with-bitfields/m-p/696006#M14473</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2017-09-11T09:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z 32bit struct with bitfields</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-32bit-struct-with-bitfields/m-p/696007#M14474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the question.&lt;/P&gt;&lt;P&gt;I've discussed this behavior with our compiler expert.&lt;/P&gt;&lt;P&gt;It is caused by the S12Z compiler behavior when allocating structures. It allocates bitfields within 8 and 16-bit wide (with direct impact from the options described in the compiler manual). &amp;nbsp;Everything that exceeds 16 bit is allocated as a different field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The bitfield allocation unit is &lt;STRONG&gt;byte&lt;/STRONG&gt; and if things don't fit in byte (or too large gaps), the allocation can be extended to &lt;STRONG&gt;word.&amp;nbsp;&lt;/STRONG&gt;For 3 or 4 bytes, the allocation is done differently and does not allow merging other fields in a bitfield larger than a word (2-bytes)&lt;/P&gt;&lt;P&gt;So no matter how you arrange the structure, or the bit-field options you use, a bitfield larger than 16-bits will always be allocated alone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps to clarify this issue.&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2017 13:47:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-32bit-struct-with-bitfields/m-p/696007#M14474</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2017-09-12T13:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: S12Z 32bit struct with bitfields</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-32bit-struct-with-bitfields/m-p/696008#M14475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the reply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Sep 2017 06:28:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12Z-32bit-struct-with-bitfields/m-p/696008#M14475</guid>
      <dc:creator>ecorini</dc:creator>
      <dc:date>2017-09-18T06:28:20Z</dc:date>
    </item>
  </channel>
</rss>

