<?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>S32 Design Studio中的主题 5744P LIB union struct</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/5744P-LIB-union-struct/m-p/701946#M1718</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,NXP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I have a qustion for S32DS 5744P lib about C union struct 。&lt;/P&gt;&lt;P&gt;C language:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_8.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/26914i358F7FFE6597AFC6/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_8.png" alt="pastedImage_8.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In 5744P lib &amp;nbsp;:&lt;/P&gt;&lt;P&gt;typedef union { ///INIT_VREG_Tx&lt;BR /&gt; vuint32_t R;&lt;BR /&gt; struct {&lt;BR /&gt; vuint32_t :16; &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; &lt;STRONG&gt;&lt;EM&gt;high bit&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt; vuint32_t RW : 1;&lt;BR /&gt; vuint32_t ADR : 6;&lt;BR /&gt; vuint32_t P : 1;&lt;BR /&gt; vuint32_t ICCA_LIM : 1;&lt;BR /&gt; vuint32_t TCCA_LIM_OFF : 1;&lt;BR /&gt; vuint32_t IPFF_DIS : 1;&lt;BR /&gt; vuint32_t VCAN_OV_MON : 1;&lt;BR /&gt; vuint32_t : 1;&lt;BR /&gt; vuint32_t TAUX_LIM_OFF : 1;&lt;BR /&gt; vuint32_t VAUX_TRK_EN : 1;&lt;BR /&gt; vuint32_t : 1; &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; &lt;STRONG&gt;&lt;EM&gt;low bit&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt; } B;&lt;BR /&gt; struct {&lt;BR /&gt; vuint32_t :16;&lt;BR /&gt; vuint32_t RW : 1;&lt;BR /&gt; vuint32_t ADR : 6;&lt;BR /&gt; vuint32_t P : 1;&lt;BR /&gt; vuint32_t BYTE_FIELD : 8;&lt;BR /&gt; } Bytes;&lt;BR /&gt;} INIT_VREG_Tx_32B_tag;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what`s right ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Think you!&lt;/P&gt;&lt;P&gt;Clipping&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 20 Aug 2017 06:20:57 GMT</pubDate>
    <dc:creator>pingli</dc:creator>
    <dc:date>2017-08-20T06:20:57Z</dc:date>
    <item>
      <title>5744P LIB union struct</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/5744P-LIB-union-struct/m-p/701946#M1718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,NXP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I have a qustion for S32DS 5744P lib about C union struct 。&lt;/P&gt;&lt;P&gt;C language:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_8.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/26914i358F7FFE6597AFC6/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_8.png" alt="pastedImage_8.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In 5744P lib &amp;nbsp;:&lt;/P&gt;&lt;P&gt;typedef union { ///INIT_VREG_Tx&lt;BR /&gt; vuint32_t R;&lt;BR /&gt; struct {&lt;BR /&gt; vuint32_t :16; &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; &lt;STRONG&gt;&lt;EM&gt;high bit&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt; vuint32_t RW : 1;&lt;BR /&gt; vuint32_t ADR : 6;&lt;BR /&gt; vuint32_t P : 1;&lt;BR /&gt; vuint32_t ICCA_LIM : 1;&lt;BR /&gt; vuint32_t TCCA_LIM_OFF : 1;&lt;BR /&gt; vuint32_t IPFF_DIS : 1;&lt;BR /&gt; vuint32_t VCAN_OV_MON : 1;&lt;BR /&gt; vuint32_t : 1;&lt;BR /&gt; vuint32_t TAUX_LIM_OFF : 1;&lt;BR /&gt; vuint32_t VAUX_TRK_EN : 1;&lt;BR /&gt; vuint32_t : 1; &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; &lt;STRONG&gt;&lt;EM&gt;low bit&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt; } B;&lt;BR /&gt; struct {&lt;BR /&gt; vuint32_t :16;&lt;BR /&gt; vuint32_t RW : 1;&lt;BR /&gt; vuint32_t ADR : 6;&lt;BR /&gt; vuint32_t P : 1;&lt;BR /&gt; vuint32_t BYTE_FIELD : 8;&lt;BR /&gt; } Bytes;&lt;BR /&gt;} INIT_VREG_Tx_32B_tag;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what`s right ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Think you!&lt;/P&gt;&lt;P&gt;Clipping&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Aug 2017 06:20:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/5744P-LIB-union-struct/m-p/701946#M1718</guid>
      <dc:creator>pingli</dc:creator>
      <dc:date>2017-08-20T06:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: 5744P LIB union struct</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/5744P-LIB-union-struct/m-p/701947#M1719</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 created a simple test case and I can see the bitfields respects the same endianess in both cases:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/30405i4FAA7EE362D882EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please send us the example project for analysis if it still does not match on your side?&lt;/P&gt;&lt;P&gt;Please check this posts related to reversing bitfield allocation:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/message/929337"&gt;https://community.nxp.com/message/929337&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Aug 2017 13:11:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/5744P-LIB-union-struct/m-p/701947#M1719</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2017-08-22T13:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: 5744P LIB union struct</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/5744P-LIB-union-struct/m-p/701948#M1720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello，Stanislav&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think he want to the order of&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;bitfields. Is it means for vuint32_t data the order is from high side to low side?For vuint16_t data, the order is from low side to high side? I am not sure. Could you help me?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Regards!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Xinyu&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2017 00:53:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/5744P-LIB-union-struct/m-p/701948#M1720</guid>
      <dc:creator>q333444ew</dc:creator>
      <dc:date>2017-08-23T00:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: 5744P LIB union struct</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/5744P-LIB-union-struct/m-p/701949#M1721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The order of items in bitfields is the same regardless of vuint32_t or vuint16_t data type.&lt;/P&gt;&lt;P&gt;First item in the bitfield definition is the most significant bit regardless of its name.&lt;/P&gt;&lt;P&gt;So if you set just the first bit of the structure and read it back as uint16_t value you get value 0x8000.&lt;/P&gt;&lt;P&gt;For uint32 the value is 0x80000000.&lt;/P&gt;&lt;P&gt;For more info about data representation on PowerPC I'd recommend you to see "Data Representation" chapter in this document:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.nxp.com/docs/en/reference-manual/E500ABIUG.pdf" title="http://www.nxp.com/docs/en/reference-manual/E500ABIUG.pdf"&gt;http://www.nxp.com/docs/en/reference-manual/E500ABIUG.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps,&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2017 13:39:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/5744P-LIB-union-struct/m-p/701949#M1721</guid>
      <dc:creator>stanish</dc:creator>
      <dc:date>2017-08-23T13:39:11Z</dc:date>
    </item>
  </channel>
</rss>

