<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/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/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nRF52840 SDK16 - USB MSC example - How to check if FAT volume exists</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70570/nrf52840-sdk16---usb-msc-example---how-to-check-if-fat-volume-exists</link><description>Hi everyone, 
 I am working on the USB MSC example. I am able to create files and perform read and write operations. 
 Now what I want is to check if there is a FAT volume when the system restarts. Is there any function for checking this? Because I do</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Jan 2021 14:29:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70570/nrf52840-sdk16---usb-msc-example---how-to-check-if-fat-volume-exists" /><item><title>RE: nRF52840 SDK16 - USB MSC example - How to check if FAT volume exists</title><link>https://devzone.nordicsemi.com/thread/289796?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2021 14:29:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da45b548-22c8-461e-9c14-102c48d88ead</guid><dc:creator>Nikosant03</dc:creator><description>&lt;p&gt;Thank you for your fast support Jorgen!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 SDK16 - USB MSC example - How to check if FAT volume exists</title><link>https://devzone.nordicsemi.com/thread/289792?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2021 14:20:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c19d5be6-8a49-49c4-9544-5b5c830d0c75</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>[quote user="Nikosant03"]Everytime the system reset/restart I have to call the&amp;nbsp;&lt;strong&gt;f_mount()&amp;nbsp;&lt;/strong&gt;function?[/quote]
&lt;p&gt;Yes, if you want to perform any file/directory operations. From the description of the function:&amp;nbsp;&lt;em&gt;&amp;quot;&lt;span&gt;Prior to perform any file/directory operations, a filesystem object needs to be registered with&amp;nbsp;&lt;/span&gt;&lt;tt&gt;f_mount&lt;/tt&gt;&lt;span&gt;&amp;nbsp;function for the logical drive.&amp;quot;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
[quote user="Nikosant03"]what if the disk is already be mounted and I call&amp;nbsp;&lt;strong&gt;f_mount()&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;again? Is it safe?&amp;nbsp;Re-mount the default drive will reinitialize the filesystem.. Could this lead to data loss?[/quote]
&lt;p&gt;That should be fine, it will just re-init the filesystem object (FATFS* &lt;span&gt;fs&lt;/span&gt;). However, note the following line from the description:&amp;nbsp;&lt;em&gt;&amp;quot;If there is any open object of file or directory on the logical drive, the object will be invalidated by this function.&amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 SDK16 - USB MSC example - How to check if FAT volume exists</title><link>https://devzone.nordicsemi.com/thread/289778?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2021 14:03:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:059f0a08-1c30-4292-97ff-b35cb540cc8f</guid><dc:creator>Nikosant03</dc:creator><description>&lt;p&gt;Hi Jorsen and thank you for your answer&lt;/p&gt;
&lt;p&gt;Everytime the system reset/restart I have to call the&amp;nbsp;&lt;strong&gt;f_mount()&amp;nbsp;&lt;/strong&gt;function? I mean, what if the disk is already be mounted and I call&amp;nbsp;&lt;strong&gt;f_mount()&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;again? Is it safe?&amp;nbsp;Re-mount the default drive will reinitialize the filesystem.. Could this lead to data loss?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1610978149432v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This is the first time I come across with file systems so excuse&amp;nbsp;my ignorance &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Nick&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 SDK16 - USB MSC example - How to check if FAT volume exists</title><link>https://devzone.nordicsemi.com/thread/289758?ContentTypeID=1</link><pubDate>Mon, 18 Jan 2021 13:36:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16990ce8-4819-4ffa-b369-4f7603952da6</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;a href="http://elm-chan.org/fsw/ff/doc/mount.html"&gt;f_mount&lt;/a&gt;() should return&amp;nbsp;&lt;a href="http://elm-chan.org/fsw/ff/doc/rc.html#ns"&gt;FR_NO_FILESYSTEM&lt;/a&gt;&amp;nbsp;if there is no FAT file system present on the logical drive.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>