<?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: USB SDK STRUCT_UNPACKED in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/USB-SDK-STRUCT-UNPACKED/m-p/1583825#M51291</link>
    <description>&lt;P&gt;Perhaps this only potentially becomes a problem when using different platforms or different toolchains in a&amp;nbsp; project/system.&lt;BR /&gt;And affected users don't lament loud enough ...&lt;/P&gt;</description>
    <pubDate>Tue, 17 Jan 2023 08:56:05 GMT</pubDate>
    <dc:creator>frank_m</dc:creator>
    <dc:date>2023-01-17T08:56:05Z</dc:date>
    <item>
      <title>USB SDK STRUCT_UNPACKED</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/USB-SDK-STRUCT-UNPACKED/m-p/970652#M38411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In usb_misc.h, STRUCT_UNPACKED is defined as follows.&lt;/P&gt;&lt;PRE&gt;#if defined(__ICCARM__)

#ifndef STRUCT_PACKED
#define STRUCT_PACKED __packed
#endif

#ifndef STRUCT_UNPACKED
#define STRUCT_UNPACKED
#endif

#elif defined(__GNUC__)

&lt;SPAN style="color: #ff0000;"&gt;#ifndef STRUCT_PACKED&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;#define STRUCT_PACKED&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;#endif&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;#ifndef STRUCT_UNPACKED&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;#define STRUCT_UNPACKED __attribute__((__packed__))&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;#endif&lt;/SPAN&gt;

#elif defined(__CC_ARM) || (defined(__ARMCC_VERSION))

#ifndef STRUCT_PACKED
#define STRUCT_PACKED _Pragma("pack(1U)")
#endif

#ifndef STRUCT_UNPACKED
#define STRUCT_UNPACKED _Pragma("pack()")
#endif

#endif&lt;/PRE&gt;&lt;P&gt;Is the definition for __GNUC__ wrong? I expected STRUCT_PACKED to be __attribute__((__packed__)) instead of the other way around, i.e.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;#ifndef STRUCT_PACKED&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;#define STRUCT_PACKED&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt; __attribute__((__packed__))&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;#endif&lt;/SPAN&gt;

&lt;SPAN style="color: #ff0000;"&gt;#ifndef STRUCT_UNPACKED&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;#define STRUCT_UNPACKED&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;#endif&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2019 22:46:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/USB-SDK-STRUCT-UNPACKED/m-p/970652#M38411</guid>
      <dc:creator>rex_lam</dc:creator>
      <dc:date>2019-06-10T22:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: USB SDK STRUCT_UNPACKED</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/USB-SDK-STRUCT-UNPACKED/m-p/970653#M38412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We don't have any issue regarding this, however, we will check it internally. Thank you for your feedback,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;Soledad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2019 14:39:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/USB-SDK-STRUCT-UNPACKED/m-p/970653#M38412</guid>
      <dc:creator>soledad</dc:creator>
      <dc:date>2019-06-24T14:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: USB SDK STRUCT_UNPACKED</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/USB-SDK-STRUCT-UNPACKED/m-p/1582778#M51276</link>
      <description>Years pass - and SDK_2_11_1_MIMXRT1052xxxxB pack still contains this old described error in the "usb_misc.h" file. What is your reason?</description>
      <pubDate>Sun, 15 Jan 2023 13:01:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/USB-SDK-STRUCT-UNPACKED/m-p/1582778#M51276</guid>
      <dc:creator>HSL_AB</dc:creator>
      <dc:date>2023-01-15T13:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: USB SDK STRUCT_UNPACKED</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/USB-SDK-STRUCT-UNPACKED/m-p/1583825#M51291</link>
      <description>&lt;P&gt;Perhaps this only potentially becomes a problem when using different platforms or different toolchains in a&amp;nbsp; project/system.&lt;BR /&gt;And affected users don't lament loud enough ...&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 08:56:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/USB-SDK-STRUCT-UNPACKED/m-p/1583825#M51291</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2023-01-17T08:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: USB SDK STRUCT_UNPACKED</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/USB-SDK-STRUCT-UNPACKED/m-p/1583928#M51293</link>
      <description>While&amp;nbsp;STRUCT_UNPACKED is not used in SDK there is no problem: let assume that nobody will use this #define deliberately &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;</description>
      <pubDate>Tue, 17 Jan 2023 10:59:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/USB-SDK-STRUCT-UNPACKED/m-p/1583928#M51293</guid>
      <dc:creator>HSL_AB</dc:creator>
      <dc:date>2023-01-17T10:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: USB SDK STRUCT_UNPACKED</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/USB-SDK-STRUCT-UNPACKED/m-p/1583959#M51294</link>
      <description>&lt;P&gt;That depends.&lt;/P&gt;&lt;P&gt;In my experience, "packed" structs are often used as overlays for serial data transfer (ethernet, Modbus, USB, CAN) and in data file interpretation.&lt;BR /&gt;In most cases, metadata are embedded in the byte stream, and interpreted via the "packed" overlay structure.&lt;BR /&gt;However, such projects usually included a manual check that the linker-generated struct offsets really matched the intended sizes/offsets.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 12:11:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/USB-SDK-STRUCT-UNPACKED/m-p/1583959#M51294</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2023-01-17T12:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: USB SDK STRUCT_UNPACKED</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/USB-SDK-STRUCT-UNPACKED/m-p/1583962#M51295</link>
      <description>Obviously, "packed" does be widely used, but I assume that little people know about the existence of this particular #define. I hadn't known before. &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;</description>
      <pubDate>Tue, 17 Jan 2023 12:26:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/USB-SDK-STRUCT-UNPACKED/m-p/1583962#M51295</guid>
      <dc:creator>HSL_AB</dc:creator>
      <dc:date>2023-01-17T12:26:52Z</dc:date>
    </item>
  </channel>
</rss>

