<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>USB mass storage connect-disconnect handling in STM32429-I Eval running Keil MDK5 USB host stack.</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/41165/usb-mass-storage-connect-disconnect-handling-in-stm32429-i-eval-running-keil-mdk5-usb-host-stack</link><description> 
Hi all, 

 
I am a newbie in Keil MDK. I am trying to run some file operations
from a USB mass storage connected to my STM32429-i evaluation board.
I am using CMSIS RTOS and CMSIS compliant peripheral drivers.
Referring the following link: http://www</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: USB mass storage connect-disconnect handling in STM32429-I Eval running Keil MDK5 USB host stack.</title><link>https://community.arm.com/thread/108603?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 02:11:27 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c9b018be-a3b3-44e9-8f6d-5f1736455b2f</guid><dc:creator>Milorad Cvjetkovic</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi, can you provide more info:&lt;/p&gt;

&lt;p&gt;
- which microcontroller and board are you using (board custom or
commercial evaluation board)?&lt;br /&gt;
- which MDK version?&lt;br /&gt;
- which middleware version?&lt;br /&gt;
- which device pack and which version?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB mass storage connect-disconnect handling in STM32429-I Eval running Keil MDK5 USB host stack.</title><link>https://community.arm.com/thread/82992?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2016 13:40:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:99062e65-5c7b-4738-9adb-3ec2a2d22271</guid><dc:creator>Giardino Michele</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi,&lt;br /&gt;
Same problem,&lt;br /&gt;
the thread deadlock when I unplug my usb during fread() or
fwrite()&lt;br /&gt;
any solution ?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB mass storage connect-disconnect handling in STM32429-I Eval running Keil MDK5 USB host stack.</title><link>https://community.arm.com/thread/82993?ContentTypeID=1</link><pubDate>Wed, 06 Jan 2016 21:38:16 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4cc96676-5b6c-4b57-944e-f89d52d06600</guid><dc:creator>Honey S</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi,&lt;br /&gt;
Thank you for your response. I understood the point. But in my test
application, I have checked for return values and error status for
most of the file system related calls like fopen(), fread() except
for fseek() and fclose(). Even at one instant, I got my debug log for
ferror(FP) check after fread() when USB is disconnected. But all the
other times, it is hung when USB disconnected while fread() happens
[Verifying this via debug logs only]. One thing is my fread is for
32Kb bytes read every-time. Do you think is there any known issue of
things like this while fread is going on and the device underneath is
disconnected, how fread() will behave? Under all cases, does it
recover instantly?&lt;/p&gt;

&lt;p&gt;
Thank you,&lt;br /&gt;
Honey S&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB mass storage connect-disconnect handling in STM32429-I Eval running Keil MDK5 USB host stack.</title><link>https://community.arm.com/thread/64388?ContentTypeID=1</link><pubDate>Wed, 06 Jan 2016 04:56:08 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8f81342f-7e6e-4211-8e55-f98019502746</guid><dc:creator>Milorad Cvjetkovic</dc:creator><description>&lt;p&gt;&lt;p&gt;
Generally, you should check return values of file system functions
for example Keil&amp;#39;s standard USB Host with File System example
\Middleware\USB\Host\MassStorage\ example uses fgetc function for
reading file and this function specifies that if an error (such as no
media because of disconnect) occurred it returns EOF.&lt;br /&gt;
Also, this example terminates the file read when EOF is returned and
if USB stick is reconnected file can be accessed again.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>