<?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>[FATFS] FA_OPEN_APPEND destroy first file content</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37634/fatfs-fa_open_append-destroy-first-file-content</link><description>Hello, 
 I am trying to run USBD_MSC example using PCA10056 board from SDK15. 
 It works fine, when creating new file on each button press. 
 I modified code to create and append some data to file on button event. When using FAT file system, content of</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Sep 2020 07:59:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37634/fatfs-fa_open_append-destroy-first-file-content" /><item><title>RE: [FATFS] FA_OPEN_APPEND destroy first file content</title><link>https://devzone.nordicsemi.com/thread/268423?ContentTypeID=1</link><pubDate>Tue, 08 Sep 2020 07:59:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fc750db-e453-45ef-ac34-2263f71ac021</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;This case is almost 2 years old, and is based on an older SDK. Could you create a new thread with your issue? Remember to describe which device you&amp;#39;re using (and revision of it), as well as which SDK is in use.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [FATFS] FA_OPEN_APPEND destroy first file content</title><link>https://devzone.nordicsemi.com/thread/268043?ContentTypeID=1</link><pubDate>Fri, 04 Sep 2020 11:40:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e934d2a-d544-4c35-ae09-f44bb5e36a65</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;We are facing the same issue. Writing into the SD card is just fine and when we plug the SD card directly in to the PC it is fine. But when we read via the msc it is corrupted there are some lines destroyed.&lt;/p&gt;
&lt;p&gt;Did you had a solution for this problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [FATFS] FA_OPEN_APPEND destroy first file content</title><link>https://devzone.nordicsemi.com/thread/152693?ContentTypeID=1</link><pubDate>Fri, 12 Oct 2018 12:42:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b201a6ba-b4ac-4d7e-b95f-3eb4784462e6</guid><dc:creator>JeffW</dc:creator><description>&lt;p&gt;I am running into a very similar issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I have implemented the two known issue fixes, but was getting corruption on FATFS in the header of a file just by f_printf&amp;#39;s.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have since switched to exFat, the corruption no longer occurs in the top line of the text file, but deletes about 10 lines of log in the middle of the file, inserting many symbols and characters. This is very reproducible in my experimentation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [FATFS] FA_OPEN_APPEND destroy first file content</title><link>https://devzone.nordicsemi.com/thread/145430?ContentTypeID=1</link><pubDate>Thu, 23 Aug 2018 07:49:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:919690d1-2e3c-40e6-ae6c-d4d9079a6904</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;I have tried to recreate this issue at my end, but I am not able to see any corruption in the files.&lt;/p&gt;
&lt;p&gt;Do you see the same problem if you do this on other computers as well?&lt;/p&gt;
&lt;p&gt;Could you also tell me which version of the PCA10056 you have?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [FATFS] FA_OPEN_APPEND destroy first file content</title><link>https://devzone.nordicsemi.com/thread/145250?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2018 08:44:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d00461ad-3169-457c-8d3f-470643c86b0a</guid><dc:creator>Bartek</dc:creator><description>&lt;p&gt;Logs from device:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.000,000] &amp;lt;info&amp;gt; app: Initializing disk 0 (QSPI)...
[00:00:00.000,000] &amp;lt;info&amp;gt; app: Mounting volume...
[00:00:00.000,000] &amp;lt;error&amp;gt; app: Mount failed. Filesystem not found. Please format device.
[00:00:00.000,000] &amp;lt;info&amp;gt; app: USBD MSC example started.
[00:00:00.000,000] &amp;lt;info&amp;gt; app: 
Creating filesystem...
[00:00:00.000,000] &amp;lt;info&amp;gt; app: Mounting volume...
[00:00:00.000,000] &amp;lt;info&amp;gt; app: Done
[00:00:00.000,000] &amp;lt;info&amp;gt; app: 
Listing directory: /
Entries count: 1
Creating file: f1.txt ...[00:00:00.000,000] &amp;lt;info&amp;gt; app: 6/6 bytes written to: f1.txt
done
Creating file: f1.txt ...[00:00:00.000,000] &amp;lt;info&amp;gt; app: 6/6 bytes written to: f1.txt
done
Creating file: f1.txt ...[00:00:00.000,000] &amp;lt;info&amp;gt; app: 6/6 bytes written to: f1.txt
done
Creating file: f2.txt ...[00:00:00.000,000] &amp;lt;info&amp;gt; app: 6/6 bytes written to: f2.txt
done
Creating file: f2.txt ...[00:00:00.000,000] &amp;lt;info&amp;gt; app: 6/6 bytes written to: f2.txt
done
Creating file: f2.txt ...[00:00:00.000,000] &amp;lt;info&amp;gt; app: 6/6 bytes written to: f2.txt
done
Creating file: f3.txt ...[00:00:00.000,000] &amp;lt;info&amp;gt; app: 6/6 bytes written to: f3.txt
done
Creating file: f3.txt ...[00:00:00.000,000] &amp;lt;info&amp;gt; app: 6/6 bytes written to: f3.txt
done
Creating file: f3.txt ...[00:00:00.000,000] &amp;lt;info&amp;gt; app: 6/6 bytes written to: f3.txt
done
[00:00:00.000,000] &amp;lt;info&amp;gt; app: USB power detected
[00:00:00.000,000] &amp;lt;info&amp;gt; app: Un-initializing disk 0 (QSPI)...
[00:00:00.000,000] &amp;lt;info&amp;gt; app: USB ready
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;File content:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[bartek:/run/media/bartek/4821-0000] $ xxd F1.TXT 
00000000: 4428 2864 1000 6440 2000 0002 4021 6a44  D((d..d@ ...@!jD
00000010: 030a                                     ..
[bartek:/run/media/bartek/4821-0000] $ xxd F2.TXT 
00000000: 6c69 6e65 310a 6c69 6e65 320a 6c69 6e65  line1.line2.line
00000010: 330a                                     3.
[bartek:/run/media/bartek/4821-0000] $ xxd F3.TXT 
00000000: 6c69 6e65 310a 6c69 6e65 320a 6c69 6e65  line1.line2.line
00000010: 330a                                     3.
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I create only one file, it works fine:&lt;/p&gt;
&lt;p&gt;Logs form device&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:00.000,000] &amp;lt;info&amp;gt; app: Initializing disk 0 (QSPI)...
[00:00:00.000,000] &amp;lt;info&amp;gt; app: Mounting volume...
[00:00:00.000,000] &amp;lt;info&amp;gt; app: 
Listing directory: /
Entries count: 1
[00:00:00.000,000] &amp;lt;info&amp;gt; app: USBD MSC example started.
[00:00:00.000,000] &amp;lt;info&amp;gt; app: 
Creating filesystem...
[00:00:00.000,000] &amp;lt;info&amp;gt; app: Mounting volume...
[00:00:00.000,000] &amp;lt;info&amp;gt; app: Done
Creating file: f1.txt ...[00:00:00.000,000] &amp;lt;info&amp;gt; app: 6/6 bytes written to: f1.txt
done
Creating file: f1.txt ...[00:00:00.000,000] &amp;lt;info&amp;gt; app: 6/6 bytes written to: f1.txt
done
Creating file: f1.txt ...[00:00:00.000,000] &amp;lt;info&amp;gt; app: 6/6 bytes written to: f1.txt
done
[00:00:00.000,000] &amp;lt;info&amp;gt; app: USB power detected
[00:00:00.000,000] &amp;lt;info&amp;gt; app: Un-initializing disk 0 (QSPI)...
[00:00:00.000,000] &amp;lt;info&amp;gt; app: USB ready
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;File content:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[bartek:/run/media/bartek/4821-0000] 127 $ xxd F1.TXT 
00000000: 6c69 6e65 310a 6c69 6e65 320a 6c69 6e65  line1.line2.line
00000010: 330a                                     3.
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [FATFS] FA_OPEN_APPEND destroy first file content</title><link>https://devzone.nordicsemi.com/thread/145246?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2018 08:35:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:599acc35-5322-488e-8928-9b1a677b4468</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have tried your example on a PCA10056 v1.0.0, with FAT file system (+ both fixes initially mentioned), and I am not able to reproduce this issue. Could you post logs, F1.TXT content, and other failure descriptions?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [FATFS] FA_OPEN_APPEND destroy first file content</title><link>https://devzone.nordicsemi.com/thread/145235?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2018 08:13:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6371f14c-ff2a-40f3-b66b-5b9a684691c7</guid><dc:creator>Bartek</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thanks for reply.&lt;/p&gt;
&lt;p&gt;Of course I implemented both of fixes. They helped in described cases, but didn&amp;#39;t help with OP issue.&lt;/p&gt;
&lt;p&gt;I would not look for issue in USBD or QSPI libraries, since EXFAT is working fine...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [FATFS] FA_OPEN_APPEND destroy first file content</title><link>https://devzone.nordicsemi.com/thread/145234?ContentTypeID=1</link><pubDate>Wed, 22 Aug 2018 08:11:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1516df4-f98f-4659-b42a-1214bb40059e</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There are two currently known issues in SDK 15 that might affect the operation of this specific example:&lt;/p&gt;
&lt;p&gt;1. USBD:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/34605/usb-not-enumerating-after-reset/133051#133051"&gt;Erratas not properly applied&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2. QSPI:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/36654/usbd_msd-disk-initialization-fails-in-usb-unplug-with-sdk15-0/141462#141462"&gt;usbd_msc example might fail if you alter files, then unplug/plug the USB&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you ensure that these are applied, and then see if this fixes your issue?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>