<?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>Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840</link><description>Hello Nordic Family. I hope this post finds you well. 
 I am working on a project where I have connected multiple sensors to the NRF52840. I have collected all the sensor&amp;#39;s data and saved it on the SD card as a CSV file. The file size is about 240MB which</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Oct 2022 11:13:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840" /><item><title>RE: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/389983?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2022 11:13:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ba2a5cd-ed89-4c6e-affa-74a85425c440</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Sami,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You should test with the proposed change and see if this works for your use-case.&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: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/389582?ContentTypeID=1</link><pubDate>Thu, 06 Oct 2022 10:46:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30549609-08db-47fc-9a11-ee79fc54f4f7</guid><dc:creator>Samiulhaq</dc:creator><description>&lt;p&gt;Hi Hakan sir, Thanks for the suggestion.&lt;/p&gt;
&lt;p&gt;Do I just have to add the code snippet you provided?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Sami&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/389574?ContentTypeID=1</link><pubDate>Thu, 06 Oct 2022 10:26:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49804bf5-9cf7-404a-b9b0-1b81e852ce54</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Sami,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That looks good in terms of algorithm, but this line:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (err_code != NRF_ERROR_RESOURCES)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Should be expanded to ensure that you do not lose track in cases where the link is disconnected. You should check similar to what is done in the original ble_app_uart sample:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if ((err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp;
    (err_code != NRF_ERROR_RESOURCES) &amp;amp;&amp;amp;
    (err_code != NRF_ERROR_NOT_FOUND))&lt;/pre&gt;&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: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/389567?ContentTypeID=1</link><pubDate>Thu, 06 Oct 2022 09:58:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4342b61e-5500-4532-b25e-34eecec19d08</guid><dc:creator>Samiulhaq</dc:creator><description>&lt;p&gt;Hi Hakan, thanks for the suggestion.&lt;/p&gt;
&lt;p&gt;Yes exactly I have done the same and now I am able to read data from the SD card and send it to the mobile app continuously.&amp;nbsp; Below code snippet is my approach;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define FILE_SIZE_MAX                   BLE_NUS_MAX_DATA_LEN  // file size is same as the packet size
static uint8_t file_buffer[FILE_SIZE_MAX];
ff_result = f_open(&amp;amp;file, FILE_NAME, FA_READ);

for (;;)
    {
        if(file_send_to_peripheral)
        {

           file_actual_read_size = (f_size(&amp;amp;file));
           uint32_t remaining_bytes = file_actual_read_size;  
           uint16_t chunk_length = BLE_NUS_MAX_DATA_LEN;
           ret_code_t err_code;

            if(file_actual_read_size &amp;gt; 0)
            {

            while(remaining_bytes &amp;gt; 0)
             {

             ff_result = f_read(&amp;amp;file, file_buffer, sizeof(file_buffer), (UINT *) &amp;amp;bytes_read);
             err_code= ble_nus_data_send(&amp;amp;m_nus, file_buffer, &amp;amp;chunk_length, m_conn_handle);

                if (err_code != NRF_ERROR_RESOURCES)
                {
                    APP_ERROR_CHECK(err_code);

                   remaining_bytes -= chunk_length;
                   if(remaining_bytes &amp;lt; chunk_length)
                    {
                     chunk_length = remaining_bytes;
                    }
                    NRF_LOG_INFO(&amp;quot;Remaining bytes to send: %d&amp;quot;, remaining_bytes);

                }

                }
                }
            file_send_to_peripheral = false;
        }
        idle_state_handle();
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is this the efficient way of reading from the SD card and sending it to the Mobile App?&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Sami&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/389564?ContentTypeID=1</link><pubDate>Thu, 06 Oct 2022 09:48:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25325b4c-e6e7-4cce-ba08-fefc635eb5bc</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;
[quote user="Samiulhaq"]Can you please refer me to a thread/blog where they have accessed and read large data from SD in small chunks/buffer? I have tried but I am unable to read the large file in a small buffer. I will be very thankful to you.&amp;nbsp;[/quote]
&lt;p&gt;I do not think we have&amp;nbsp;a blog/thread for this scenario.&lt;/p&gt;
&lt;p&gt;What you need to handle is a arbitrary byte stream going into a buffer, which again is passed through your bluetooth link. You should not need to buffer many kilobytes of data from the SD card, you need to read SD-data out into your buffer and pass the data through the bluetooth link.&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: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/389337?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2022 08:27:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bae0890-a376-4589-8f5f-8250186d2b00</guid><dc:creator>Samiulhaq</dc:creator><description>&lt;p&gt;Thanks Hakan for helping.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/389324"]Yes, it is the central that drives the communication and essentially sets all the rules. A peripheral can ask for certain parameters, but it is the central that eventually grants permissions.[/quote]
&lt;p&gt;Okay Sir, I understand, and thank you for the thorough explanation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/389324"]You are running out of RAM by trying to buffer ~220kB of data. You must handle this in a smaller buffer.[/quote]
&lt;p&gt;Can you please refer me to a thread/blog where they have accessed and read large data from SD in small chunks/buffer? I have tried but I am unable to read the large file in a small buffer. I will be very thankful to you.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Sami&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/389324?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2022 08:08:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:607555e3-abb3-42ac-93e5-044f632f7e30</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Sami,&lt;/p&gt;
[quote user="Samiulhaq"]It concluded that the problem is with the mobile app side(central ) not the peripheral, am I right?&amp;nbsp;[/quote]
&lt;p&gt;Yes, it is the central that drives the communication and essentially sets all the rules. A peripheral can ask for certain parameters, but it is the central that eventually grants permissions.&lt;/p&gt;
[quote user="Samiulhaq"]I don&amp;#39;t know how to solve this. Simply I want to read the whole file (234MB) from the SD card at once and then send it in chunks to the mobile app, Is this possible or do I have to read in chunks from the SD card too?&amp;nbsp;[/quote]
&lt;p&gt;You are running out of RAM by trying to buffer ~220kB of data. You must handle this in a smaller buffer.&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: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/389212?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2022 12:57:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8620854-02e1-4283-bc9e-ce814534eca4</guid><dc:creator>Samiulhaq</dc:creator><description>&lt;p&gt;Thank you Hakan, for the thorough explanation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It concluded that the problem is with the mobile app side(central ) not the peripheral, am I right?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;One last question and sorry for taking your precious time. I want to read a large file (about 240MB) from the SD card but the problem is that when I increase the&amp;nbsp;&lt;strong&gt;#define FILE_SIZE_MAX (&lt;/strong&gt;Maximum size in bytes of the file to be read from SDCARD&lt;strong&gt;)&amp;nbsp;&lt;/strong&gt;greater than&amp;nbsp;&lt;strong&gt;220000,&amp;nbsp;&lt;/strong&gt;while the following;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;strong&gt;static uint8_t file_buffer[FILE_SIZE_MAX];&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;ff_result = f_read(&amp;amp;file, file_buffer, FILE_SIZE_MAX, (UINT *) &amp;amp;bytes_read);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Then it gives the following error:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;.bss is too large to fit in RAM1 memory segment&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .heap is too large to fit in RAM1 memory segment&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;section .heap overlaps absolute placed section .stack&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;section .stack VMA [000000002003e000,000000002003ffff] overlaps section .bss VMA&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[0000000020002c64,0000000020224b08]&amp;nbsp;&lt;/strong&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know how to solve this. Simply I want to read the whole file (234MB) from the SD card at once and then send it in chunks to the mobile app, Is this possible or do I have to read in chunks from the SD card too?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Sami&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/389203?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2022 12:29:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1964408f-9deb-4781-b16a-469c6f41053c</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;
[quote user="Samiulhaq"]Okay got it, what will be the solution for this? Is it depend on the phone?[/quote]
&lt;p&gt;Yes, it will depend on the phone.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Samiulhaq"]But my phone is only connected to the&amp;nbsp;&lt;strong&gt;UART &lt;/strong&gt;inside&amp;nbsp;the&amp;nbsp;&lt;strong&gt;nRF toolbox&lt;/strong&gt;&amp;nbsp;app and it is only receiving the data from the &lt;strong&gt;nRF52. &lt;/strong&gt;How can I check whether the phone is servicing other Bluetooth devices?[/quote]
&lt;p&gt;It could be as simple as the phone needs time to scan for new devices in the background, or that it has a wifi/BLE combo-chipset, where wifi takes priority. It is hard to say exactly what is the issue, unfortunately.&lt;/p&gt;
[quote user="Samiulhaq"]&lt;p&gt;The sniffer file I have shared with you is the result of&amp;nbsp;&lt;strong&gt;a Samsung&amp;nbsp;&lt;/strong&gt;mobile. It doesn&amp;#39;t change(increase) the throughput.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Another thing I have noticed, if you look at the actual data in the&amp;nbsp;&lt;strong&gt;Sniffer file&amp;nbsp;&lt;/strong&gt;you will see that the data is some like:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;UART Rx [truncated]: 6152,15433,36722,45008,23274,41643,855,475,15158,6906,13015,19129,40270,38062,17184,20220111121250\r\n23784,38793,36320,49942,19511,34148,1653,45854,26109,10248,6625,7790,46092,40673,18648,4132,31523,20220111121250\r\&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;What does [&lt;strong&gt;truncated&lt;/strong&gt;] mean?&lt;/p&gt;
&lt;p&gt;How to send &lt;strong&gt;2 lines (about 243Bytes)&lt;/strong&gt;&amp;nbsp;of the &lt;strong&gt;CSV file &lt;/strong&gt;per&amp;nbsp;chunk and when the &lt;strong&gt;\r\n&lt;/strong&gt; of every 2nd line comes then send the chunk (in short I want to send 2 lines per chunk).&lt;/p&gt;[/quote]
&lt;p&gt;From the log, there&amp;#39;s a field called &amp;quot;more data&amp;quot; - this indicates to the central that the peripheral has more data to send.&lt;/p&gt;
&lt;p&gt;I have highlighted it here:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1664886113078v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From the trace, this field will always be set to true, meaning that the peripheral always tries to send more data to the central.&lt;/p&gt;
&lt;p&gt;If you look at frame #1226 for instance, where the central uses 27 ms to ask for new data:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1664886306796v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s several of these timing gaps within the trace, which limits your overall throughput, and these are driven by the phone side.&lt;/p&gt;
[quote user="Samiulhaq"]&lt;p&gt;What does [&lt;strong&gt;truncated&lt;/strong&gt;] mean?&lt;/p&gt;
&lt;p&gt;How to send &lt;strong&gt;2 lines (about 243Bytes)&lt;/strong&gt;&amp;nbsp;of the &lt;strong&gt;CSV file &lt;/strong&gt;per&amp;nbsp;chunk and when the &lt;strong&gt;\r\n&lt;/strong&gt; of every 2nd line comes then send the chunk (in short I want to send 2 lines per chunk).&lt;/p&gt;[/quote]
&lt;p&gt;Truncated means that the wireshark view basically does not show all your data, ie. the graphical view stops listing the data. The data is being sent, it is just a graphical feature of wireshark.&lt;/p&gt;
&lt;p&gt;The &amp;quot;\r\n&amp;quot;&amp;nbsp;are line-endings in a file. You will need to parse the datastream before sending it through the bluetooth link to remove or detect these.&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: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/389142?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2022 08:23:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:406720b6-a2c1-42dd-a078-129b94116d85</guid><dc:creator>Samiulhaq</dc:creator><description>&lt;p&gt;Thanks Hakan for the quick reply.&amp;nbsp;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/389131"]The phone has &amp;quot;radio silence&amp;quot; for smaller periods (&amp;lt; 50 ms), which indicates that the phone itself is servicing other bluetooth devices or similar on its end.[/quote]
&lt;p&gt;Okay got it, what will be the solution for this? Is it depend on the phone?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/389131"]The phone has &amp;quot;radio silence&amp;quot; for smaller periods (&amp;lt; 50 ms), which indicates that the phone itself is servicing other bluetooth devices or similar on its end.[/quote]
&lt;p&gt;But my phone is only connected to the&amp;nbsp;&lt;strong&gt;UART &lt;/strong&gt;inside&amp;nbsp;the&amp;nbsp;&lt;strong&gt;nRF toolbox&lt;/strong&gt;&amp;nbsp;app and it is only receiving the data from the &lt;strong&gt;nRF52. &lt;/strong&gt;How can I check whether the phone is servicing other Bluetooth devices?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/389131"]&lt;p&gt;The transport&amp;nbsp;both your case, and this video is similar. Data is streamed from a source and over the bluetooth layer, in&amp;nbsp;packets of &amp;gt;200 bytes per payload.&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re using the same phone as previous test, it will highly likely give you similar throughput.&lt;/p&gt;[/quote]
&lt;p&gt;The sniffer file I have shared with you is the result of&amp;nbsp;&lt;strong&gt;a Samsung&amp;nbsp;&lt;/strong&gt;mobile. It doesn&amp;#39;t change(increase) the throughput.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Another thing I have noticed, if you look at the actual data in the&amp;nbsp;&lt;strong&gt;Sniffer file&amp;nbsp;&lt;/strong&gt;you will see that the data is some like:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;UART Rx [truncated]: 6152,15433,36722,45008,23274,41643,855,475,15158,6906,13015,19129,40270,38062,17184,20220111121250\r\n23784,38793,36320,49942,19511,34148,1653,45854,26109,10248,6625,7790,46092,40673,18648,4132,31523,20220111121250\r\&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;What does [&lt;strong&gt;truncated&lt;/strong&gt;] mean?&lt;/p&gt;
&lt;p&gt;How to send &lt;strong&gt;2 lines (about 243Bytes)&lt;/strong&gt;&amp;nbsp;of the &lt;strong&gt;CSV file &lt;/strong&gt;per&amp;nbsp;chunk and when the &lt;strong&gt;\r\n&lt;/strong&gt; of every 2nd line comes then send the chunk (in short I want to send 2 lines per chunk).&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Sami&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/389131?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2022 07:45:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8bdcd58-daa5-44c9-bda9-b73137470691</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Sami,&lt;/p&gt;
[quote user="Samiulhaq"]What do you mean by &amp;quot;the central doesn&amp;#39;t poll the peripheral&amp;quot;? If you scroll down the &lt;strong&gt;S&lt;/strong&gt;&lt;strong&gt;niffer file&lt;/strong&gt; (I shared with you), you will see the data has been exchanged correctly( the green lines in the &lt;strong&gt;S&lt;/strong&gt;&lt;strong&gt;niffer file&lt;/strong&gt;).[/quote]
&lt;p&gt;The data is exchanged properly, but the overall throughput it limited by the central.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The phone has &amp;quot;radio silence&amp;quot; for smaller periods (&amp;lt; 50 ms), which indicates that the phone itself is servicing other bluetooth devices or similar on its end.&lt;/p&gt;
&lt;p&gt;Even though the peripheral has more data to send, and is signalling this to the central, the central&amp;nbsp;ends the current connection interval earlier than usual.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Samiulhaq"]Seems like sending the data file chunk by chunk won&amp;#39;t be the best solution to send a large file (about 240MB). Have you watched&amp;nbsp;&lt;a href="https://www.youtube.com/watch?v=K1ItqEZ2_tw&amp;amp;t=115s" rel="noopener noreferrer" target="_blank"&gt;this&lt;/a&gt;&amp;nbsp;video where they are sending images from nRF52 to the mobile app in a single capture and in stream mode like a video? I want to achieve exactly the same of sending the file in bursts, not in chunks. Is it possible with the CSV file or only for the images?&amp;nbsp;[/quote]
&lt;p&gt;The transport&amp;nbsp;both your case, and this video is similar. Data is streamed from a source and over the bluetooth layer, in&amp;nbsp;packets of &amp;gt;200 bytes per payload.&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re using the same phone as previous test, it will highly likely give you similar throughput.&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: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/389103?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2022 05:17:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf34c6f3-52e9-483d-ab66-d0337fb1e4a7</guid><dc:creator>Samiulhaq</dc:creator><description>&lt;p&gt;Hi Hakan, thanks for the reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/388789"]The PHY is changed successfully to 2MBit in frame #867.[/quote]
&lt;p&gt;Yes sir, it is. My mobile phone responded unknown to the PHY update request, so I tried with another mobile and it worked.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/388789"]What is the throughput you&amp;#39;re seeing now?[/quote]
&lt;p&gt;Unfortunately, the throughput is still the same(220KB per 3-4 seconds).&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/388789"]From the traces it seems that the&amp;nbsp;central (phone) does not poll the peripheral (nrf), which can indicate that it is doing something else. The problem with using a phone is that most bluetooth chipsets there are combo-chipsets, and also uses the same radio to server multiple services.[/quote]
&lt;p&gt;What do you mean by &amp;quot;the central doesn&amp;#39;t poll the peripheral&amp;quot;? If you scroll down the &lt;strong&gt;S&lt;/strong&gt;&lt;strong&gt;niffer file&lt;/strong&gt; (I shared with you), you will see the data has been exchanged correctly( the green lines in the &lt;strong&gt;S&lt;/strong&gt;&lt;strong&gt;niffer file&lt;/strong&gt;).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Seems like sending the data file chunk by chunk won&amp;#39;t be the best solution to send a large file (about 240MB). Have you watched&amp;nbsp;&lt;a href="https://www.youtube.com/watch?v=K1ItqEZ2_tw&amp;amp;t=115s" rel="noopener noreferrer" target="_blank"&gt;this&lt;/a&gt;&amp;nbsp;video where they are sending images from nRF52 to the mobile app in a single capture and in stream mode like a video? I want to achieve exactly the same of sending the file in bursts, not in chunks. Is it possible with the CSV file or only for the images?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Sami&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/388789?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2022 13:02:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46795660-74b1-46d7-89f6-14b274c7333b</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Sami,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sniffer trace was good, thanks for sharing this one.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The PHY is changed successfully to 2MBit in frame #867.&lt;/p&gt;
&lt;p&gt;What is the throughput you&amp;#39;re seeing now?&lt;/p&gt;
&lt;p&gt;From the traces it seems that the&amp;nbsp;central (phone) does not poll the peripheral (nrf), which can indicate that it is doing something else. The problem with using a phone is that most bluetooth chipsets there are combo-chipsets, and also uses the same radio to server multiple services.&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: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/388772?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2022 12:24:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e8cdcf5-63aa-41a3-853a-90d08241b67c</guid><dc:creator>Samiulhaq</dc:creator><description>&lt;p&gt;Hello Hakan, thanks for the replay.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/388755"]You should call the snippet from the BLE_GAP_EVT_CONNECTED, similar to this:[/quote]
&lt;p&gt;Yes, I have included these lines in the&amp;nbsp;&lt;strong&gt;BLE_GAP_EVT_CONNECTED.&amp;nbsp;&lt;/strong&gt; Thanks for the snippet.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/388755"]You can use the BLE sniffer to see the details of the link:[/quote]
&lt;p&gt;I have set up the Sniffer with &lt;strong&gt;Wireshark&lt;/strong&gt;, but I am new to the sniffer and can&amp;#39;t analyze the packets correctly that is how I can find the packet size, number of bits/bytes per packet, connection interval, time taken by1 packet, and other related parameters in the sniffer/Wireshark. I have attached the &lt;strong&gt;Wireshark&lt;/strong&gt; result to this reply, can you please analyze it and extract the required information from it? I will be very thankful for this kind act.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Sniffer_5F00_Result.pcapng"&gt;devzone.nordicsemi.com/.../Sniffer_5F00_Result.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/388755"]&lt;p&gt;Note that you should also include the pairing process, so that the sniffer can follow (ie. decode) the rest of the communication as well.&lt;/p&gt;
&lt;p&gt;You can do this by deleting the bonds on both phone and nRF, then the sniffer shall be able to pick it up.&lt;/p&gt;[/quote]
&lt;p&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t understand this as I am new to Sniffer. I have the sniffer running in one NRF52840 Eval kit and another NRF2840 DK for the main task to send the data to the app. Can you please refer me to a blog/ticket etc for more clarification?&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Sami&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/388755?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2022 11:44:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:696b23ec-cfef-4f9b-8540-4657eecdcea3</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Sami,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Samiulhaq"]&lt;p&gt;No, I am not using IMbit on-air data rate, rather I am using 2MBPS as I have &lt;strong&gt;set&amp;nbsp;BLE_GAP_EVT_PHY_UPDATE_REQUEST:&amp;nbsp;&lt;/strong&gt;to&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;strong&gt;&amp;nbsp; .rx_phys = BLE_GAP_PHY_2MBPS,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; .&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tx_phys = BLE_GAP_PHY_2MBPS,&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Is this the correct way to set the 2MBPS on-air data rate?&amp;nbsp;&lt;/p&gt;[/quote]
&lt;p&gt;You should call the snippet from the BLE_GAP_EVT_CONNECTED, similar to this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;case BLE_GAP_EVT_CONNECTED:
{
    ble_gap_phys_t const phys =
    {
       .rx_phys = BLE_GAP_PHY_2MBPS,
       .tx_phys = BLE_GAP_PHY_2MBPS,
    };
    err_code = sd_ble_gap_phy_update(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, &amp;amp;phys);
    ...
    break;
};&lt;/pre&gt;&lt;/p&gt;
[quote user="Samiulhaq"]Yes Sir, this might be the case, How do I check these parameters in my mobile App? I am using a &lt;strong&gt;Vivo&lt;/strong&gt; phone and the mobile App which I am using to get the data is&amp;nbsp;&lt;strong&gt;nRF Toolbox&amp;nbsp;&lt;/strong&gt;in which I am using&amp;nbsp;&lt;strong&gt;UART.&amp;nbsp;&lt;/strong&gt;How to check connection parameters in my case?&amp;nbsp;[/quote]
&lt;p&gt;You can use the BLE sniffer to see the details of the link:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le"&gt;https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that you should also include the pairing process, so that the sniffer can follow (ie. decode) the rest of the communication as well.&lt;/p&gt;
&lt;p&gt;You can do this by deleting the bonds on both phone and nRF, then the sniffer shall be able to pick it up.&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: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/388451?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2022 05:00:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0389ac64-4ab8-4215-9ca8-567432396b4f</guid><dc:creator>Samiulhaq</dc:creator><description>&lt;p&gt;Hi Hakan, thanks for the reply.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/388366"]55 kiloBytes per second -&amp;gt; 440kbit/s, which is quite fast when using the BLE 1Mbit on-air data rate.[/quote]
&lt;p&gt;No, I am not using IMbit on-air data rate, rather I am using 2MBPS as I have &lt;strong&gt;set&amp;nbsp;BLE_GAP_EVT_PHY_UPDATE_REQUEST:&amp;nbsp;&lt;/strong&gt;to&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;strong&gt;&amp;nbsp; .rx_phys = BLE_GAP_PHY_2MBPS,&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; .&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tx_phys = BLE_GAP_PHY_2MBPS,&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Is this the correct way to set the 2MBPS on-air data rate?&amp;nbsp;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/388366"]Have you tried requesting 2MBit PHY in the BLE_GAP_EVT_CONNECTED event?[/quote]
&lt;p&gt;The below is my Ble_connected Case:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;case BLE_GAP_EVT_CONNECTED:
            NRF_LOG_INFO(&amp;quot;Connected&amp;quot;);
            err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
            APP_ERROR_CHECK(err_code);
            m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
            err_code = nrf_ble_qwr_conn_handle_assign(&amp;amp;m_qwr, m_conn_handle);
            APP_ERROR_CHECK(err_code);
            break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;How do I check whether the 2MBit PHY is requested or not in&amp;nbsp;&lt;strong&gt;the BLE_GAP_EVT_CONNECTED&amp;nbsp;&lt;/strong&gt;case?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/388366"]Have you checked what the connection parameters that you receive from your phone is? This might be the maximum based on the event length, connection interval, etc. that the central provides you with.[/quote]
&lt;p&gt;Yes Sir, this might be the case, How do I check these parameters in my mobile App? I am using a &lt;strong&gt;Vivo&lt;/strong&gt; phone and the mobile App which I am using to get the data is&amp;nbsp;&lt;strong&gt;nRF Toolbox&amp;nbsp;&lt;/strong&gt;in which I am using&amp;nbsp;&lt;strong&gt;UART.&amp;nbsp;&lt;/strong&gt;How to check connection parameters in my case?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Sami Ul Haq&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/388366?ContentTypeID=1</link><pubDate>Wed, 28 Sep 2022 13:16:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb22ec89-82c9-4b1b-a4fd-b27adc62c62a</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;
[quote user="Samiulhaq"]I have applied all the suggestions from multiple similar threads but still, I can only send &lt;strong&gt;220KB&lt;/strong&gt;(of 234MB file) per &lt;strong&gt;4 seconds&lt;/strong&gt;&amp;nbsp;which is &lt;strong&gt;55KB/second&lt;/strong&gt;. This figure is far beyond the &lt;strong&gt;1Mbps&lt;/strong&gt; speed.&amp;nbsp;[/quote]
&lt;p&gt;55 kiloBytes per second -&amp;gt; 440kbit/s, which is quite fast when using the BLE 1Mbit on-air data rate.&lt;/p&gt;
&lt;p&gt;Have you checked what the connection parameters that you receive from your phone is? This might be the maximum based on the event length, connection interval, etc. that the central provides you with.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you tried requesting 2MBit PHY in the BLE_GAP_EVT_CONNECTED event?&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a snippet on how to request that:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/67774/enabling-2mb-phy-windows-10-1909"&gt;enabling 2Mb phy Windows 10 (1909)&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&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: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/388352?ContentTypeID=1</link><pubDate>Wed, 28 Sep 2022 12:35:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc720c76-4a35-4509-a4eb-f7215fcc6c9b</guid><dc:creator>Samiulhaq</dc:creator><description>&lt;p&gt;Hi Hakon,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/387893"]Your overall throughput will depend on what the parameters that the central device accepts. It is true that you can technically achieve these numbers, but that also depends on a phone that allows such optimal parameters.[/quote]
&lt;p&gt;I have applied all the suggestions from multiple similar threads but still, I can only send &lt;strong&gt;220KB&lt;/strong&gt;(of 234MB file) per &lt;strong&gt;4 seconds&lt;/strong&gt;&amp;nbsp;which is &lt;strong&gt;55KB/second&lt;/strong&gt;. This figure is far beyond the &lt;strong&gt;1Mbps&lt;/strong&gt; speed.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/387893"]You have to transfer the file in chunks of the max. data length that you can send, ie. 244 bytes in your scenario.[/quote]
&lt;p&gt;Yes, I am sending in chunks of 244 bytes but the rate of sending chunks is very low. I am very tired of looking at this problem for more than a week and studied a lot of threads but no one help me. I just want to read a 234MB file from the SD card and send it to the mobile app in the fastest possible way(up to 1Mbps)&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Sami Ul Haq.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/387893?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2022 11:52:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:312d9198-fe51-41d4-b0fc-368a71137f52</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;
[quote user="Samiulhaq"]Yes, I am sending data to the mobile App using &lt;strong&gt;ble_uart&amp;nbsp;&lt;/strong&gt;with the chunk size=&lt;strong&gt;BLE_NUS_MAX_DATA_LEN-3&lt;/strong&gt;&amp;nbsp;which in turn is equal to&amp;nbsp;&lt;strong&gt;NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247,&amp;nbsp;&lt;/strong&gt;so chunk size= 247-3= 244 bytes/chunks[/quote]
&lt;p&gt;Good, you&amp;#39;re maximizing the MTU size.&lt;/p&gt;
[quote user="Samiulhaq"]Does throughput mean bytes/second? If yes, my current throughput is&amp;nbsp;55,000 bytes/second. For this, I have the chunks size= 247-3= 244bytes/chunk,&amp;nbsp;&lt;span&gt;&lt;strong&gt;NRF_SDH_BLE_GAP_EVENT_LENGTH&lt;/strong&gt;=&amp;nbsp;&lt;strong&gt;100&amp;nbsp;&lt;/strong&gt; and&amp;nbsp;&lt;strong&gt;MIN_CONN_INTERVAL and MAX_CONN_INTERVAL&amp;nbsp;&lt;/strong&gt;to 7.5 and 200 respectively&lt;/span&gt;[/quote]
&lt;p&gt;When you have a high event length, it is actually better to have a larger connection interval. When using the minimum of 7.5 ms, you are hopping to a new channel every connection interval, which can reduce the overall throughput a bit.&lt;/p&gt;
&lt;p&gt;However, the event length given by the central will also change from phone-to-phone.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Try setting the min conn interval to 50 ms and see if this has any impact on the overall throughput.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Samiulhaq"]&lt;span&gt;Have you read&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/throughput-and-long-range-demo" rel="noopener noreferrer" target="_blank"&gt;this&lt;/a&gt;&amp;nbsp;blog&amp;nbsp;&lt;/span&gt;&lt;span&gt;in which they claim &amp;quot;&lt;strong&gt;The throughput measured may vary depending on the environment, but the maximum throughput should be around&amp;nbsp;1365 Kbps&amp;nbsp;for BLE 5 High Speed,&amp;nbsp;775 Kbps&amp;nbsp;for BLE 4.2,&amp;nbsp;128 Kbps&amp;nbsp;for BLE 4.1 and&amp;nbsp;21.3&amp;nbsp;Kbps for BLE 5 Long Range. Be aware that there may be some inaccuracies in the measurements.&amp;quot;&amp;nbsp;&lt;/strong&gt;Your comment about this?&lt;/span&gt;[/quote]
&lt;p&gt;Your overall throughput will depend on what the parameters that the central device accepts. It is true that you can technically achieve these numbers, but that also depends on a phone that allows such optimal parameters.&lt;/p&gt;
[quote user="Samiulhaq"]My goal is to send the complete whole file at once not in chunks so that I can easily manage and control it on the mobile App side. I think NRF52 only sends small chunks at one time, not a complete large file, is that right?&amp;nbsp; If Yes, what will be the other fastest way to such a large file to the mobile App?[/quote]
&lt;p&gt;You have to transfer the file in chunks of the max. data length that you can send, ie. 244 bytes in your scenario.&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: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/387854?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2022 09:28:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90b6c5ca-f707-48a3-bab3-ee4b1a0e4956</guid><dc:creator>Samiulhaq</dc:creator><description>&lt;p&gt;Hello Hakon, thanks for your reply.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/387820"]If you&amp;#39;re sending, over BLE, in chunks of 243 bytes, your application is optimized wrt. size.[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Yes, I am sending data to the mobile App using &lt;strong&gt;ble_uart&amp;nbsp;&lt;/strong&gt;with the chunk size=&lt;strong&gt;BLE_NUS_MAX_DATA_LEN-3&lt;/strong&gt;&amp;nbsp;which in turn is equal to&amp;nbsp;&lt;strong&gt;NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247,&amp;nbsp;&lt;/strong&gt;so chunk size= 247-3= 244 bytes/chunks&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/387820"]What is the throughput that you&amp;#39;re seeing?[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Does throughput mean bytes/second? If yes, my current throughput is&amp;nbsp;55,000 bytes/second. For this, I have the chunks size= 247-3= 244bytes/chunk,&amp;nbsp;&lt;span&gt;&lt;strong&gt;NRF_SDH_BLE_GAP_EVENT_LENGTH&lt;/strong&gt;=&amp;nbsp;&lt;strong&gt;100&amp;nbsp;&lt;/strong&gt; and&amp;nbsp;&lt;strong&gt;MIN_CONN_INTERVAL and MAX_CONN_INTERVAL&amp;nbsp;&lt;/strong&gt;to 7.5 and 200 respectively&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/387820"]Q2: Have you tried adjusting sdk_config.h::NRF_SDH_BLE_GAP_EVENT_LENGTH?[/quote]
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Yes, I have changed that value to 100(of course by changing the RAM start address), by doing this the rate of sending chunks/seconds is increased. Also, I have changed the&amp;nbsp;&lt;strong&gt;MIN_CONN_INTERVAL and MAX_CONN_INTERVAL&amp;nbsp;&lt;/strong&gt;to &lt;strong&gt;7.5&lt;/strong&gt; and &lt;strong&gt;200&lt;/strong&gt; respectively which also increases the rate. But the bytes/chunk is 244&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/92228/sending-a-complete-file-at-once-from-sd-card-to-mobile-app-using-nrf52840/387820"]Note that you&amp;#39;re sending a large amount of data, and it will take a long time. Assume you&amp;#39;re getting 300 kBit/s (37.5 kByte/s), it will take approx. 7000 seconds (~2hours) to send this amount of data.[/quote]
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Have you read&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/throughput-and-long-range-demo" rel="noopener noreferrer" target="_blank"&gt;this&lt;/a&gt;&amp;nbsp;blog&amp;nbsp;&lt;/span&gt;&lt;span&gt;in which they claim &amp;quot;&lt;strong&gt;The throughput measured may vary depending on the environment, but the maximum throughput should be around&amp;nbsp;1365 Kbps&amp;nbsp;for BLE 5 High Speed,&amp;nbsp;775 Kbps&amp;nbsp;for BLE 4.2,&amp;nbsp;128 Kbps&amp;nbsp;for BLE 4.1 and&amp;nbsp;21.3&amp;nbsp;Kbps for BLE 5 Long Range. Be aware that there may be some inaccuracies in the measurements.&amp;quot;&amp;nbsp;&lt;/strong&gt;Your comment about this?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My goal is to send the complete whole file at once not in chunks so that I can easily manage and control it on the mobile App side. I think NRF52 only sends small chunks at one time, not a complete large file, is that right?&amp;nbsp; If Yes, what will be the other fastest way to such a large file to the mobile App?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Sami&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/387820?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2022 08:02:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bbd38a5-42d6-4be3-8c56-bc24128b53df</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Sami,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re sending, over BLE, in chunks of 243 bytes, your application is optimized wrt. size.&lt;/p&gt;
&lt;p&gt;Q1: What is the throughput that you&amp;#39;re seeing?&lt;/p&gt;
&lt;p&gt;Q2: Have you tried adjusting sdk_config.h::NRF_SDH_BLE_GAP_EVENT_LENGTH?&lt;/p&gt;
&lt;p&gt;Note that you might need to adjust the RAM start address to accommodate the added RAM requirements that the stack needs.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note that you&amp;#39;re sending a large amount of data, and it will take a long time. Assume you&amp;#39;re getting 300 kBit/s (37.5 kByte/s), it will take approx. 7000 seconds (~2hours) to send this amount of data.&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: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/387792?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2022 05:05:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c480316e-5c63-4f76-afb8-a824938a0e92</guid><dc:creator>Samiulhaq</dc:creator><description>&lt;p&gt;Hi Hakon, thank you for your kind suggestion. Yes, I am sending the data in the size of&amp;nbsp;&lt;strong&gt;&amp;quot;BLE_NUS_MAX_DATA_LEN&amp;quot;(&lt;/strong&gt;&amp;nbsp;243byte) but it can&amp;#39;t solve my problem because the data is sent in chunks of 243bytes per chunk and I want to send the complete file at once, not in chunks.&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;My file size is about 240MB, will it be fully sent to the mobile App at once? If yes Can you please recommend to me the fastest possible way?&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Sami&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending a complete file at once from SD card to Mobile App using NRF52840.</title><link>https://devzone.nordicsemi.com/thread/387714?ContentTypeID=1</link><pubDate>Fri, 23 Sep 2022 14:40:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84846070-ad19-474d-80b8-52da3de3082c</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;
[quote user=""]sends it byte by byte to the mobile app[/quote]
&lt;p&gt;Buffer up the&amp;nbsp;read out data from the SD card and send them in size of &amp;quot;BLE_NUS_MAX_DATA_LEN&amp;quot; instead?&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>