<?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>f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62206/f_write-f_close-cause-ble-disconnect</link><description>Hardware: nrf52832 
 SDK: 16.0.0 with FreeRtos, 
 Softdevice: S132 7.0 
 I set configMAX_PRIORITIES to 5 and modified nrf_sdh_freertos_init to set BLE task priority to 4. 
 My sd card maintain task priority is set to 2. 
 For BLE NUS service: 
 #define</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 Jun 2020 08:59:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62206/f_write-f_close-cause-ble-disconnect" /><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/255698?ContentTypeID=1</link><pubDate>Thu, 18 Jun 2020 08:59:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00d28f5b-0973-45b4-a867-a9d4d913f5af</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Very well&lt;/p&gt;
&lt;p&gt;Don&amp;#39;t hesitate to reopen this ticket, or create a new one if you find out that you need further assistance!&lt;/p&gt;
&lt;p&gt;Best of luck and regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/255644?ContentTypeID=1</link><pubDate>Thu, 18 Jun 2020 00:21:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb8280bd-00df-4153-a8e9-a7c2154bf7f9</guid><dc:creator>snowfield</dc:creator><description>&lt;p&gt;Dear Simon:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Thank you very much for your patience. So it seems that this is not software issue. I will check from hardware/configuration direction.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; I think you can marked this ticket as closed. And thanks again for your kindly help.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Snow&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/255571?ContentTypeID=1</link><pubDate>Wed, 17 Jun 2020 13:32:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f94165ca-bd8d-45d0-9172-c87732993ba8</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;These pins should not be a problem to use, but I tested it just for good measure on my board as well, and I still don&amp;#39;t have any trouble writing to the SD card as you can see in the screenshot from the debug terminal below (the disconnection was done manually by me in the nRFConnect app).&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-2e94966f729247fca2f122e9885697b7/pastedimage1592399377321v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The SD card I&amp;#39;m using is a 2GB microSD card, with a &amp;quot;regular&amp;quot; FAT format. Our examples should support what is described in the &lt;a href="http://elm-chan.org/fsw/ff/00index_e.html"&gt;FatFs documentation&lt;/a&gt;. I think this format is limited to 4GB, so that might be your issue. You might have to edit some of the FatFs configurations to support larger cards, but I don&amp;#39;t think we have tested this.&lt;/p&gt;
&lt;p&gt;The reason your board can&amp;#39;t use the BLE app for nRFConnect is that only our first party kit SEGGER IDs are supported, as supporting all kinds of third-party devices would require way more maintenance and work than just our own boards.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/255420?ContentTypeID=1</link><pubDate>Wed, 17 Jun 2020 08:01:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32378384-b980-4bde-b43e-d99d55eaa59e</guid><dc:creator>snowfield</dc:creator><description>&lt;p&gt;I tried more android devices for nRFtoolbox APP, still not good.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;So there is very few suspect. I found that NRF demo board do not have SD card reader onboard, so I guess you are using Dupont line to connect reader? If so, I have a final suggestion: could you please help to switch 4 SPI pins as my code(Since my card reader is onboard and hard to change) to see if the pin assignment affect result ?&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;This suggestion maybe not reasonable. But frankly said I am totally missing direction now.&amp;nbsp; :-(&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/255381?ContentTypeID=1</link><pubDate>Wed, 17 Jun 2020 05:07:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04a715bc-414f-4398-8dc4-219e4b838b11</guid><dc:creator>snowfield</dc:creator><description>&lt;p&gt;Dear Simon:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;Unfortunately,&amp;nbsp; I tried another 2 different T card and still has the same issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;Is there any possible that this issue related to the FS type? Since my T cards size larger than 4GB, so have to use FAT32 format. What&amp;#39;s your T card&amp;#39;s FS type? What&amp;#39;s the size of your T card?&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;BTW: I also try to use nRFConnect on Laptop, but the tool report &amp;quot;low level error&amp;quot;. It seems that this tool can not use BT function on Laptop and need external hw support?&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/62206/f_write-f_close-cause-ble-disconnect/255280"] did you do anything special on your side in order to trigger this disconnect? [/quote]
&lt;p&gt;No, I just use nRF Toolbox(Android version) UART sub function to send out NUS string.&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/62206/f_write-f_close-cause-ble-disconnect/255280"]what SD card reader are you using?[/quote]
&lt;p&gt;If you mean &amp;quot;Reader&amp;quot;, my reader is onboard as following pic:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/5381.1.jpg" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/255373?ContentTypeID=1</link><pubDate>Wed, 17 Jun 2020 02:53:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d51c6b1-7563-46ad-8f17-4f65769aefd3</guid><dc:creator>snowfield</dc:creator><description>&lt;p&gt;Dear Simon:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; I only modified 5 lines of code . Screenshot of compare as beblow:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/c1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/c2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;I think these modifications should not affect the behavior. So I think your test result is a good news. It seems that this issue is caused&amp;nbsp; by specific SD card. I will try to find some other SD card to check this issue and get back to you.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Thank you very much.&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Snow&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/255280?ContentTypeID=1</link><pubDate>Tue, 16 Jun 2020 13:28:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b45513a-b32f-4e0f-8132-0b78f1834c98</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hey&lt;/p&gt;
&lt;p&gt;I was able to locate an SD card reader and an SD card, and have been testing Jørgen&amp;#39;s application (the ble_app_uart_fatfs_sdk141_keil_gcc_ses.zip example which allowed for debugging in SES). I have tested by using both my phone with the nRFConnect app (for Android), and a second DK with nRFConnect for Desktop but I have not been able to reproduce this error. Whenever I write to the UART.TXT file on the SD card, it returns successfully. Please see the attached debug log below&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-2e94966f729247fca2f122e9885697b7/pastedimage1592314051817v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Did you make any changes to the example application in order to reproduce this, or did you do anything special on your side in order to trigger this disconnect? Lastly, what SD card reader are you using?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/254975?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2020 11:10:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f1342f5-7d61-4bc4-ad8d-d74c28836a0c</guid><dc:creator>snowfield</dc:creator><description>&lt;p&gt;Dear Simon:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; I am very sorry about that I just noticed your name should be Simon and I use Simonr so many times. Sorry for the mistake.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;About the connection parameter, please look following screenshot:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/babe0f490417b63ee682d112485b07c.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;The timeout value is 5000ms and I think this should be long enough.&amp;nbsp; And this screenshot also contain the disconnect part.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;Thank you very much for preparing test on your side. Just FYI: the reference link discuss about SDK14.0.0 but tin fact the code should work with SDK14.1.0 (I test it on nRF5_SDK_14.1.0_1dda907)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/254967?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2020 10:49:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc48e358-ac84-4c89-99eb-4424888e3eaf</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;One thing, can you check what the connection supervision timeout is? It might be that the peripheral disconnects while the central (nRF) device is doing the SD card operations. You can try increasing this interval (on both ends) to see if this changes anything.&lt;/p&gt;
&lt;p&gt;Good suggestion, but I&amp;#39;ll have to track down an SD card, etc. so I&amp;#39;ll need a day or two to get this up and running.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/254816?ContentTypeID=1</link><pubDate>Sat, 13 Jun 2020 03:32:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:790a8556-9f43-49c8-9694-7a5b3180e9e4</guid><dc:creator>snowfield</dc:creator><description>&lt;p&gt;Dear Simonr:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;I don&amp;#39;t have DK or dedicate BLE sniffer. I will try to find one but I am not sure if I can get one.&amp;nbsp;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/62206/f_write-f_close-cause-ble-disconnect/254621"]Seeing as the disconnect reason is implying that it is the phone that initiates the disconnection/stops responding[/quote]
&lt;p&gt;&amp;nbsp; I have some different thoughts about this comment: the phone side just connect with NUS service and&amp;nbsp; know nothing about SD card operation, how can phone side &amp;quot;disconnect/stops responding&amp;quot; when 52832 conduct SD card operation? Even if the disconnect is initialed by phone side, I think 52832 must have some abnormal action to cause it.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; BTW I have a suggestion to speed up this issue analyze: Since the reference code (the link sent by you) has same issue, could you please help to try it on your side? Because I think you have more professional device (such as sniffer) and more professional skill than my side.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;Thank you very much for your kindly help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/254621?ContentTypeID=1</link><pubDate>Fri, 12 Jun 2020 08:26:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e605d439-23f6-4bce-b489-3218ce6ecd9a</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Seeing as the disconnect reason is implying that it is the phone that initiates the disconnection/stops responding, can you check out the log in the nRF Toolbox app, to see if you get any more information from that side. If we&amp;#39;re not able to see anything useful from that log information either, will you be able to provide a sniffer trace of the connection, so that we might have a look at some more details of the connection? If you have a DK you may use the &lt;a href="https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE"&gt;nRF Sniffer for BLE&lt;/a&gt; in order to do so, or you can use a dedicated sniffer if you have that available.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/254428?ContentTypeID=1</link><pubDate>Thu, 11 Jun 2020 10:16:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:503cff9b-a845-4cfb-92a6-45a22fa96b19</guid><dc:creator>snowfield</dc:creator><description>&lt;p&gt;Dear Simonr:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; I add code to print out the disconnect reason. Please look at following screenshot:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2450.2.png" /&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; For connection parameter, I have not touch any setting of the reference code. And for the other device, it is an android phone running NRF Toolbox APP&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/254419?ContentTypeID=1</link><pubDate>Thu, 11 Jun 2020 09:46:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df404d97-d8a2-4eff-abf5-bd129e39b377</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Do you see the same disconnect reason here as well? What is the connection timeout set to on the other device?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/254157?ContentTypeID=1</link><pubDate>Wed, 10 Jun 2020 07:27:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9b3ad03-af08-4cfe-bff2-68909c43a3f9</guid><dc:creator>snowfield</dc:creator><description>&lt;p&gt;Dear Simonr:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;I have finished test for your provided package (ble_app_uart_fatfs_sdk141_keil_gcc_ses). unfortunately it contain same problem. I attached LOG screenshot below:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/11352.1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; If you just send BLE string once, it seems no problem. But in fact if you wait some time or just do sending twice you will got &amp;quot;disconnect&amp;quot; issue.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Could you please help to ask your colleague if he can continue send and save sdcard without BLE disconnect?&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/254139?ContentTypeID=1</link><pubDate>Wed, 10 Jun 2020 05:42:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d36b35f-9f6c-4d6b-8392-1f52f12e59cd</guid><dc:creator>snowfield</dc:creator><description>&lt;p&gt;Dear Simonr:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; The demo code need SDK14. My current version is 16. So I need download corresponding environment. Since the network speed is very slow. I am afraid I can not test the demo today. I will report result later.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/254130?ContentTypeID=1</link><pubDate>Wed, 10 Jun 2020 02:22:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c92ea73-e888-4cb7-9bad-65982adb3a58</guid><dc:creator>snowfield</dc:creator><description>&lt;p&gt;Dear Simonr:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; 1, As you mentioned, SPI Pin setting in my code is S0S1&lt;/p&gt;
&lt;p&gt;&amp;nbsp; 2, I modified the setting to H0H1 and the SPI operation still cause BLE disconnect&lt;/p&gt;
&lt;p&gt;&amp;nbsp; 3, Thank you very much for provide the reference link. I think the demo code should be very helpful. I will try it ASAP&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/254058?ContentTypeID=1</link><pubDate>Tue, 09 Jun 2020 13:16:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d720ad4a-b89b-470a-85de-4b720b750fc4</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Please get back to me with the results of the SPI pin setting test.&lt;/p&gt;
&lt;p&gt;As for &amp;quot;SD card task&amp;quot;, I was referring to your own task, as I initially thought you had given the SD card task higher priority than the BLE and MAX_PRIORITIES tasks, but that&amp;#39;s my bad.&lt;/p&gt;
&lt;p&gt;You can check out&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/25952/transferring-data-received-over-ble-to-sd-card/102237#102237"&gt; this case&lt;/a&gt;, where my colleague has combined the ble_app_uart and fatfs example to write all strings received over BLE to an SD card. I was unable to find a BLE + SD card example that also uses FreeRTOS, so if you want/need to use FreeRTOS you can use Jørgen&amp;#39;s example as a template or reference.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/253971?ContentTypeID=1</link><pubDate>Tue, 09 Jun 2020 09:11:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53291435-5d98-443c-80f8-5ce51ae057b7</guid><dc:creator>snowfield</dc:creator><description>&lt;p&gt;Dear Simonr:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Thank you very much for mention about SPI pin setting. I will check it. And does this pin setting can affect BLE connection?&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/62206/f_write-f_close-cause-ble-disconnect/253967"]And I guess that rules out that the radio is interrupted by the SD card tasks due to priorities[/quote]
&lt;p&gt;&amp;nbsp;And for &amp;quot;SD card task&amp;quot; , do you mean my own task (which conduct sd card operation) or there is another system level tasks to handle SD card? For my own task, I have already checked. It&amp;#39;s priority is lower than BLE task.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is there any demo code for using SD card with BLE connection together successfully?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/253967?ContentTypeID=1</link><pubDate>Tue, 09 Jun 2020 08:59:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8340d3a-e557-4acf-952d-74578845a1f8</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Yes, you&amp;#39;re right. I mixed up the priorities. I&amp;#39;m really sorry about that, but it&amp;#39;s been some time since I have looked at FreeRTOS. And I guess that rules out that the radio is interrupted by the SD card tasks due to priorities. One thing that&amp;#39;s worth mentioning. The default SPI settings use standard drive for the SCK and MOSI pins, so it might be worth checking if these need to be set to high drive. Something like the configuration below should do the trick:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    nrf_gpio_cfg(SCK_PIN,
                 NRF_GPIO_PIN_DIR_OUTPUT,
                 NRF_GPIO_PIN_INPUT_DISCONNECT,
                 NRF_GPIO_PIN_NOPULL,
                 NRF_GPIO_PIN_H0H1,       // Require High Drive low/high level
                 NRF_GPIO_PIN_NOSENSE);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/253916?ContentTypeID=1</link><pubDate>Tue, 09 Jun 2020 04:55:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07920c43-bb96-4cd4-b437-0cf51a29490f</guid><dc:creator>snowfield</dc:creator><description>&lt;p&gt;Dear&amp;nbsp; Simonr:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;I did a new test: replace SD operation (f_open/f_write/f_close) part with a heavy load float computing function(need more than 800ms to finish). This float computing is running every 1 seconds. The BLE connection is very stable.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; If we name&amp;nbsp;&amp;quot;sd operation&amp;quot; as&amp;nbsp; A, and name &amp;quot;float computing&amp;quot; as B, then we have following comparation:&lt;/p&gt;
&lt;p&gt;* A cost less CPU than B (A use about 150ms per second , B use 800ms per second)&lt;/p&gt;
&lt;p&gt;* A/B locate on same position of same task (means on same logic sequence with same TASK priority)&lt;/p&gt;
&lt;p&gt;* A will cause BLE disconnect. But if replace A with B, BLE connection is stable.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;Consider above information. I think this disconnect issue seems not related to task priority or CPU consumption.&amp;nbsp; The problem maybe in FatFs/blkdev/sdc driver ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/253784?ContentTypeID=1</link><pubDate>Mon, 08 Jun 2020 12:04:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d6e454d-e158-4df0-bf6c-137a29ac3af9</guid><dc:creator>snowfield</dc:creator><description>&lt;p&gt;Dear Simonr:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Sorry I am little bit confused: On freeRTOS, the bigger number should mean higher priority. That&amp;#39;s why I modified BLE task priority to 5 and my own task&amp;#39;s priority is 2,3.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Do you mean on NRF freeRtos, bigger number means lower priority?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; I think my understanding is correct because I can see the IDLE task&amp;#39;s priority is 0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/253770?ContentTypeID=1</link><pubDate>Mon, 08 Jun 2020 11:41:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d203d56d-9bd4-48b8-93fe-b3bceaa8193c</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Lowering the BLE task priority and giving other tasks priority over it will cause the radio to be interrupted and cause disconnections. You should revert any changes you have made to the BLE task priority and set the SD card tasks to a lower priority so that it doesn&amp;#39;t interfere with the radio at all. The default BLE task and LOG task priorities should be left alone, as they require the highest priority available. Please try setting your &amp;quot;custom tasks&amp;quot; to 4, 5, and 6 for example as that should prevent the radio from being interrupted.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/253569?ContentTypeID=1</link><pubDate>Fri, 05 Jun 2020 14:05:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3621b8a-182d-4220-a420-b0d79f35c70b</guid><dc:creator>snowfield</dc:creator><description>[quote userid="75734" url="~/f/nordic-q-a/62206/f_write-f_close-cause-ble-disconnect/253531"] What devices are you testing this on?[/quote]
&lt;p&gt;I buy a Development Board from internet and the board is marked &amp;quot;PCA10040 compatible&amp;quot;. I can provide schem of the board when I back to office tomorrow.&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/62206/f_write-f_close-cause-ble-disconnect/253531"]and I&amp;#39;m guessing this is because the SD card operations are allowed to interrupt the radio[/quote]
&lt;p&gt;&amp;nbsp; I think this guess is reasonable. What can I do to verify or avoid this happen?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/253567?ContentTypeID=1</link><pubDate>Fri, 05 Jun 2020 13:57:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9074c174-e5e0-44c2-ad85-f362f64e343b</guid><dc:creator>snowfield</dc:creator><description>&lt;p&gt;Dear Simonr:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; Thank you very much for your support. Since it is night time on my location, I am out of office now. So I can not access detail source code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; About &amp;quot;should not edit SoftDevice&amp;#39;s priority&amp;quot;, do you mean the &amp;quot;interrupt priority&amp;quot; or &amp;quot;freeRtos task priority&amp;quot;?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; I have not change any interrupt priority. And for task priority, since the default BLE task priority is set to 2 and the LOG task priority is 1, there is no room for my tasks ( I have 2-3 tasks ). So I&amp;nbsp;do following change:&lt;/p&gt;
[quote userid="90887" url="~/f/nordic-q-a/62206/f_write-f_close-cause-ble-disconnect"]set&amp;nbsp;configMAX_PRIORITIES to 5 and modified nrf_sdh_freertos_init to set BLE task priority to 4.[/quote]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: f_write/f_close cause BLE disconnect</title><link>https://devzone.nordicsemi.com/thread/253531?ContentTypeID=1</link><pubDate>Fri, 05 Jun 2020 12:10:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a8ba5b1-ce69-4b16-88fa-88725af0ab00</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;You should not edit the SoftDevice&amp;#39;s priority levels at all, as that might cause trouble for your application. If the SD card operations are able to interrupt the BLE activities that might cause trouble when the radio is active. You can see the &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/processor_avail_interrupt_latency/exception_mgmt_sd.html"&gt;interrupt priority levels documentation here&lt;/a&gt; for some more details on the matter.&lt;/p&gt;
&lt;p&gt;Your disconnect reason (0x8 &lt;span&gt;BLE_HCI_CONNECTION_TIMEOUT)&lt;/span&gt;&amp;nbsp; points to that the other device has stopped responding, and I&amp;#39;m guessing this is because the SD card operations are allowed to interrupt the radio. What devices are you testing this on?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>