<?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>nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/94053/nrf5340-is-unable-to-trigger-rpmsg-ipc-transfer</link><description>Hi, 
 I have quite demanding SPI device which should send its data over BLE. Thanks to throughput example i was able to achieve maximum transfer speeds for synthetic tests (without SPI). Sadly after adding real data input, I noticed that no transfer is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Dec 2022 21:20:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/94053/nrf5340-is-unable-to-trigger-rpmsg-ipc-transfer" /><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/399276?ContentTypeID=1</link><pubDate>Tue, 06 Dec 2022 21:20:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10428da9-37d2-4817-bdcb-517cca32fa9f</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry for the late reply. I was unexpectedly out of office since Thursday.&lt;/p&gt;
&lt;p&gt;That would be great. If I can have a look, reproduce it and run it by our SoftDevice controller, I can ask them whether they have any hints on whether it is the intended workflow, or if this is in fact a bug.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/399254?ContentTypeID=1</link><pubDate>Tue, 06 Dec 2022 17:25:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9974485f-e8b0-42e5-b1d8-a629aeb61a1a</guid><dc:creator>Dumam</dc:creator><description>&lt;p&gt;Both nrf52840 and nrf5340 have bigger throughput with Zephyr stack.&lt;br /&gt;If I replace this with SoftDevice stack, then throughput drops to 500kbps.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/edvin-holmseth"&gt;Edvin&lt;/a&gt;&amp;nbsp;If you&amp;#39;re interested I can prepare an example project which will reproduce my case only with two nrf5340 boards, without any SPI device (it can be in loopback).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/398867?ContentTypeID=1</link><pubDate>Sat, 03 Dec 2022 09:52:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b33cd491-7bc2-4a19-b610-8c74d9cba67f</guid><dc:creator>Dumam</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;The issue persists. I was able to partially overcome it, by changing net core BLE Stack implementation in&amp;nbsp;hci_rpmsg_nrf5340dk_nrf5340_cpuapp.conf to:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;# select ll layer
CONFIG_BT_LL_SW_SPLIT=y
CONFIG_BT_LL_SOFTDEVICE=n
#CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=4000000
&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After this change, I was able to achieve 1,1Mbps of throughput.&amp;nbsp;&lt;br /&gt;I still will be fighting with this code to reach 1,4Mbps, but It can be hard to do so.&lt;br /&gt;&lt;br /&gt;According to System View, not much room left for processing.&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1670061128940v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;If I find something useful, I will post it here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/398416?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2022 21:16:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e2ae066-9b00-4afd-a309-dec539be1197</guid><dc:creator>Dumam</dc:creator><description>&lt;p&gt;Thanks for this reply, but:&lt;br /&gt;&lt;br /&gt;1. I posted URL to my code where you can easily track that I&amp;#39;m not using work queue but separate thread.&lt;br /&gt; I posted a print screen from Seeger System View, where there is only info about thread&lt;br /&gt;2. I call there bt_gatt_write_without_response_cb(), which calls &lt;span&gt;bt_gatt_write_without_response_cb(). This &lt;/span&gt;calls still blocks thread execution.&amp;nbsp;&lt;br /&gt;3. My issues are the same as ones mentioned here, for the same board, for the same situation:&lt;br /&gt;What&amp;#39;s different in my case is that I&amp;#39;m using a `write without response` not notify.&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/92582/fast-notifications-with-nrf5340-and-nrf-connect-sdk"&gt;Fast notifications with nRF5340 and nRF Connect SDK&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;4. For this board, if you use BLE stack anywhere, then net CPU is included.&lt;br /&gt;This converts the project to multicore one and adds a simple rpmsg project for net-core and installs SoftDevice by default on it.&lt;br /&gt;After that in config you can also see that HCI RPMSG stack is enabled for app core.&amp;nbsp;&lt;br /&gt;So every command from app-core to HCI BLE is sent via RPMSG module.&lt;br /&gt;This module uses RPROC protocol and MBOX module to sync over IPC. &lt;br /&gt;Sadly, to process this in correct manner, MBOX module is using WORKQUEUE.&lt;br /&gt;&lt;br /&gt;I guess this is the main reason for locks.&lt;br /&gt;If this issue is true.&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/93785/bt_gatt_notify-can-block-when-running-on-zephyr-workqueue"&gt;bt_gatt_notify() can block when running on Zephyr workqueue.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;5. nrf52840 has different driver HCI RPC, but there is similar WORKQUEUE implemented to sync with SoftDevice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/398305?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2022 11:33:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f09cde6-905d-463c-8969-08ea9f7465e4</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Can you please check my colleague, Einar&amp;#39;s replies in this ticket:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/93785/bt_gatt_notify-can-block-when-running-on-zephyr-workqueue"&gt;bt_gatt_notify() can block when running on Zephyr workqueue.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In general, you should not call bt_gatt_notify_cb() from a workqueue, because it can lead to a deadlock, or in some cases, blocking calls, as you see here. Try calling it from another context.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/398211?ContentTypeID=1</link><pubDate>Tue, 29 Nov 2022 23:25:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e509bdc2-8fc7-42f5-ab9b-85b7843d1f87</guid><dc:creator>Dumam</dc:creator><description>&lt;p&gt;Dear&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/edvin-holmseth"&gt;Edvin&lt;/a&gt;&amp;nbsp;&lt;br /&gt;bt_write_without_response is locking function, which is bad for me because my SPI do not have time to prepare new data for connection event.&amp;nbsp;&lt;br /&gt;I&amp;#39;m looking for something what will help me in determining if i have still space in in my TX buffers.&lt;br /&gt;According to&amp;nbsp;&lt;a href="https://docs.zephyrproject.org/2.6.0/reference/bluetooth/l2cap.html?highlight=l2cap"&gt;docs.zephyrproject.org/.../l2cap.html&lt;/a&gt;&amp;nbsp;, there is nothing like that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/397993?ContentTypeID=1</link><pubDate>Tue, 29 Nov 2022 03:02:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:feb1073e-9aba-4c90-a005-fb51e61643a4</guid><dc:creator>Dumam</dc:creator><description>&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Zrzut-ekranu_5F00_20221129_5F00_035943.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/397992?ContentTypeID=1</link><pubDate>Tue, 29 Nov 2022 02:56:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:502ecf37-8a60-4242-b664-e1ff050dc4c8</guid><dc:creator>Dumam</dc:creator><description>&lt;p&gt;Ok, I added BLE call inside SPI callback.&lt;br /&gt;&lt;a id="" href="https://github.com/DuMaM/bitly_nrf5x/pull/13"&gt;https://github.com/DuMaM/bitly_nrf5x/pull/13&lt;br /&gt;&lt;/a&gt;I got even worse performance ;(&amp;nbsp;&lt;br /&gt;&lt;br /&gt;BTW. I&amp;#39;m using bt_gett_write_without_response, which is under the hood:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;static inline int bt_gatt_write_without_response(struct bt_conn *conn,
						 uint16_t handle, const void *data,
						 uint16_t length, bool sign)
{
	return bt_gatt_write_without_response_cb(conn, handle, data, length,
						 sign, NULL, NULL);
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/397846?ContentTypeID=1</link><pubDate>Mon, 28 Nov 2022 11:54:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f59d50b-09d8-4131-95ef-92fe51772d07</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I believe it is rather the work queue holding you back than the BLE stack. You can try to either skip the work queue, and call the bt_gatt_notify_cb() directly from your spi callback handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/397525?ContentTypeID=1</link><pubDate>Fri, 25 Nov 2022 03:10:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85eec2f3-0899-4139-8b56-79592562e817</guid><dc:creator>Dumam</dc:creator><description>&lt;p&gt;I also increased systick speed and this didnt helped.&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;# clock settings
# https://github.com/zephyrproject-rtos/zephyr/issues/28469#issuecomment-704164283
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/kernel/services/timing/clocks.html
# https://devzone.nordicsemi.com/f/nordic-q-a/92297/increasing-cpu-clock-frequency-for-bl653
CONFIG_NRF_RTC_TIMER=n
CONFIG_CORTEX_M_SYSTICK=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=64000000
CONFIG_SYS_CLOCK_TICKS_PER_SEC=6400000
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/397524?ContentTypeID=1</link><pubDate>Fri, 25 Nov 2022 03:09:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5183472-b918-4af6-8864-01a8e4b070dc</guid><dc:creator>Dumam</dc:creator><description>[quote userid="26071" url="~/f/nordic-q-a/94053/nrf5340-is-unable-to-trigger-rpmsg-ipc-transfer/397343"]&lt;p&gt;Whether or not that is recursive, I am not sure. That is, if you have queued packet #1 and #2 when packet #1 goes on air. Then you queue packet #3 before packet #2 has started airing, I am not sure whether it will change the &amp;quot;more data&amp;quot; bit in packet #2 or not. If not, then all packets needs to be queued before the connection event starts.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;As far as I can tell, write request is locked since there will be a free space in rpmsg buffer.&lt;br /&gt;I don&amp;#39;t understand why I see only 2 work queue execution per, connection event, even thought I have more data prepared for transmission. I think this is a one of settings from RPMSG.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure about PPI. My guess is that SPI is taking too long, and I&amp;#39;m unable to provide next packet for BT_TX thread.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/397343?ContentTypeID=1</link><pubDate>Thu, 24 Nov 2022 09:41:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7b7e8f5-41e8-4321-955f-15d8e6b2a2e7</guid><dc:creator>Edvin</dc:creator><description>[quote user="Dumam"]Please do not close this ticket yet.[/quote]
&lt;p&gt;No problem. We can go on for a while more. Just please note that I will be out of office tomorrow, but I&amp;#39;ll be back on Monday.&lt;/p&gt;
&lt;p&gt;I am glad you figured it out! That makes sense. The data needs to be queued up before the connection event. Obviously, all individual packets needs to be queued before they go on air. And in each packet, there is a bit that says whether or not it has more data. So the Bluetooth stack (SoftDevice Controller) needs to at least be aware of the second packet before it starts transmitting the initial packet. Whether or not that is recursive, I am not sure. That is, if you have queued packet #1 and #2 when packet #1 goes on air. Then you queue packet #3 before packet #2 has started airing, I am not sure whether it will change the &amp;quot;more data&amp;quot; bit in packet #2 or not. If not, then all packets needs to be queued before the connection event starts.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As for the SPI. I am not aware of any SPI with EasyDMA samples in Zephyr, but you can set up a ppi approach. On how to use PPI, please see the sample found in NCS\zephyr\samples\boards\nrf\nrfx. What you can do here is to chain the transfer end event with a transfer start, so that it runs in the background, if that is what you are looking for. Then you would typically use a timer in counter mode to also count up, and then set an interrupt when the timer (counter) reaches a certain value, to then trigger a &amp;quot;timeout&amp;quot; interrupt in your application.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/397295?ContentTypeID=1</link><pubDate>Thu, 24 Nov 2022 02:52:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4545262d-8a56-4e3f-992b-c2a20506d3b8</guid><dc:creator>Dumam</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/edvin-holmseth"&gt;Edvin&lt;/a&gt;,&lt;br /&gt;&lt;br /&gt;You were right. There was problem with connection interval.&lt;br /&gt;Zephyr needs a constant feed of data at the beginning of a connection event.&lt;br /&gt;If this steam is not delivered, then the connection is instantly terminated.&lt;br /&gt;I was planning to just retransmit my SPI data without any additional buffering, but this will not work in that case.&lt;br /&gt;&lt;br /&gt;So, I increased SPI buffer, and now it provides space for data from 35ms long SPI stream.&lt;br /&gt;At the end, I was able to reach 0.5Mbits/s of throughput&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/2708.svg" title="Airplane"&gt;&amp;#x2708;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That&amp;#39;s so big step forward&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f64f.svg" title="Pray"&gt;&amp;#x1f64f;&lt;/span&gt;&amp;nbsp;thanks for this help.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sadly, I still require some help.&lt;br /&gt;I noticed that SPI is now a blocking factor.&amp;nbsp;&lt;br /&gt;Do you have nice example how to work with EasyDMA SPI in zephyr, so I can fetch data only on interrupt from it? Additional GPIO, takes too many CPU cycles in ISR, and it duplicates SPI work.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Please do not close this ticket yet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/397158?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2022 11:55:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d5d85f1-2175-4f7e-8da2-73bea3422733</guid><dc:creator>Dumam</dc:creator><description>[quote userid="26071" url="~/f/nordic-q-a/94053/nrf5340-is-unable-to-trigger-rpmsg-ipc-transfer/397115"]&lt;p&gt;For debugging purposes, what if you instead of calling&amp;nbsp;&lt;span&gt;bt_performance_test_write(), just add up the length of what you were going to send, and look at what sort of total length/throughput you would have got without actually sending the data? Is it still lower than only sending dummy data without the SPI?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;I checked this. I&amp;#39;m always sending 251 bytes.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;You gave me other idea how I can debug this. I will try to use dummy data with SPI in background and see if this is a problem on thread sync level or maybe some ISR/MCU components.&amp;nbsp;&lt;br /&gt;This way I separate&amp;nbsp;SPI thread from BLE one.&lt;br /&gt;&lt;br /&gt;Did you manage to find something on your side?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/397115?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2022 10:15:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b50ee9c9-f144-4ca6-adbd-47cefdbb29b7</guid><dc:creator>Edvin</dc:creator><description>[quote user="Dumam"]I&amp;#39;m not sure what you mean by `&lt;span&gt;No actual peripheral transferring data?`&lt;/span&gt;[/quote]
&lt;p&gt;I mean that you are not doing any SPI transactions inside that function, which means that you need to wait for the transaction to finish inside this callback? If so, that will introduce a delay.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Ok, we have a more similar understanding of what your project does now, which is a good thing &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;My claim is that bt_performance_test_write() does not care whether the data comes from a buffer of all 0&amp;#39;s or a buffer consisting of SPI data. So the lower throughput has to come from elsewhere.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For debugging purposes, what if you instead of calling&amp;nbsp;&lt;span&gt;bt_performance_test_write(), just add up the length of what you were going to send, and look at what sort of total length/throughput you would have got without actually sending the data? Is it still lower than only sending dummy data without the SPI?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BR,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/396987?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 15:42:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3c21e4e-f364-49ff-9041-88c2a8cd5244</guid><dc:creator>Dumam</dc:creator><description>&lt;div class="content full threaded-reply-content user-defined-markup" data-replyid="396975" data-userid="26071" data-permalink="~/f/nordic-q-a/94053/nrf5340-is-unable-to-trigger-rpmsg-ipc-transfer/396975"&gt;
&lt;div class="content"&gt;
&lt;p&gt;&amp;gt; Ok, I am trying to navigate your project. I am struggling to see exactly how it relates to the throughput sample.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I renamed it to performance_tests &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f609.svg" title="Wink"&gt;&amp;#x1f609;&lt;/span&gt;&lt;br /&gt;I wanted to extract this form nrf sdk, mostly because in feature I&amp;#39;m going to modify it.&lt;br /&gt;This also helped me to have a stable code base.&lt;br /&gt;&lt;br /&gt;&amp;gt; Where exactly are you sending the BLE packets. Can you please point to it? &lt;br /&gt;&lt;br /&gt;Sure. I&amp;#39;m using writes here, as it was in example. I&amp;#39;m sending packages here:&amp;nbsp;&lt;br /&gt;&lt;a href="https://github.com/DuMaM/bitly_nrf5x/blob/e6cf66e1655bf3da2c65d58fedb561893194ba80/src/app/cmd_run_adc.c#L61"&gt;https://github.com/DuMaM/bitly_nrf5x/blob/e6cf66e1655bf3da2c65d58fedb561893194ba80/src/app/cmd_run_adc.c#L61&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt; Where it sends, and how long are the packets that you are sending? There should be a call to&amp;nbsp;bt_gatt_notify_cb() or&amp;nbsp;bt_gatt_write() or something like that.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m trying to fill package as much as possible. Until there are data in buffer I&amp;#39;m sending `&lt;span&gt;data_len&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;tx_max_len`, otherwise when there will be some leftovers I placing them as a whole.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;gt; You say that your throughput is much higher when you disable the SPI and just use dummy data. So the MTU and connection interval and everything else is the same, just that you wait for the SPI to finish?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think yes. &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f609.svg" title="Wink"&gt;&amp;#x1f609;&lt;/span&gt;&amp;nbsp;&lt;br /&gt;SPI is driven by GPIO called DRDY. This pin is used by hooked up device to notify master that it should fetch data. Maximum speed here is 32000 samples/s, but with current BLE capabilities the maximum reasonable value is 4000k samples/s (1400kbps), for tests i&amp;#39;m using 2000k samples/s.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt; What is it that triggers&amp;nbsp;send_test_ecg_data()?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This semaphore and GPIO callback:&lt;br /&gt;&lt;a href="https://github.com/DuMaM/bitly_nrf5x/blob/e6cf66e1655bf3da2c65d58fedb561893194ba80/src/app/spi_adc.c#L442"&gt;https://github.com/DuMaM/bitly_nrf5x/blob/e6cf66e1655bf3da2c65d58fedb561893194ba80/src/app/spi_adc.c#L442&lt;/a&gt;&lt;br /&gt;&lt;a href="https://github.com/DuMaM/bitly_nrf5x/blob/e6cf66e1655bf3da2c65d58fedb561893194ba80/src/app/spi_adc.c#L852"&gt;github.com/.../spi_adc.c&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;gt; ads129x_get_data() only triggers a read from a buffer? No actual peripheral transferring data?&amp;nbsp;&amp;gt; When will it continue; and when will it send data (which I assume it does inside bt_performance_test_write()&lt;/p&gt;
&lt;p&gt;It triggers only on when there is a timeout on pipe k_polling or requested number of data was delivered from SPI pipe. I&amp;#39;m not sure what you mean by `&lt;span&gt;No actual peripheral transferring data?`&lt;br /&gt;&lt;/span&gt;Anyway when it fetch data from pipe it will transfer them to `&lt;span&gt;bt_performance_test_write` which is wrapper for `bt_gatt_write_without_response`&lt;br /&gt;It&amp;#39;s a bit stupid but thats how it was designed in example. I didnt have time to change it too much.&lt;br /&gt;&lt;a href="https://github.com/DuMaM/bitly_nrf5x/blob/e6cf66e1655bf3da2c65d58fedb561893194ba80/src/app_services/performance_test.c#L240"&gt;github.com/.../performance_test.c&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;gt; And when bt_performance_test_write() is called, what is the length of the data that is being sent?&lt;/p&gt;
&lt;p&gt;As I said before it&amp;#39;s max len set for single connection event - mostly 251 bytes.&lt;br /&gt;If SPI finish it&amp;#39;s data transfer and it&amp;#39;s not aligned to 251 bytes I send this&amp;nbsp;remainder.&lt;br /&gt;&lt;br /&gt;&amp;gt; Sorry, a lot of unstructured questions?&amp;nbsp;I was reading more and more into your project.&lt;br /&gt;&lt;br /&gt;No problem, I really appreciate it.&lt;br /&gt;&lt;br /&gt;&amp;gt; So the question is, how often is&amp;nbsp;send_test_ecg_data() called, and how often is&amp;nbsp;bt_performance_test_write() called? Is&amp;nbsp;bt_performance_test_write() called every time send_test_ecg_data() is called, or does it often skip it because of continue; ?&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="edit-form"&gt;It will be hard to answer for this, because it&amp;#39;s constantly changing. Depending on priories I set for threads and ISR. What I can tell for sure is that it&amp;#39;s able to pull data from pipe without issue.&lt;br /&gt;I started to suspect that&amp;nbsp;&lt;span&gt;bt_gatt_write_without_response waits for something. I&amp;#39;m not sure what, but when I interrupt&amp;nbsp;it with SPI ISR, this event is lost.&lt;br /&gt;This behavior&amp;nbsp;would explain why synthetic&amp;nbsp;dummy tests are ok.&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/396975?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 14:55:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3148d2b6-2b1d-4f76-9371-9979d0f5ffb0</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok, I am trying to navigate your project. I am struggling to see exactly how it relates to the throughput sample. Where exactly are you sending the BLE packets. Can you please point to it? Where it sends, and how long are the packets that you are sending? There should be a call to&amp;nbsp;bt_gatt_notify_cb() or&amp;nbsp;bt_gatt_write() or something like that.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You say that your throughput is much higher when you disable the SPI and just use dummy data. So the MTU and connection interval and everything else is the same, just that you wait for the SPI to finish?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What is it that triggers&amp;nbsp;send_test_ecg_data()?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;ads129x_get_data() only triggers a read from a buffer? No actual peripheral transferring data? When will it continue; and when will it send data (which I assume it does inside bt_performance_test_write(). And when bt_performance_test_write() is called, what is the length of the data that is being sent?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sorry, a lot of unstructured questions, but I was reading more and more into your project. So the question is, how often is&amp;nbsp;send_test_ecg_data() called, and how often is&amp;nbsp;bt_performance_test_write() called? Is&amp;nbsp;bt_performance_test_write() called every time send_test_ecg_data() is called, or does it often skip it because of continue; ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/396963?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 14:12:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:329d9400-0b8f-4457-a6e6-cf372dd7fa9a</guid><dc:creator>Dumam</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/edvin-holmseth"&gt;Edvin&lt;/a&gt;&amp;nbsp;I&amp;#39;m soo grateful for this. I&amp;#39;m trying to figure it out for 2 months without any luck. :(&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/396961?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 14:11:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8e3fd9e-5b1b-4be4-87a3-231f06b2b19c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Oh, my impression was that this was someone else&amp;#39;s repository. I understand. I will have a look at it as soon as possible.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/396960?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 14:08:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:255ae1b6-3842-42ed-951d-feda5210721f</guid><dc:creator>Dumam</dc:creator><description>&lt;p&gt;My repo is public you can download or clone it without any issues.&lt;br /&gt; &lt;br /&gt;&lt;a id="" href="https://github.com/DuMaM/bitly_nrf5x"&gt;https://github.com/DuMaM/bitly_nrf5x&lt;/a&gt;&lt;br /&gt;I also placed this in attachment.&lt;br /&gt;&lt;br /&gt;SPI Thread.&lt;br /&gt;More here:&amp;nbsp;&lt;a href="https://github.com/DuMaM/bitly_nrf5x/blob/e6cf66e1655bf3da2c65d58fedb561893194ba80/src/app/spi_adc.c#L840-L859"&gt;github.com/.../spi_adc.c&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void ads129x_set_data()
{
    /* add timestamp */
    tx_data.packet.timestamp = k_uptime_get() - timestamp;
    conv_u24_to_raw(tx_data.packet.timestamp, tx_data.buffer, 0);

    /* do processing */
    /* NOTE: Work directly on a ring buffer memory */
    int ret = spi_read(ads129x_spi, &amp;amp;ads129x_spi_cfg, &amp;amp;ads129x_rx);
    if (!ret)
    {
        /* add missing leads */
        lead1 = conv_u24_to_i32(conv_raw_to_u24(tx_data.packet.leads._buffer, ADS129x_LEAD1_OFFSET));
        lead2 = conv_u24_to_i32(conv_raw_to_u24(tx_data.packet.leads._buffer, ADS129x_LEAD2_OFFSET));
        conv_u24_to_raw(ads129x_get_leadIII(lead1, lead2), tx_data.packet.leads._buffer, ADS129x_LEAD3_OFFSET);
        conv_u24_to_raw(ads129x_get_aVR(lead1, lead2), tx_data.packet.leads._buffer, ADS129x_AVR_OFFSET);
        conv_u24_to_raw(ads129x_get_aVL(lead1, lead2), tx_data.packet.leads._buffer, ADS129x_AVL_OFFSET);
        conv_u24_to_raw(ads129x_get_aVF(lead1, lead2), tx_data.packet.leads._buffer, ADS129x_AVF_OFFSET);

        //ads129x_dump_data(tx_data.packet.leads._buffer);
    }

    /* send data to consumers */
    /* send data to the consumers */
    k_pipe_put(&amp;amp;ads129x_pipe, &amp;amp;tx_data.buffer, total_size, &amp;amp;bytes_written, sizeof(pipe_packet_u), K_NO_WAIT);
}

void ads129x_th(void)
{
    /* setup ecg */
    ads129x_setup();

    for (;;)
    {
        /*
         * Wait for semaphore from ISR; if acquired, do related work, then
         * go to next loop iteration (the semaphore might have been given
         * again); else, make the CPU idle.
         */
        if (k_sem_take(&amp;amp;ads129x_new_data, K_FOREVER) == 0)
        {
            ads129x_set_data();
        }
    }
}

K_THREAD_DEFINE(thread_ads129x, STACKSIZE, ads129x_th, NULL, NULL, NULL, PRIORITY, K_ESSENTIAL, 0);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;BLE Thread:&lt;br /&gt;More here:&amp;nbsp;&lt;a href="https://github.com/DuMaM/bitly_nrf5x/blob/e6cf66e1655bf3da2c65d58fedb561893194ba80/src/app/cmd_run_adc.c#L104"&gt;https://github.com/DuMaM/bitly_nrf5x/blob/e6cf66e1655bf3da2c65d58fedb561893194ba80/src/app/cmd_run_adc.c#L104&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;K_THREAD_STACK_DEFINE(ecg_ble_stack, 4096);
struct k_thread ecg_ble_thread;
static uint32_t bytes_to_send = 1024;

static uint32_t send_test_ecg_data(uint32_t _bytes_to_send)
{
    uint32_t prog = 0;
    uint8_t *analog_data_ptr = test_data_buffer;
    uint32_t analog_data_size = 0;
    int err = 0;

    /*
     * we always waiting for data to match whole buffer
     * so data requested should also match it
     * otherwise we should ignore it
     */
    uint16_t remainder = _bytes_to_send % ADS129x_DATA_BUFFER_SIZE;
    if (remainder) {
        _bytes_to_send = ((_bytes_to_send / ADS129x_DATA_BUFFER_SIZE) + 1) * ADS129x_DATA_BUFFER_SIZE;
    }
    LOG_INF(&amp;quot;Sending %&amp;quot;PRIu32&amp;quot; bytes (value after rounding to max packet size)&amp;quot;, _bytes_to_send);

    while (prog &amp;lt; _bytes_to_send)
    {
        analog_data_size = _bytes_to_send - prog;
        if (test_params.data_len-&amp;gt;tx_max_len &amp;lt;= analog_data_size) {
            analog_data_size = test_params.data_len-&amp;gt;tx_max_len;
        }

        /*
         * TODO: add scaling from shell
         * It would be good to send optimal number of data
         * during each transfer
         * also when we change a number o leads
         */
        if (!ads129x_get_data(analog_data_ptr, analog_data_size))
        {
            continue;
        }

        err = bt_performance_test_write(&amp;amp;performance_test, analog_data_ptr, analog_data_size);
        if (err)
        {
            LOG_ERR(&amp;quot;GATT write failed (err %d)&amp;quot;, err);
            break;
        }

        prog += analog_data_size;
    }
    return prog;
}

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/bitly_5F00_nrf5x_2D00_main.zip"&gt;devzone.nordicsemi.com/.../bitly_5F00_nrf5x_2D00_main.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/396955?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 13:57:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:027912d5-2a4c-417a-8f26-49359e93b5d1</guid><dc:creator>Edvin</dc:creator><description>[quote user="Dumam"]The problematic code do the same but gets data from SPI.&amp;nbsp;[/quote]
&lt;p&gt;Can you please show me how you do that?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In case I have follow up questions, feel free to zip and upload the entire project here (just drag and drop into the window where you are typing).&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/396948?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 13:48:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f46d77cf-d7b7-4077-808d-e5f2860743fc</guid><dc:creator>Dumam</dc:creator><description>&lt;p&gt;Yep, this is my command i wrote for testing purposes.&lt;br /&gt;&lt;br /&gt;Everything base on this example.&lt;br /&gt;&lt;a id="" href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/throughput/README.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/throughput/README.html&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;I changed few parameters, to fit my needs. cmd_sim is basically this function from sample.&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/ac6e65413245f60fe16563a7719fdc321a60ef88/samples/bluetooth/throughput/src/main.c#L522"&gt;github.com/.../main.c&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The problematic code do the same but gets data from SPI.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/396939?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 13:36:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5dd64241-efcd-4315-8685-b7d0254c9774</guid><dc:creator>Edvin</dc:creator><description>[quote user="Dumam"]I think the issue here is that `cmd_sim` function is sending everything in one thread,[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Where is this cmd_sim? Is it part of the repository that you are linking to? I am not familiar with that application, and it is not written by anyone from Nordic.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/396856?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 10:41:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af02a547-8bff-488e-9669-84976832a8d8</guid><dc:creator>Dumam</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/edvin-holmseth"&gt;Edvin&lt;/a&gt;&amp;nbsp;I think it&amp;#39;s more a problem of how communication between threads is set up.&lt;br /&gt;&lt;br /&gt;I checked this with Particle Xenon board and I observed exactly the same behavior.&lt;br /&gt;I also switched from pipe to ring_buffers to save copy operations. This also didn&amp;#39;t helped.&lt;br /&gt;&lt;br /&gt;Here is BLE thread:&lt;br /&gt;&lt;a id="" href="https://github.com/DuMaM/bitly_nrf5x/blob/e6cf66e1655bf3da2c65d58fedb561893194ba80/src/app/cmd_run_adc.c"&gt;https://github.com/DuMaM/bitly_nrf5x/blob/e6cf66e1655bf3da2c65d58fedb561893194ba80/src/app/cmd_run_adc.c&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here is SPI thread:&lt;br /&gt;&lt;a href="https://github.com/DuMaM/bitly_nrf5x/blob/e6cf66e1655bf3da2c65d58fedb561893194ba80/src/app/spi_adc.c#L840-L859"&gt;github.com/.../spi_adc.c&lt;/a&gt;&lt;/p&gt;
&lt;div id="gtx-trans" style="left:3px;position:absolute;top:-20px;"&gt;
&lt;div class="gtx-trans-icon"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf5340 is unable to trigger rpmsg(ipc) transfer</title><link>https://devzone.nordicsemi.com/thread/396855?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 10:35:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe43e47f-3d68-4ba2-9621-b3185ec6d34a</guid><dc:creator>Dumam</dc:creator><description>&lt;p&gt;It makes sense to me but this happens also for longer data transfers. I can accept some delay while i start communication, but for me it looks like there is some interference between components.&lt;br /&gt;&lt;br /&gt;For example If I would like to sent 3MB. Instead of stable stream of data, it looks like my app is buffering them in HCI driver and then after some time, it starts to send them in every connection event (like in picture). To set some reference, time spent on buffering is 30-100ms, and when transfer starts time between each frame is around 3-10ms.&lt;br /&gt;&lt;br /&gt;At the end my &lt;span&gt;throughput&amp;nbsp;&lt;/span&gt;is around 60kbps.&lt;/p&gt;
&lt;p&gt;My connection interval is set to 28units now.&amp;nbsp;&lt;br /&gt;&lt;a href="https://github.com/DuMaM/bitly_nrf5x/blob/496ad8dfe21107d0d8ec1a2fd75c939aa89076fb/include/app/cmd.h#L11"&gt;https://github.com/DuMaM/bitly_nrf5x/blob/496ad8dfe21107d0d8ec1a2fd75c939aa89076fb/include/app/cmd.h#L11&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;What makes it more&amp;nbsp;interesting is that I observe such behavior only when SPI is enabled.&lt;br /&gt;For testing purposes I prepared artificial data set which I sent in exactly the same way. With this approach I&amp;#39;m able to get throughput around 1100kbps.&amp;nbsp;&lt;br /&gt;With exactly the same devices, with the same connection setups, and parameters, programs.&lt;br /&gt;&lt;a id="" href="https://github.com/DuMaM/bitly_nrf5x/blob/496ad8dfe21107d0d8ec1a2fd75c939aa89076fb/src/app/cmd_run_sim.c"&gt;https://github.com/DuMaM/bitly_nrf5x/blob/496ad8dfe21107d0d8ec1a2fd75c939aa89076fb/src/app/cmd_run_sim.c&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I think the issue here is that `cmd_sim` function is sending everything in one thread, by locking itself on `bt&lt;span&gt;_gatt_write_without_response`. This way it dont have to switch thread context.&lt;br /&gt;Where case with SPI needs to use mutexes and ISR to switch into different thread and protect shared resources.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>