<?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>MQX Software SolutionsのトピックRe: USB MSC writing complete event</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSC-writing-complete-event/m-p/390541#M13038</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;You need to implement something like the disk example that you can find at the path C:\Freescale\Freescale_MQX_4_1\usb\device\examples\msd&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Please check the Bulk_Transaction_Callback function in disk.c&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #7f0055;"&gt;case&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; USB_APP_DATA_RECEIVED :&lt;/SPAN&gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;/* Add User defined code -- if required*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt; Sol &lt;BR /&gt; &lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Dec 2014 20:57:10 GMT</pubDate>
    <dc:creator>soledad</dc:creator>
    <dc:date>2014-12-05T20:57:10Z</dc:date>
    <item>
      <title>USB MSC writing complete event</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSC-writing-complete-event/m-p/390540#M13037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using USB MSC driver, is there a way to know when writing to a file is complete?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In usb_msc.c, function USB_Service_Bulk_Out(), there'a control on remaining transfer size&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14176894609479010" jivemacro_uid="_14176894609479010"&gt;
&lt;P&gt;event_type = (uint_8)(msc_obj_ptr-&amp;gt;transfer_remaining?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USB_MSC_DEVICE_WRITE_REQUEST : USB_APP_DATA_RECEIVED);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in my callback, usb_bulk_transaction_callback(), I receive multiple USB_MSC_DEVICE_WRITE_REQUEST, as expected, but never a USB_APP_DATA_RECEIVED, which I assume is set to indicate the end of writing. Maybe I didn't understand correctly this driver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Dec 2014 10:48:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSC-writing-complete-event/m-p/390540#M13037</guid>
      <dc:creator>mircopizzichini</dc:creator>
      <dc:date>2014-12-04T10:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: USB MSC writing complete event</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSC-writing-complete-event/m-p/390541#M13038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;You need to implement something like the disk example that you can find at the path C:\Freescale\Freescale_MQX_4_1\usb\device\examples\msd&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Please check the Bulk_Transaction_Callback function in disk.c&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #7f0055;"&gt;case&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: black;"&gt; USB_APP_DATA_RECEIVED :&lt;/SPAN&gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: Consolas; color: #3f7f5f;"&gt;/* Add User defined code -- if required*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt; Sol &lt;BR /&gt; &lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Dec 2014 20:57:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSC-writing-complete-event/m-p/390541#M13038</guid>
      <dc:creator>soledad</dc:creator>
      <dc:date>2014-12-05T20:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Re: USB MSC writing complete event</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSC-writing-complete-event/m-p/390542#M13039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sol, thank you for your response&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've already tried as you suggest, adding (for example) a LED blinking in the USB_APP_DATA_RECEIVED case in my Bulk_Transaction_Callback function, but I think this event is never sent because LED does not blink.&lt;/P&gt;&lt;P&gt;So I've also put a breakpoint in the usb_msc.c function (USB_Service_Bulk_Out) sending this event, but it's never asserted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the problem is in file usb_msc.c: remaining transfer size is decremented (line 446) after the event transmission (line 422), so USB_APP_DATA_RECEIVED can never be asserted.&lt;/P&gt;&lt;P&gt;I moved&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14181990216579851" jivemacro_uid="_14181990216579851"&gt;
&lt;P&gt;msc_obj_ptr-&amp;gt;param_callback.callback(USB_APP_DATA_RECEIVED, (void*)&amp;amp;bulk_out_recv, msc_obj_ptr-&amp;gt;param_callback.arg);&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on line 474, when transfer is complete and the end of data phase is completed, and now it works. Could it be rigth?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now transfer is correctly done and reported by the previous event, but with a "sd dir" I cannot see the new file in the memory. Is there a way to refresh (maybe) filesystem to see the new file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Mirco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 08:13:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/USB-MSC-writing-complete-event/m-p/390542#M13039</guid>
      <dc:creator>mircopizzichini</dc:creator>
      <dc:date>2014-12-10T08:13:21Z</dc:date>
    </item>
  </channel>
</rss>

