<?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: LPCUSBlib + FatFS + USB Write Error while powering down periodically in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCUSBlib-FatFS-USB-Write-Error-while-powering-down-periodically/m-p/891844#M35755</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Felipe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I power down the USB by disabling the 12th bit(Port power control) of the&amp;nbsp;PORTSC1_H register(Port 1 status/control (host mode)).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used the "lpcusblib" for the USB functions and for the file system I use the FatFS (&lt;A href="http://elm-chan.org/"&gt;http://elm-chan.org&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the last file transfer, I wait another 1 minute before turning off the USB power. I assume, that might be sufficient to complete the file data write.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not happening to every USB device. Is it related to any cache memory? Is there any function to flush the USB cache?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Tojo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 May 2019 14:22:45 GMT</pubDate>
    <dc:creator>tojo_thomas</dc:creator>
    <dc:date>2019-05-17T14:22:45Z</dc:date>
    <item>
      <title>LPCUSBlib + FatFS + USB Write Error while powering down periodically</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCUSBlib-FatFS-USB-Write-Error-while-powering-down-periodically/m-p/891842#M35753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;STRONG style="color: black; "&gt;Hi,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;STRONG style="color: black; "&gt;I have been using LPCUSBlib and FatFS in my project to support USB as a host. In my project, I store data to the USB device periodically. It was working smooth until I introduce a power save option.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;STRONG style="color: black; "&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;STRONG style="color: black; "&gt;I tried to power down the USB when it is not in use. It saved me a lot of power conception. I was happy, and it looked working but some USB devices doesn’t like this power down. I found data loss on these USB’s. I loss the data which I write to the last file.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;STRONG style="color: black; "&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;STRONG style="color: black; "&gt;Starting Up&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; color: black;"&gt;Create folder1-&amp;gt;file1 and write some data &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; color: black;"&gt;Create folder2-&amp;gt;file2 and write some data &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; color: black;"&gt;Create folder3-&amp;gt;file3 and write some data&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;STRONG style="color: black; "&gt;Power Down the USB&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; color: black;"&gt;...&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;STRONG style="color: black; "&gt;Power Up the USB &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; color: black;"&gt;Append some data to folder1-&amp;gt;file1 &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; color: black;"&gt;Append some data to folder2-&amp;gt;file2 &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; color: black;"&gt;Append some data to folder3-&amp;gt;file3&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;STRONG style="color: black; "&gt;Power Down the USB&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: black; font-size: 15px; "&gt;When I check the files, data in the file3 found missing.&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 15px; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: black; font-size: 15px; "&gt;Any help is appreciated.&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: black; font-size: 15px; "&gt;Thanks in advance.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 May 2019 11:32:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPCUSBlib-FatFS-USB-Write-Error-while-powering-down-periodically/m-p/891842#M35753</guid>
      <dc:creator>tojo_thomas</dc:creator>
      <dc:date>2019-05-13T11:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: LPCUSBlib + FatFS + USB Write Error while powering down periodically</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCUSBlib-FatFS-USB-Write-Error-while-powering-down-periodically/m-p/891843#M35754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please describe how are you powering down the USB module?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, which software example are you working on?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please make sure you have finished writing data in the file 3 before you power down the USB module? I believe the transmission was on the run and it didn’t finished correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2019 21:34:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPCUSBlib-FatFS-USB-Write-Error-while-powering-down-periodically/m-p/891843#M35754</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2019-05-16T21:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: LPCUSBlib + FatFS + USB Write Error while powering down periodically</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCUSBlib-FatFS-USB-Write-Error-while-powering-down-periodically/m-p/891844#M35755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Felipe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I power down the USB by disabling the 12th bit(Port power control) of the&amp;nbsp;PORTSC1_H register(Port 1 status/control (host mode)).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used the "lpcusblib" for the USB functions and for the file system I use the FatFS (&lt;A href="http://elm-chan.org/"&gt;http://elm-chan.org&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the last file transfer, I wait another 1 minute before turning off the USB power. I assume, that might be sufficient to complete the file data write.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not happening to every USB device. Is it related to any cache memory? Is there any function to flush the USB cache?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Tojo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2019 14:22:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPCUSBlib-FatFS-USB-Write-Error-while-powering-down-periodically/m-p/891844#M35755</guid>
      <dc:creator>tojo_thomas</dc:creator>
      <dc:date>2019-05-17T14:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: LPCUSBlib + FatFS + USB Write Error while powering down periodically</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCUSBlib-FatFS-USB-Write-Error-while-powering-down-periodically/m-p/891845#M35756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tojo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The USB power consumption can be controlled by disabling the USB clocks and disabling&lt;/P&gt;&lt;P&gt;the High-speed PHY.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can send your USB module to a low power suspended state. You can enter this state by setting PORTSC1.PHCD bit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I recommend you to check chapter 23.12 of the User Manual for further information regarding USB suspended state.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this information helps you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 May 2019 15:01:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPCUSBlib-FatFS-USB-Write-Error-while-powering-down-periodically/m-p/891845#M35756</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2019-05-20T15:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: LPCUSBlib + FatFS + USB Write Error while powering down periodically</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPCUSBlib-FatFS-USB-Write-Error-while-powering-down-periodically/m-p/891846#M35757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Hi Felipe,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thank you so much.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;I will go through the manual.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thanks again for the information.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Kind Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Tojo&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 May 2019 16:36:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPCUSBlib-FatFS-USB-Write-Error-while-powering-down-periodically/m-p/891846#M35757</guid>
      <dc:creator>tojo_thomas</dc:creator>
      <dc:date>2019-05-20T16:36:49Z</dc:date>
    </item>
  </channel>
</rss>

