<?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: union value issue in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/union-value-issue/m-p/790230#M3203</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Erich,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;I think it could be something about union settings. Even I set the union variable to be global, it happen this error again:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Could you tell me where to set the union or the data type setting?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thanks.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Jul 2018 08:16:24 GMT</pubDate>
    <dc:creator>赵子成</dc:creator>
    <dc:date>2018-07-10T08:16:24Z</dc:date>
    <item>
      <title>union value issue</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/union-value-issue/m-p/790228#M3201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I use S32K146, I define a union type variable as follow:&lt;/P&gt;&lt;P&gt;typedef union unCanFrameData&lt;BR /&gt;{&lt;BR /&gt; UINT8 u8Data[CAN_FRAME_DATA_LEN]; ///&amp;lt; 8 uint8 data&lt;BR /&gt; UINT16 u16Data[4]; ///&amp;lt; 4&amp;nbsp;&lt;SPAN&gt;uint16 data&lt;/SPAN&gt;&lt;BR /&gt; UINT32 u32Data[2]; ///&amp;lt; 2&amp;nbsp;&lt;SPAN&gt;uint32 data&lt;/SPAN&gt;&lt;BR /&gt;}UN_CAN_FRAME_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I set the&amp;nbsp;&lt;SPAN&gt;u16Data[2]:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;unData.u16Data[2] = 2000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I get the follow result:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&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/65036i35CDC0F486901E63/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The problem is that the&amp;nbsp;u16Data[2] is 2000, but the&amp;nbsp;u8Data[4] and&amp;nbsp;u8Data[5] is 0, the data is not&amp;nbsp;Coincident.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can anyone help me? Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jul 2018 08:05:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/union-value-issue/m-p/790228#M3201</guid>
      <dc:creator>赵子成</dc:creator>
      <dc:date>2018-07-07T08:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: union value issue</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/union-value-issue/m-p/790229#M3202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I quickly tried that, but I get a reasonable result:&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/65049i7AAA10676E111926/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;with&lt;/P&gt;&lt;P&gt;&amp;nbsp; typedef uint8_t UINT8;&lt;BR /&gt;&amp;nbsp; typedef uint16_t UINT16;&lt;BR /&gt;&amp;nbsp; typedef uint32_t UINT32;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define CAN_FRAME_DATA_LEN 8&lt;BR /&gt;&amp;nbsp; typedef union unCanFrameData&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp; UINT8 u8Data[CAN_FRAME_DATA_LEN]; ///&amp;lt; 8 uint8 data&lt;BR /&gt;&amp;nbsp; UINT16 u16Data[4]; ///&amp;lt; 4 uint16 data&lt;BR /&gt;&amp;nbsp; UINT32 u32Data[2]; ///&amp;lt; 2 uint32 data&lt;BR /&gt;&amp;nbsp; }UN_CAN_FRAME_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;unData.u16Data[2] = 2000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe it could be some compiler settings you are using (can you share a small example project)?&lt;/P&gt;&lt;P&gt;I used the S32K144 (don't think it matters), but can you check that 0x2000'ef58 you indeed have RAM?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Jul 2018 18:22:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/union-value-issue/m-p/790229#M3202</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2018-07-08T18:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: union value issue</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/union-value-issue/m-p/790230#M3203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Erich,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;I think it could be something about union settings. Even I set the union variable to be global, it happen this error again:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Could you tell me where to set the union or the data type setting?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thanks.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2018 08:16:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/union-value-issue/m-p/790230#M3203</guid>
      <dc:creator>赵子成</dc:creator>
      <dc:date>2018-07-10T08:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: union value issue</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/union-value-issue/m-p/790231#M3204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,I'm&amp;nbsp;Chinese people，if you too,can you tell me your qq&amp;nbsp;number，I'd like to ask you some questions。thank you so mach.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2018 09:06:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/union-value-issue/m-p/790231#M3204</guid>
      <dc:creator>1642280511</dc:creator>
      <dc:date>2018-07-11T09:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: union value issue</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/union-value-issue/m-p/790232#M3205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am sorry. I didn't use QQ.&lt;/P&gt;&lt;P&gt;I you would, you can ask me via this platform.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2018 15:54:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/union-value-issue/m-p/790232#M3205</guid>
      <dc:creator>赵子成</dc:creator>
      <dc:date>2018-07-11T15:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: union value issue</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/union-value-issue/m-p/790233#M3206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erich.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have solved this issue.&lt;/P&gt;&lt;P&gt;The root is that I define UINT16 as&amp;nbsp;unsigned int.&lt;/P&gt;&lt;P&gt;In S32K CPU,&amp;nbsp;&lt;SPAN&gt;unsigned int is 4 bytes long. Not 2 bytes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This make the union alain failure.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2018 15:57:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/union-value-issue/m-p/790233#M3206</guid>
      <dc:creator>赵子成</dc:creator>
      <dc:date>2018-07-11T15:57:58Z</dc:date>
    </item>
  </channel>
</rss>

