<?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のトピックnot able to use USBD mass-storage on LPC1778</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/not-able-to-use-USBD-mass-storage-on-LPC1778/m-p/651132#M25880</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried to use USBD Mass-storage on LPC1778 by adapting project-example 'usbd_rom_msc_sdmmc' of lpcopen 2.18, lpcxpresso lpc1837.&lt;/P&gt;&lt;P&gt;Actual read files from SD-Card-Interface on LPC1778 over USB (Host Windows PC) works normal, but any try to write data on SD-Card only generates corrupt data on SD-Card.&lt;/P&gt;&lt;P&gt;Finally I found possible reason at field 'uint8_t BulkStage' (in struct 'USB_MSC_CTRL_T', in file '&lt;SPAN class=""&gt;&lt;A href="http://docs.lpcware.com/usbromlib/v1.0/mw__usbd__mscuser_8h.html"&gt;mw_usbd/mw_usbd_mscuser.h&lt;/A&gt;&lt;/SPAN&gt;'), it's only read by user program, but possible never changed by 'usbd_177x_8x_lib'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is any documentation available how to use field 'uint8_t BulkStage' here for my application ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Oct 2016 13:46:40 GMT</pubDate>
    <dc:creator>walm_nxp</dc:creator>
    <dc:date>2016-10-19T13:46:40Z</dc:date>
    <item>
      <title>not able to use USBD mass-storage on LPC1778</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/not-able-to-use-USBD-mass-storage-on-LPC1778/m-p/651132#M25880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried to use USBD Mass-storage on LPC1778 by adapting project-example 'usbd_rom_msc_sdmmc' of lpcopen 2.18, lpcxpresso lpc1837.&lt;/P&gt;&lt;P&gt;Actual read files from SD-Card-Interface on LPC1778 over USB (Host Windows PC) works normal, but any try to write data on SD-Card only generates corrupt data on SD-Card.&lt;/P&gt;&lt;P&gt;Finally I found possible reason at field 'uint8_t BulkStage' (in struct 'USB_MSC_CTRL_T', in file '&lt;SPAN class=""&gt;&lt;A href="http://docs.lpcware.com/usbromlib/v1.0/mw__usbd__mscuser_8h.html"&gt;mw_usbd/mw_usbd_mscuser.h&lt;/A&gt;&lt;/SPAN&gt;'), it's only read by user program, but possible never changed by 'usbd_177x_8x_lib'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is any documentation available how to use field 'uint8_t BulkStage' here for my application ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 13:46:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/not-able-to-use-USBD-mass-storage-on-LPC1778/m-p/651132#M25880</guid>
      <dc:creator>walm_nxp</dc:creator>
      <dc:date>2016-10-19T13:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: not able to use USBD mass-storage on LPC1778</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/not-able-to-use-USBD-mass-storage-on-LPC1778/m-p/651133#M25881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mandred,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have you registered an endpoint handler for bulk in endpoint? How did you configure mscDisk_init function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you checked mscDisk_init function you will notice that callback for writing is already set:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;msc_param.MSC_Write = translate_wr;‍&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but also, you will need to add an endpoint handler for IN transactions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt; if (USBD_API-&amp;gt;version &amp;gt; 0x01111101) { /* New ROM stack version */
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; default_bulk_in_hdlr = pCtrl-&amp;gt;ep_event_hdlr[((((USB_MSC_CTRL_T *) g_pMscCtrl)-&amp;gt;epin_num &amp;amp; 0x0F) &amp;lt;&amp;lt; 1) + 1];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; default_bulk_out_hdlr = pCtrl-&amp;gt;ep_event_hdlr[(((USB_MSC_CTRL_T *) g_pMscCtrl)-&amp;gt;epout_num &amp;amp; 0x0F) &amp;lt;&amp;lt; 1];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USBD_API-&amp;gt;core-&amp;gt;RegisterEpHandler(hUsb,(((USB_MSC_CTRL_T *) g_pMscCtrl)-&amp;gt;epout_num &amp;amp; 0x0F) &amp;lt;&amp;lt; 1, app_bulk_out_hdlr, g_pMscCtrl);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USBD_API-&amp;gt;core-&amp;gt;RegisterEpHandler(hUsb,((((USB_OLD_MSC_CTRL_T *) g_pMscCtrl)-&amp;gt;epin_num &amp;amp; 0x0F) &amp;lt;&amp;lt; 1) + 1, app_bulk_in_hdlr, g_pMscCtrl);
&amp;nbsp;&amp;nbsp;&amp;nbsp; } else { /* Old ROM stack version */
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; default_bulk_in_hdlr = pCtrl-&amp;gt;ep_event_hdlr[((((USB_MSC_CTRL_T *) g_pMscCtrl)-&amp;gt;epin_num&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp; 0x0F) &amp;lt;&amp;lt; 1) + 1];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; default_bulk_out_hdlr = pCtrl-&amp;gt;ep_event_hdlr[(((USB_OLD_MSC_CTRL_T *) g_pMscCtrl)-&amp;gt;epout_num &amp;amp; 0x0F) &amp;lt;&amp;lt; 1];
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USBD_API-&amp;gt;core-&amp;gt;RegisterEpHandler(hUsb,&amp;nbsp;&amp;nbsp;&amp;nbsp; (((USB_OLD_MSC_CTRL_T *) g_pMscCtrl)-&amp;gt;epout_num &amp;amp; 0x0F) &amp;lt;&amp;lt; 1, app_bulk_out_hdlr, g_pMscCtrl);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USBD_API-&amp;gt;core-&amp;gt;RegisterEpHandler(hUsb, ((((USB_OLD_MSC_CTRL_T *) g_pMscCtrl)-&amp;gt;epin_num &amp;amp; 0x0F) &amp;lt;&amp;lt; 1) + 1, app_bulk_in_hdlr, g_pMscCtrl);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, in app_bulk_in_hdlr, you can replicate what it is done for app_bulk_out_hdlr only replacing the OUT endpoint reference for IN endpoint reference.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;How are you handling these callbacks?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2016 22:41:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/not-able-to-use-USBD-mass-storage-on-LPC1778/m-p/651133#M25881</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-10-28T22:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: not able to use USBD mass-storage on LPC1778</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/not-able-to-use-USBD-mass-storage-on-LPC1778/m-p/651134#M25882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found mistake in my program in function app_bulk_out_hdlr(). I didn't check variable 'BulkStage' (Bulk Stage) in correct way.&lt;/P&gt;&lt;P&gt;Now USBD Mass-storage on LPC1778 is working normal for read and write.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for assistance&lt;/P&gt;&lt;P&gt;Manfred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2016 06:43:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/not-able-to-use-USBD-mass-storage-on-LPC1778/m-p/651134#M25882</guid>
      <dc:creator>walm_nxp</dc:creator>
      <dc:date>2016-11-04T06:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: not able to use USBD mass-storage on LPC1778</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/not-able-to-use-USBD-mass-storage-on-LPC1778/m-p/651135#M25883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Manfred,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the same (well, similar) thing recently, but didn't get as far as writing to the card because I found that every time I right clicked on the mounted drive in Windows Explorer and selected "Eject", I got an error (ported to the Embedded Artists LPC1788 Development Kit). I also found exactly the same using the actual LPC18S37 version on an OM13076 board with OM13082 general purpose board attached (once I'd fixed the wiring on it!).&lt;/P&gt;&lt;P&gt;Have you seen this issue? I couldn't see any obvious solution but I'm quite new to USB and LPC stuff.&amp;nbsp;&lt;/P&gt;&lt;P&gt;John&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Apr 2018 22:38:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/not-able-to-use-USBD-mass-storage-on-LPC1778/m-p/651135#M25883</guid>
      <dc:creator>jmccabe</dc:creator>
      <dc:date>2018-04-07T22:38:02Z</dc:date>
    </item>
  </channel>
</rss>

