<?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>The writing of SD card in slave causes disconnection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53416/the-writing-of-sd-card-in-slave-causes-disconnection</link><description>I can success transplant saadc and fatfs to my ble project.However, when there is a SD card, the slave can write data to SD card successfully, but disconnect with the master. If the SD card is removed, the slave can connect with the master stably.when</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Oct 2019 03:24:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53416/the-writing-of-sd-card-in-slave-causes-disconnection" /><item><title>RE: The writing of SD card in slave causes disconnection</title><link>https://devzone.nordicsemi.com/thread/216472?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2019 03:24:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a46e72fc-863e-4e18-9c9c-fbd64aac7f53</guid><dc:creator>XinKai</dc:creator><description>&lt;p&gt;Thanks for your reply!&lt;/p&gt;
&lt;p&gt;I have found the problem, the f_write() seems not to block the process, but the f_sync() take a longer time which will bring the interrupts. So now I use the Master to give the Slave a signal to start wring 512 bytes(or integral multiples) per time, and in the end give the Slave a signal to use f_sync to save .txt. It works well in my one hour test and save 10 MB data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But now I meet another problem, the timer is inaccurate when I write to .txt. Perhaps the deviation is caused by the disconnection and connection as the following picture shows. The hardware timers performs well if the Slave connects with the Master well.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/_6C78F64EA18BF6656856_sdWrite_EF8BEE5D_.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;Why is the time deviation happen when disconnection and connection? And what should I do?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The writing of SD card in slave causes disconnection</title><link>https://devzone.nordicsemi.com/thread/215887?ContentTypeID=1</link><pubDate>Mon, 21 Oct 2019 11:25:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f675566-7a46-4697-a436-050068705dbf</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I assume there can be two reasons for disconnect, either:&lt;/p&gt;
&lt;p&gt;1. The&amp;nbsp;sdWrite() somehow block the softdevice interrupts for a long period of time. Preventing it from processing the BLE events.&lt;/p&gt;
&lt;p&gt;-OR-&lt;/p&gt;
&lt;p&gt;2. The sdWrite() cause noise and impact the communication,&amp;nbsp;maybe look at ripple on VDD and/or try other GPIO&amp;#39;s for the SD card. Is this using your own nRF52 module, or are you using an nRF52-DK?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>