<?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>LPC MicrocontrollersのトピックRe: LPC55xx SDK: usb driver not working with compiling optimization -O2</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55xx-SDK-usb-driver-not-working-with-compiling-optimization/m-p/1947456#M56789</link>
    <description>Hi @sagid&lt;BR /&gt;I had a similar problem with USB and O2 optimization and was able to solve it.&lt;BR /&gt;Please take a look at this topic.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers/LPC55s28-SDK-USB-example-are-not-working-with-O2-optimization/m-p/1870128#M56117" target="_blank"&gt;https://community.nxp.com/t5/LPC-Microcontrollers/LPC55s28-SDK-USB-example-are-not-working-with-O2-optimization/m-p/1870128#M56117&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 04 Sep 2024 16:57:10 GMT</pubDate>
    <dc:creator>emblink182</dc:creator>
    <dc:date>2024-09-04T16:57:10Z</dc:date>
    <item>
      <title>LPC55xx SDK: usb driver not working with compiling optimization -O2</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55xx-SDK-usb-driver-not-working-with-compiling-optimization/m-p/1290515#M45402</link>
      <description>&lt;P&gt;I downloaded&amp;nbsp;SDK_2.9.1_LPCXpresso55S69 from&amp;nbsp;MCUXpresso SDK Builder, target board LPC55S69 EVK.&lt;/P&gt;&lt;P&gt;From SDK I imported usb device example:&amp;nbsp;lpcxpresso55s69_dev_cdc_vcom_bm, the example is working as expected but if compile optimization is set to O2 then the demo doesn't work.&lt;/P&gt;&lt;P&gt;someone has some idea how to make usb device driver works even with max compile optimization?&lt;/P&gt;&lt;P&gt;I attached dev_cdc_vcom_bm example as reference.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-Carlos&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 07:23:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55xx-SDK-usb-driver-not-working-with-compiling-optimization/m-p/1290515#M45402</guid>
      <dc:creator>cgarcia</dc:creator>
      <dc:date>2021-06-10T07:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55xx SDK: usb driver not working with compiling optimization -O2</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55xx-SDK-usb-driver-not-working-with-compiling-optimization/m-p/1291651#M45449</link>
      <description>&lt;P&gt;I found the issue in usb example demo coming form&amp;nbsp;&lt;SPAN&gt;SDK_2.9.1_LPCXpresso55S69.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;At initialization there is the following code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;/* enable usb0 host clock */&lt;BR /&gt;CLOCK_EnableClock(kCLOCK_Usbhsl0);&lt;BR /&gt;/*According to reference mannual, device mode setting has to be set by access usb host register */&lt;BR /&gt;*((uint32_t *)(USBFSH_BASE + 0x5c)) |= USBFSH_PORTMODE_DEV_ENABLE_MASK;&lt;BR /&gt;/* disable usb0 host clock */&lt;BR /&gt;CLOCK_DisableClock(kCLOCK_Usbhsl0);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;it looks to be a WA, this section of code looks to be not a good practice programming therefore optimized code is not doing exactly&amp;nbsp;what is expected to do. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The solution I found:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;volatile uint32_t usbfsh_offset=0x5c;&lt;BR /&gt;/* enable usb0 host clock */&lt;BR /&gt;CLOCK_EnableClock(kCLOCK_Usbhsl0);&lt;BR /&gt;/*According to reference mannual, device mode setting has to be set by access usb host register */&lt;BR /&gt;*((uint32_t *)(USBFSH_BASE + usbfsh_offset)) |= USBFSH_PORTMODE_DEV_ENABLE_MASK;&lt;BR /&gt;/* disable usb0 host clock */&lt;BR /&gt;CLOCK_DisableClock(kCLOCK_Usbhsl0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a lot of examples applying same WA as bad practice of coding at&amp;nbsp;SDK_2.9.1_LPCXpresso55S69/boards/lpcxpresso55s69/usb_examples.&lt;/P&gt;&lt;P&gt;I hope this contributes to NXP team and take it for consideration for demo quality.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jun 2021 22:41:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55xx-SDK-usb-driver-not-working-with-compiling-optimization/m-p/1291651#M45449</guid>
      <dc:creator>cgarcia</dc:creator>
      <dc:date>2021-06-12T22:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55xx SDK: usb driver not working with compiling optimization -O2</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55xx-SDK-usb-driver-not-working-with-compiling-optimization/m-p/1817761#M55518</link>
      <description>Thanks cgarcia for the solution, you saved a lot of my time!</description>
      <pubDate>Wed, 28 Feb 2024 18:19:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55xx-SDK-usb-driver-not-working-with-compiling-optimization/m-p/1817761#M55518</guid>
      <dc:creator>emblink182</dc:creator>
      <dc:date>2024-02-28T18:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55xx SDK: usb driver not working with compiling optimization -O2</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55xx-SDK-usb-driver-not-working-with-compiling-optimization/m-p/1947131#M56783</link>
      <description>&lt;P&gt;Hi, Greetings.&lt;BR /&gt;I'm using an LPC5516 for my project, which also makes use of HS-USB.&lt;BR /&gt;USB was operational at first, and there was no optimisation level.&lt;BR /&gt;After that, I adjusted the optimisation level to O2, and it was functioning as well.&lt;BR /&gt;Following my transition to O2, I made a single code modification: I commented out a debug PRINTF in a different file that has nothing to do with USB. Suddenly, USB stopped working, meaning Device Manager could not recognise it.&lt;BR /&gt;Reverting to the previous modification made the USB working.&lt;/P&gt;&lt;P&gt;Would someone kindly assist me in solving this issue?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 09:56:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55xx-SDK-usb-driver-not-working-with-compiling-optimization/m-p/1947131#M56783</guid>
      <dc:creator>sajid</dc:creator>
      <dc:date>2024-09-04T09:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55xx SDK: usb driver not working with compiling optimization -O2</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55xx-SDK-usb-driver-not-working-with-compiling-optimization/m-p/1947456#M56789</link>
      <description>Hi @sagid&lt;BR /&gt;I had a similar problem with USB and O2 optimization and was able to solve it.&lt;BR /&gt;Please take a look at this topic.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers/LPC55s28-SDK-USB-example-are-not-working-with-O2-optimization/m-p/1870128#M56117" target="_blank"&gt;https://community.nxp.com/t5/LPC-Microcontrollers/LPC55s28-SDK-USB-example-are-not-working-with-O2-optimization/m-p/1870128#M56117&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Sep 2024 16:57:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55xx-SDK-usb-driver-not-working-with-compiling-optimization/m-p/1947456#M56789</guid>
      <dc:creator>emblink182</dc:creator>
      <dc:date>2024-09-04T16:57:10Z</dc:date>
    </item>
  </channel>
</rss>

