<?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>File transfer/large data transfer example NRF Connect sdk</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83562/file-transfer-large-data-transfer-example-nrf-connect-sdk</link><description>Hi, 
 I am trying to transfer a dataset of over 100k, via a custom service from a peripheral device. 
 There are many posts in this forum that describe ways to do this but none seem to apply to the newer nrf Connect SDK. I am using nrf connect 1.7.1 with</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Jan 2022 14:40:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83562/file-transfer-large-data-transfer-example-nrf-connect-sdk" /><item><title>RE: File transfer/large data transfer example NRF Connect sdk</title><link>https://devzone.nordicsemi.com/thread/350009?ContentTypeID=1</link><pubDate>Thu, 27 Jan 2022 14:40:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1577adee-11e6-4da7-af3e-b6c68d6e3ceb</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I got some progress here, I added these to the peripheral_uart sample (NCS v1.8.0):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_ATT_PREPARE_COUNT=2
CONFIG_BT_L2CAP_TX_BUF_COUNT=10
CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_BT_CTLR_RX_BUFFERS=2
CONFIG_BT_BUF_ACL_TX_COUNT=10
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and changed&amp;nbsp;MTU_SIZE to 244, such that&amp;nbsp;bt_nus_send would send 244 block at the time. Then I achieved a speed of&amp;nbsp;46511.6 bytes/second=372kbps. I communicated with the nRF Connect Mobile app. From the mobile app you have to enable notification for the TX char and request an MTU of 250 bytes.&lt;/p&gt;
&lt;p&gt;I also increased TEST_BUF_SIZE to 20000, such that a total of 20k bytes would be sent.&lt;/p&gt;
&lt;p&gt;Is this fast enough speed for your purpose? If not try to increase the connection interval to 400ms (tell me if you need help with this).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Here is the changes I applied to the peripheral_uart sample:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;diff --git a/samples/bluetooth/peripheral_uart/prj.conf b/samples/bluetooth/peripheral_uart/prj.conf
index e5262de64..d3e77f24e 100644
--- a/samples/bluetooth/peripheral_uart/prj.conf
+++ b/samples/bluetooth/peripheral_uart/prj.conf
@@ -1,50 +1,65 @@
-#
-# Copyright (c) 2018 Nordic Semiconductor
-#
-# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
-#
-
-# Enable the UART driver
-CONFIG_UART_ASYNC_API=y
-CONFIG_NRFX_UARTE0=y
-CONFIG_SERIAL=y
-
-CONFIG_GPIO=y
-
-# Make sure printk is printing to the UART console
-CONFIG_CONSOLE=y
-CONFIG_UART_CONSOLE=y
-
-CONFIG_HEAP_MEM_POOL_SIZE=2048
-
-CONFIG_BT=y
-CONFIG_BT_PERIPHERAL=y
-CONFIG_BT_DEVICE_NAME=&amp;quot;Nordic_UART_Service&amp;quot;
-CONFIG_BT_DEVICE_APPEARANCE=833
-CONFIG_BT_MAX_CONN=1
-CONFIG_BT_MAX_PAIRED=1
-
-# Enable the NUS service
-CONFIG_BT_NUS=y
-
-# Enable bonding
-CONFIG_BT_SETTINGS=y
-CONFIG_FLASH=y
-CONFIG_FLASH_PAGE_LAYOUT=y
-CONFIG_FLASH_MAP=y
-CONFIG_NVS=y
-CONFIG_SETTINGS=y
-
-# Enable DK LED and Buttons library
-CONFIG_DK_LIBRARY=y
-
-# This example requires more workqueue stack
-CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
-
-# Config logger
-CONFIG_LOG=y
-CONFIG_USE_SEGGER_RTT=y
-CONFIG_LOG_BACKEND_RTT=y
-CONFIG_LOG_BACKEND_UART=n
-
-CONFIG_ASSERT=y
+#
+# Copyright (c) 2018 Nordic Semiconductor
+#
+# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
+#
+
+# Enable the UART driver
+CONFIG_UART_ASYNC_API=y
+CONFIG_NRFX_UARTE0=y
+CONFIG_SERIAL=y
+
+CONFIG_GPIO=y
+
+# Make sure printk is printing to the UART console
+CONFIG_CONSOLE=y
+CONFIG_UART_CONSOLE=y
+
+CONFIG_HEAP_MEM_POOL_SIZE=2048
+
+CONFIG_BT=y
+CONFIG_BT_PERIPHERAL=y
+CONFIG_BT_DEVICE_NAME=&amp;quot;Nordic_UART_Service&amp;quot;
+CONFIG_BT_DEVICE_APPEARANCE=833
+CONFIG_BT_MAX_CONN=1
+CONFIG_BT_MAX_PAIRED=1
+
+# Enable the NUS service
+CONFIG_BT_NUS=y
+
+# Enable bonding
+CONFIG_BT_SETTINGS=y
+CONFIG_FLASH=y
+CONFIG_FLASH_PAGE_LAYOUT=y
+CONFIG_FLASH_MAP=y
+CONFIG_NVS=y
+CONFIG_SETTINGS=y
+
+# Enable DK LED and Buttons library
+CONFIG_DK_LIBRARY=y
+
+# This example requires more workqueue stack
+CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
+
+# Config logger
+CONFIG_LOG=y
+CONFIG_USE_SEGGER_RTT=y
+CONFIG_LOG_BACKEND_RTT=y
+CONFIG_LOG_BACKEND_UART=n
+
+CONFIG_ASSERT=y
+CONFIG_BT_USER_DATA_LEN_UPDATE=y
+
+
+CONFIG_BT_BUF_ACL_RX_SIZE=251
+#CONFIG_BT_GATT_CLIENT=y
+CONFIG_BT_ATT_PREPARE_COUNT=2
+#CONFIG_BT_CONN_TX_MAX=10
+CONFIG_BT_L2CAP_TX_BUF_COUNT=10
+CONFIG_BT_L2CAP_TX_MTU=247
+#CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
+#CONFIG_BT_CTLR_PHY_2M=y
+CONFIG_BT_CTLR_RX_BUFFERS=2
+CONFIG_BT_BUF_ACL_TX_COUNT=10
+CONFIG_BT_BUF_ACL_TX_SIZE=251
+CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
\ No newline at end of file
diff --git a/samples/bluetooth/peripheral_uart/src/main.c b/samples/bluetooth/peripheral_uart/src/main.c
index 2acac0051..37ad3724b 100644
--- a/samples/bluetooth/peripheral_uart/src/main.c
+++ b/samples/bluetooth/peripheral_uart/src/main.c
@@ -240,7 +240,7 @@ static int uart_init(void)
 		return -ENXIO;
 	}
 
-	if (IS_ENABLED(CONFIG_USB_DEVICE_STACK)) {
+	if (IS_ENABLED(CONFIG_USB)) {
 		err = usb_enable(NULL);
 		if (err) {
 			LOG_ERR(&amp;quot;Failed to enable USB&amp;quot;);
@@ -319,6 +319,30 @@ static int uart_init(void)
 	return uart_rx_enable(uart, rx-&amp;gt;data, sizeof(rx-&amp;gt;data), 50);
 }
 
+static void le_param_updated(struct bt_conn *conn, uint16_t interval,
+			     uint16_t latency, uint16_t timeout)
+{
+	printk(&amp;quot;Connection parameters updated.\n&amp;quot;
+	       &amp;quot; interval: %d, latency: %d, timeout: %d\n&amp;quot;,
+	       interval, latency, timeout);
+
+}
+
+static void le_data_length_updated(struct bt_conn *conn,
+				   struct bt_conn_le_data_len_info *info)
+{
+	/*if (!data_length_req) {
+		return;
+	}*/
+
+	printk(&amp;quot;LE data len updated: TX (len: %d time: %d)&amp;quot;
+	       &amp;quot; RX (len: %d time: %d)\n&amp;quot;, info-&amp;gt;tx_max_len,
+	       info-&amp;gt;tx_max_time, info-&amp;gt;rx_max_len, info-&amp;gt;rx_max_time);
+
+	/*data_length_req = false;
+	k_sem_give(&amp;amp;throughput_sem);*/
+}
+
 static void connected(struct bt_conn *conn, uint8_t err)
 {
 	char addr[BT_ADDR_LE_STR_LEN];
@@ -377,6 +401,8 @@ static void security_changed(struct bt_conn *conn, bt_security_t level,
 static struct bt_conn_cb conn_callbacks = {
 	.connected    = connected,
 	.disconnected = disconnected,
+	.le_param_updated = le_param_updated,
+	.le_data_len_updated = le_data_length_updated,
 #ifdef CONFIG_BT_NUS_SECURITY_ENABLED
 	.security_changed = security_changed,
 #endif
@@ -415,6 +441,18 @@ static void auth_cancel(struct bt_conn *conn)
 }
 
 
+static void pairing_confirm(struct bt_conn *conn)
+{
+	char addr[BT_ADDR_LE_STR_LEN];
+
+	bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
+
+	bt_conn_auth_pairing_confirm(conn);
+
+	LOG_INF(&amp;quot;Pairing confirmed: %s&amp;quot;, log_strdup(addr));
+}
+
+
 static void pairing_complete(struct bt_conn *conn, bool bonded)
 {
 	char addr[BT_ADDR_LE_STR_LEN];
@@ -441,6 +479,7 @@ static struct bt_conn_auth_cb conn_auth_callbacks = {
 	.passkey_display = auth_passkey_display,
 	.passkey_confirm = auth_passkey_confirm,
 	.cancel = auth_cancel,
+	.pairing_confirm = pairing_confirm,
 	.pairing_complete = pairing_complete,
 	.pairing_failed = pairing_failed
 };
@@ -555,9 +594,29 @@ static void configure_gpio(void)
 		LOG_ERR(&amp;quot;Cannot init LEDs (err: %d)&amp;quot;, err);
 	}
 }
+#define MTU_SIZE 244
+#define BYTES_TO_SEND 20000
+
+uint8_t dummy[MTU_SIZE];
+uint64_t stamp;
+int64_t delta;
+
+#define PIN_GPIO  (31UL)
 
 void main(void)
 {
+	for(int x=0; x&amp;lt; MTU_SIZE;x++){
+		dummy[x] = x;
+		//printk(&amp;quot;dummy[%d] = %d\n&amp;quot;, x, dummy[x]);
+	}
+
+	NRF_GPIO-&amp;gt;PIN_CNF[PIN_GPIO] = (GPIO_PIN_CNF_DIR_Output &amp;lt;&amp;lt; GPIO_PIN_CNF_DIR_Pos) |
+							(GPIO_PIN_CNF_DRIVE_S0S1 &amp;lt;&amp;lt; GPIO_PIN_CNF_DRIVE_Pos) |
+							(GPIO_PIN_CNF_INPUT_Connect &amp;lt;&amp;lt; GPIO_PIN_CNF_INPUT_Pos) |
+							(GPIO_PIN_CNF_PULL_Disabled &amp;lt;&amp;lt; GPIO_PIN_CNF_PULL_Pos) |
+							(GPIO_PIN_CNF_SENSE_Disabled &amp;lt;&amp;lt; GPIO_PIN_CNF_SENSE_Pos);
+
+	//LOG_INF(&amp;quot;LOG_INF, Delta: %lld ms&amp;quot;, delta);
 	int blink_status = 0;
 	int err = 0;
 
@@ -615,12 +674,36 @@ void ble_write_thread(void)
 		/* Wait indefinitely for data to be sent over bluetooth */
 		struct uart_data_t *buf = k_fifo_get(&amp;amp;fifo_uart_rx_data,
 						     K_FOREVER);
+		LOG_INF(&amp;quot;Start transmission of %d bytes&amp;quot;, BYTES_TO_SEND);
+		stamp = k_uptime_get_32();
+		NRF_GPIO-&amp;gt;OUTSET = (1UL &amp;lt;&amp;lt; PIN_GPIO);  //turns led (P0.17) off
+		NRF_GPIO-&amp;gt;OUTCLR = (1UL &amp;lt;&amp;lt; PIN_GPIO); 
+
+		for(int y =0; y&amp;lt; BYTES_TO_SEND; y+=MTU_SIZE){
+			//LOG_INF(&amp;quot;y=%d/%d\n&amp;quot;, y, BYTES_TO_SEND);
+			if (bt_nus_send(NULL, dummy, MTU_SIZE)) {
+				LOG_WRN(&amp;quot;.&amp;quot;); //failed
+			}else{
+				LOG_INF(&amp;quot;-&amp;quot;); //success
+			}
+		}
+		delta = k_uptime_delta(&amp;amp;stamp); //k_uptime_delta(&amp;amp;stamp);
+		//LOG_INF(&amp;quot;Should be 3000 ms| it is %&amp;quot; PRId64&amp;quot;  ms&amp;quot;, delta);
+		printk(&amp;quot;Delta: %lld ms\n&amp;quot;, delta);
+		LOG_INF(&amp;quot;Transmission ended&amp;quot;);
+		NRF_GPIO-&amp;gt;OUTSET = (1UL &amp;lt;&amp;lt; PIN_GPIO);  //turns led (P0.17) off
+		NRF_GPIO-&amp;gt;OUTCLR = (1UL &amp;lt;&amp;lt; PIN_GPIO); 
+		printk(&amp;quot;Sent %d bytes (%u KB) in %lld ms\n&amp;quot;,
+	       BYTES_TO_SEND, BYTES_TO_SEND / 1024, delta); //, ((uint64_t)data * 8 / delta));
+		/* Wait indefinitely for data to be sent over bluetooth */
+		/*struct uart_data_t *buf = k_fifo_get(&amp;amp;fifo_uart_rx_data,
+						     K_FOREVER);
 
 		if (bt_nus_send(NULL, buf-&amp;gt;data, buf-&amp;gt;len)) {
 			LOG_WRN(&amp;quot;Failed to send data over BLE connection&amp;quot;);
 		}
 
-		k_free(buf);
+		k_free(buf);*/
 	}
 }
 
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File transfer/large data transfer example NRF Connect sdk</title><link>https://devzone.nordicsemi.com/thread/349591?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 14:56:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9811de7b-5905-488b-846d-d3ab2f9e020d</guid><dc:creator>cosmotic_instant</dc:creator><description>&lt;p&gt;Thank you.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From my own testing, it seems you can enter a while loop, continuously adding a single byte to the send buffer, and not get a failure to add using&amp;nbsp;&lt;strong&gt;bt_gatt_notify_cb.&amp;nbsp;&lt;/strong&gt;I think it&amp;#39;s probably unlikely it is sending faster than the core could add to the buffer, so does this imply that this function call is blocking?&lt;br /&gt;&lt;br /&gt;I am more interested in how the code works and how to manipulate it than getting the highest performance at this stage.&lt;/p&gt;
&lt;p&gt;So why are you limiting the data size you add in your test function by the MTU size? My understanding is that MTU is a term used in the ATT layer, and the application uses Data Length? Do you have to manually chunk data this way? I thought the point of the MTU, is that is the payload size to which your Data Length will be chunked.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File transfer/large data transfer example NRF Connect sdk</title><link>https://devzone.nordicsemi.com/thread/349502?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 11:14:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc49dfd4-6571-452b-8471-0b820a42d0e1</guid><dc:creator>Simon</dc:creator><description>[quote user="cosmotic_instant"]Were the measurements that you have taken done with nRF connect SDK? I know that there is plenty of support on this forum for Nrf5 SDK but i am struggling to get examples for the connect SDK, using Zephyr&amp;#39;s Bluetooth implementation. As that is now the recommended way of developing moving forward for Nordic, I started developing using the NCS. I know the BLE theory is the same, but how you setup characteristics etc is not.&amp;nbsp;[/quote]
&lt;p&gt;I used the nRF Connect SDK, see &lt;a href="https://github.com/nrfconnect/sdk-nrf/tree/main/samples/bluetooth"&gt;https://github.com/nrfconnect/sdk-nrf/tree/main/samples/bluetooth&lt;/a&gt;.&lt;/p&gt;
[quote user="cosmotic_instant"]The answer you linked to&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/25841/can-i-achieve-160kbps-through-ble4-2/101785#101785"&gt;This answer&lt;/a&gt;, appears to reference a softdevice. The Zephyr implementation doesn&amp;#39;t use a soft device correct? it&amp;#39;s an open source implementation software implementation that is built along with the zephyr OS?&amp;nbsp;[/quote]
&lt;p&gt;In the reply I linked to, the nRF5 SDK was used. It was not meant as a guide exactly how to improve the speed in Zephyr/NCS, but rather what parameters you should use. In NCS&amp;nbsp;BLE samples, we use the SoftDevice Controller (similar to the SoftDevice). You can also use the Zephyr BLE controller.&lt;/p&gt;
[quote user="cosmotic_instant"]&lt;p&gt;How can i find the size of the TX buffers? I assume these can be altered?&lt;/p&gt;
&lt;p&gt;Your test only sends 2000 bytes (or 200 packets @ 20&amp;nbsp;mtu size. What you have demonstrated is 36kbps but on a data set that is smaller than the tx buffer size. If it were larger, you probably could not add in a for loop as you are showing, without the function failing when it fills. I will try this example until it fails and continue to add the next packet until it is successful. This way, the throughput should be the same. Though, it does seem a shame to not a more event driven method of doing this.&lt;/p&gt;
&lt;p&gt;I guess, if i know the TX buffer size, i also know based on the already measured throughput, how long it will take to empty the buffer. So once i receive a fail, i can sleep until i expect it to be say half empty, before attempting to add the next packets. This will give a yield point instead of being stuck in an endless loop of attempting to add to the transmit queue.&lt;/p&gt;
&lt;p&gt;Any news on the Long read?&lt;/p&gt;[/quote]
&lt;p&gt;I will get back to you on these question, and will try to put off some time the next days to try to achive a speed close to&amp;nbsp;&lt;span&gt;1400&amp;nbsp;&lt;/span&gt;&lt;span&gt;kbps.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File transfer/large data transfer example NRF Connect sdk</title><link>https://devzone.nordicsemi.com/thread/348794?ContentTypeID=1</link><pubDate>Thu, 20 Jan 2022 17:58:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30646222-d14c-466e-a58d-1fe0ce248edf</guid><dc:creator>cosmotic_instant</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Were the measurements that you have taken done with nRF connect SDK? I know that there is plenty of support on this forum for Nrf5 SDK but i am struggling to get examples for the connect SDK, using Zephyr&amp;#39;s Bluetooth implementation. As that is now the recommended way of developing moving forward for Nordic, I started developing using the NCS. I know the BLE theory is the same, but how you setup characteristics etc is not.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The answer you linked to&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/25841/can-i-achieve-160kbps-through-ble4-2/101785#101785"&gt;This answer&lt;/a&gt;, appears to reference a softdevice. The Zephyr implementation doesn&amp;#39;t use a soft device correct? it&amp;#39;s an open source implementation software implementation that is built along with the zephyr OS?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How can i find the size of the TX buffers? I assume these can be altered?&lt;/p&gt;
&lt;p&gt;Your test only sends 2000 bytes (or 200 packets @ 20&amp;nbsp;mtu size. What you have demonstrated is 36kbps but on a data set that is smaller than the tx buffer size. If it were larger, you probably could not add in a for loop as you are showing, without the function failing when it fills. I will try this example until it fails and continue to add the next packet until it is successful. This way, the throughput should be the same. Though, it does seem a shame to not a more event driven method of doing this.&lt;/p&gt;
&lt;p&gt;I guess, if i know the TX buffer size, i also know based on the already measured throughput, how long it will take to empty the buffer. So once i receive a fail, i can sleep until i expect it to be say half empty, before attempting to add the next packets. This will give a yield point instead of being stuck in an endless loop of attempting to add to the transmit queue.&lt;/p&gt;
&lt;p&gt;Any news on the Long read?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File transfer/large data transfer example NRF Connect sdk</title><link>https://devzone.nordicsemi.com/thread/348791?ContentTypeID=1</link><pubDate>Thu, 20 Jan 2022 16:59:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8f17ef0-78d0-4ee5-b926-2671f68f865d</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I did some quick measurements using the peripheral_uart and the central_uart and I measured a speed of&amp;nbsp;4603bytes/second (36.8kbps), which is certainly better than 48bps.&lt;/p&gt;
&lt;p&gt;I sent the data accordingly from the peripheral_uart sample:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define MTU_SIZE 20
#define TEST_BUF_SIZE 2000

uint8_t test_buf[TEST_BUF_SIZE];
..


for(int y =0; y&amp;lt; TEST_BUF_SIZE; y+=MTU_SIZE){
	if (bt_nus_send(NULL, internal_data, MTU_SIZE)) {
		LOG_WRN(&amp;quot;.&amp;quot;); //failed
	}else{
		LOG_INF(&amp;quot;-&amp;quot;); //success
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think you need to wait for on_sent, It seems like the Zephyr Bluetooth host will queue the data.&lt;/p&gt;
&lt;p&gt;By using the parameters mentions in&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/25841/can-i-achieve-160kbps-through-ble4-2/101785#101785"&gt;this answer&lt;/a&gt;&amp;nbsp;you can increase the speed even more.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File transfer/large data transfer example NRF Connect sdk</title><link>https://devzone.nordicsemi.com/thread/348077?ContentTypeID=1</link><pubDate>Mon, 17 Jan 2022 14:17:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5217563-84cc-4174-bac0-9a8db9bf7759</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I have not worked much with Bluetooth that much lately, and need to do some more research to fully answer all your question. But I will&amp;nbsp;try to answer your questions the best I can now.&lt;/p&gt;
[quote user="cosmotic_instant"]1. what is a standard way to implement large data transfer from a peripheral to a central device using nrf connect sdk? Should i initiate a read and then have the peripheral notify again and again? how will i know that i am not starting another notify before the previous has been fully sent? Is notify even the right thing to do? could i not just continue to send data chunks from a single data read request? Does this require a characteristic in the central device for the peripheral to write to in a loop?[/quote]
&lt;p&gt;I think notifications would be the most efficient way, see this answer&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/7052/what-is-the-difference-between-a-ble-central-reading-from-a-peripheral-versus-a-peripheral-notifying-the-central-in-term-of-resources-drained"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/7052/what-is-the-difference-between-a-ble-central-reading-from-a-peripheral-versus-a-peripheral-notifying-the-central-in-term-of-resources-drained&lt;/a&gt;&amp;nbsp;(it&amp;#39;s for the nRF5 SDK, but should be relevant for NCS as well)&lt;/p&gt;
[quote user="cosmotic_instant"]2. Using the suggested work queue worked fine, but waiting for the on_sent notification before sending another notify was very slow. It took a minute to transfer the word &amp;quot;hello&amp;quot;, a 500 times... a payload throughput of 48 Bps. I understand that the data length and mtu can be increased, but even if the payload size was 251, 8 transactions per second is a tiny number.&amp;nbsp;[/quote]
&lt;p&gt;According to &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/25841/can-i-achieve-160kbps-through-ble4-2/101785#101785"&gt;this answer&lt;/a&gt;&amp;nbsp;(nRF5 SDK), it should be possible to get a transfer speed of 1400&amp;nbsp;&lt;span&gt;kbps with the nRF52832, to achieve this you need to set the connection interval to 400ms, the MTU size to 247 bytes and enable DLE. Check out &lt;a href="https://www.novelbits.io/bluetooth-5-speed-maximum-throughput/"&gt;Bluetooth 5 speed maximum throughput&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I will try to do some tests with the peripheral_uart sample&amp;nbsp;(NCS) this week and see if I&amp;#39;m able to reach this speed.&lt;/span&gt;&lt;/p&gt;
[quote user="cosmotic_instant"]3. I see that there is also something referred to as a &amp;#39;long read&amp;#39; in the peripheral example. What is this and how does it work? should i be using this instead of notify?[/quote]
&lt;p&gt;I will get back to you on this.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File transfer/large data transfer example NRF Connect sdk</title><link>https://devzone.nordicsemi.com/thread/347631?ContentTypeID=1</link><pubDate>Thu, 13 Jan 2022 14:58:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bb5a2c6-ea1e-4b64-93e7-1c611dc5c478</guid><dc:creator>cosmotic_instant</dc:creator><description>&lt;p&gt;Thank you for the reply Simon.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I see that this is a good solution for handling ISR generated callbacks.&lt;/p&gt;
&lt;p&gt;The questions that i still need answering&amp;nbsp;are as follows:&lt;/p&gt;
&lt;p&gt;1. what is a standard way to implement large data transfer from a peripheral to a central device using nrf connect sdk? Should i initiate a read and then have the peripheral notify again and again? how will i know that i am not starting another notify before the previous has been fully sent? Is notify even the right thing to do? could i not just continue to send data chunks from a single data read request? Does this require a characteristic in the central device for the peripheral to write to in a loop?&lt;/p&gt;
&lt;p&gt;2. Using the suggested work queue worked fine, but waiting for the on_sent notification before sending another notify was very slow. It took a minute to transfer the word &amp;quot;hello&amp;quot;, a 500 times... a payload throughput of 48 Bps. I understand that the data length and mtu can be increased, but even if the payload size was 251, 8 transactions per second is a tiny number.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;3. I see that there is also something referred to as a &amp;#39;long read&amp;#39; in the peripheral example. What is this and how does it work? should i be using this instead of notify?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am using the nrf52832 on the nRF52 dk.&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File transfer/large data transfer example NRF Connect sdk</title><link>https://devzone.nordicsemi.com/thread/347437?ContentTypeID=1</link><pubDate>Wed, 12 Jan 2022 15:55:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b78a2d7-1825-4dac-94a0-46625581d038</guid><dc:creator>Simon</dc:creator><description>[quote user=""]Is the advised way of doing this still calling notify on a characteristic? I have attempted to call Notify inside an on_sent callback but the code doesn&amp;#39;t appear to call callbacks when already executing inside of one.[/quote]
&lt;p&gt;Try using &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.8.0/zephyr/reference/kernel/threads/workqueue.html"&gt;work queues&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Take a look at the peripheral_hr_coded sample to see how to implement a work queue:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v1.8.0/samples/bluetooth/peripheral_hr_coded/src/main.c#L25"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v1.8.0/samples/bluetooth/peripheral_hr_coded/src/main.c#L25&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v1.8.0/samples/bluetooth/peripheral_hr_coded/src/main.c#L119"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v1.8.0/samples/bluetooth/peripheral_hr_coded/src/main.c#L119&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v1.8.0/samples/bluetooth/peripheral_hr_coded/src/main.c#L64"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v1.8.0/samples/bluetooth/peripheral_hr_coded/src/main.c#L64&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v1.8.0/samples/bluetooth/peripheral_hr_coded/src/main.c#L100-L111"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v1.8.0/samples/bluetooth/peripheral_hr_coded/src/main.c#L100-L111&lt;/a&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></channel></rss>