<?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>SDCard busy after several writes</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47660/sdcard-busy-after-several-writes</link><description>Hi, 
 I&amp;#39;ve modified the SDCard example to write every 2 seconds 80 bytes to a SD Card. The SDCard is correctly mounted and the File is opened and kept open. 
 After several writes the program hangs being busy 
 
 And then the timer expires and the program</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 May 2019 21:29:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47660/sdcard-busy-after-several-writes" /><item><title>RE: SDCard busy after several writes</title><link>https://devzone.nordicsemi.com/thread/189718?ContentTypeID=1</link><pubDate>Tue, 28 May 2019 21:29:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11e264b0-07c5-4eb7-8535-8c126bb75da3</guid><dc:creator>awneil</dc:creator><description>[quote userid="18764" url="~/f/nordic-q-a/47660/sdcard-busy-after-several-writes/189708"]please update the docu[/quote]
&lt;p&gt;Whose documentation?&lt;/p&gt;
&lt;p&gt;Note that FatFs is 3rd-party software - not controlled by Nordic:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/app_sdcard_example.html"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/app_sdcard_example.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://elm-chan.org/fsw/ff/00index_e.html"&gt;http://elm-chan.org/fsw/ff/00index_e.html&lt;/a&gt;&lt;/p&gt;
[quote userid="18764" url="~/f/nordic-q-a/47660/sdcard-busy-after-several-writes/189708"]The issue can be closed[/quote]
&lt;p&gt;&lt;em&gt;&lt;strong&gt;You&lt;/strong&gt; &lt;/em&gt;do that - by verifying an answer:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/5428._5F00_Verify_2D00_answer_2D00_nordic.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDCard busy after several writes</title><link>https://devzone.nordicsemi.com/thread/189708?ContentTypeID=1</link><pubDate>Tue, 28 May 2019 18:05:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2431dc2b-c52d-43c8-9b4d-95f46318d9cd</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;Okay solved now. The issue was related to the same undocumented issue before. If the cluster size is reached which is normally 32 kb the f_sync needs to shift the cluster. If during this sync a new write is called the fatfs freezes forever. This can only be handled if all write and sync operations are shifted to the main context and handled inside the while loop with flags. &lt;/p&gt;
&lt;p&gt;This is very uncomfortable and bad documented aswell. So please update the docu and make the example more explicitly for this case.&lt;/p&gt;
&lt;p&gt;Furthermore, the current implementation of the nrf_block_dev is not C++ compliant. Which was already stated in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/21693/nrf_block_dev_sdc-h-c-compability"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/21693/nrf_block_dev_sdc-h-c-compability&lt;/a&gt; and yet there was not solution nor work around for this issue. The only solution at the moment is to shift the NRF_BLOCK_DEV_SDC_DEFINE to an extra C file and write a init inside this c file which can be referenced in (extern &amp;quot;C&amp;quot;) in a c++ class.&lt;/p&gt;
&lt;p&gt;Last but not least the app_sdcard does not use the SPIM module. Furthermore, I guess it would be a good&amp;nbsp; idead to use the spi_mngr for the SD card then I guess the syncing issue might be gone aswell.&lt;/p&gt;
&lt;p&gt;The issue can be closed although there is not yet a real solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDCard busy after several writes</title><link>https://devzone.nordicsemi.com/thread/189450?ContentTypeID=1</link><pubDate>Tue, 28 May 2019 06:48:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c9d4cca-7077-4df1-a014-5b31a1b2f623</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;Okay there several strange and undocumented things happening which you should take into your documentatio:&lt;/p&gt;
&lt;p&gt;1. If the Buffer you write is not a power of 2 it fails after the reaching the sector size.&lt;/p&gt;
&lt;p&gt;2. If the half of the sector size is reached the fatfs needs to be synced otherwise it stays busy.&lt;/p&gt;
&lt;p&gt;3. The f_sync call has to be in the main function in the while loop, while the write can be in a timer routine.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now I can write very fast about 256 bytes in chunks. But however if I reach 32512 it freezes again and the debugger says:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1559026040114v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;That move window is called which means the sector window is moved. And therefore it needs to read from the disk and this does not return. Any idea why this happened?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Constantin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDCard busy after several writes</title><link>https://devzone.nordicsemi.com/thread/189094?ContentTypeID=1</link><pubDate>Fri, 24 May 2019 14:54:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67edba3d-d17e-48ab-95ca-343ba82d3428</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Are you able to reproduce the issue by modifying the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/app_sdcard_example.html?cp=5_1_4_6_34"&gt;FatFS/SD Card example&lt;/a&gt;&amp;nbsp;in the SDK?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDCard busy after several writes</title><link>https://devzone.nordicsemi.com/thread/188808?ContentTypeID=1</link><pubDate>Thu, 23 May 2019 11:51:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5500e28-26ba-486c-8923-65c1c8d24482</guid><dc:creator>Constantin</dc:creator><description>&lt;p&gt;Okay. But it is an eclipse project. But it should work as expected. I deleted all BLE stuff and the issue is still reproducable.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/app_5F00_mcu.zip"&gt;devzone.nordicsemi.com/.../app_5F00_mcu.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDCard busy after several writes</title><link>https://devzone.nordicsemi.com/thread/188801?ContentTypeID=1</link><pubDate>Thu, 23 May 2019 10:57:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70203360-3a42-46df-92af-0aec7a195161</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you provide minimal sample project that can be used to reproduce this issue?&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>