<?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>Is there a way of running BLE on the network core only on nRF5340?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119657/is-there-a-way-of-running-ble-on-the-network-core-only-on-nrf5340</link><description>Hi, 
 I am trying to optimize a time critical device for lowest possible latency data transmission over BLE on nRF5340 working as peripheral. Currently my algorithms are implemented completely on the app core side of the device, while I use the original</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 11 Mar 2025 18:21:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119657/is-there-a-way-of-running-ble-on-the-network-core-only-on-nrf5340" /><item><title>RE: Is there a way of running BLE on the network core only on nRF5340?</title><link>https://devzone.nordicsemi.com/thread/526817?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2025 18:21:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21314018-c9f5-4acb-bbe9-9d4c6ca01fc3</guid><dc:creator>nfbe</dc:creator><description>&lt;p&gt;Thanks a lot for your comments and very prompt replies, Kenneth!&lt;/p&gt;
&lt;p&gt;I will take a deep look into this Thread Viewer&amp;nbsp;option - I believe that will help me to understand what is happening much more deeply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;... and, of course, tutorials will&amp;nbsp;be helpful in many cases...&lt;/p&gt;
&lt;p&gt;I will take a look into the remote procedure calls, too... somehow I have the feeling, there will&amp;nbsp;be a rather simple solution to my very specific problem using&amp;nbsp;the nrf5340... I just have to put in a little more time to think about it...&lt;/p&gt;
&lt;p&gt;...and I will definitely look into the nrf54 series as you suggest - even though I am hesitatant to change the core of my device between project&amp;nbsp;phases - I would absolutely prefer to stick to what I have and only make minor fixes and improvements, hoping that the next HW-design might be ready to be my&amp;nbsp;product.&lt;/p&gt;
&lt;p&gt;Thanks for your advice - you helped me a lot to make up my mind and for now, I have good ideas how to continue. I will come back with more specific questions - if I need to.&lt;/p&gt;
&lt;p&gt;I think, we can close this for now.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Jens&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way of running BLE on the network core only on nRF5340?</title><link>https://devzone.nordicsemi.com/thread/526646?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2025 21:04:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2cfc782c-f73d-45fd-b6b9-b4f14bbfd36e</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You are free to solve this with whatever approach you are most comfortable with, I know everyone have their own preferences. Here is in any case my input.&lt;/p&gt;
&lt;p&gt;We have a few tutorials in general for the nRF Connect SDK:&lt;br /&gt;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/"&gt;https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/"&gt;https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/"&gt;https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In your case I would in specific check out the &amp;quot;Thread Viewer&amp;quot; further down on this page:&lt;br /&gt;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/topic/debugging-in-vs-code/"&gt;https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/topic/debugging-in-vs-code/&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then you can see the priority of all the threads running in the appcore, and configure the thread you want to run to be either higher or between the existing threads running.&lt;/p&gt;
&lt;p&gt;Unfortunately the priorities with negative value are&amp;nbsp;cooperative threads, which once started can&amp;#39;t be preempted, not even by higher priority threads. That said, those cooperative threads should be short by design, I would not expect them to block more than potentially a few hundred of us in worst case.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s an option to have the&amp;nbsp;algorithms run in a thread with high priority, and then each time you want to send data you transfer that to a work queue to handle the bt_gatt_notify().&lt;/p&gt;
&lt;p&gt;The only thing I can think of that may block in the tens of ms is if you are doing flash operations, such as storing data to flash, which may indirectly trigger erasing flash pages, moving around data in flash etc, this will take a long time, but this should only occur for instance shortly after bonding, or if you are supporting multiple bonds, it may also occur if you have enabled&amp;nbsp;BT_KEYS_OVERWRITE_OLDEST shortly after connection is established.&lt;/p&gt;
&lt;p&gt;All that said, an alternative is to look into this example:&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/rpc_host/README.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/rpc_host/README.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The problem with the RPC example is that it&amp;#39;s experimental, and as it says in the Note: &amp;quot;Currently, only a subset of Zephyr’s Bluetooth APIs is available over Bluetooth nRF RPC. For more details about the limitations, see the API documentation of the Bluetooth nRF RPC library.&amp;quot;&lt;/p&gt;
&lt;p&gt;Unfortunately it&amp;#39;s been &amp;quot;Currently&amp;quot; for quite some time, so I don&amp;#39;t expect it will change anytime soon.&lt;/p&gt;
&lt;p&gt;An alternative approach you may consider is to switch to the nRF54L15, which provide a risc-v CPU that can run whatever you want, completely uninterrupted:&amp;nbsp;&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/vpr.html"&gt;https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/vpr.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can then use mbox to transfer data between the application core and the risc-v cpu core:&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/hardware/peripherals/mbox.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/hardware/peripherals/mbox.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Example project:&lt;br /&gt;\zephyr\samples\drivers\mbox&lt;/p&gt;
&lt;p&gt;Personally I would have checked out the nRF54L, since it&amp;#39;s our latest development platform, with a range of devices in the roadmap (reach out to someone in sales if there are specific features you are interested in that is not part of the nRF54L15, use contact us and sales related questions: &lt;a href="https://www.nordicsemi.com/About-us/Contact-Us"&gt;https://www.nordicsemi.com/About-us/Contact-Us&lt;/a&gt;). &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/bluetooth/llpm/README.html"&gt;LLPM &lt;/a&gt;is also supported by the nRF54L, which have far better latency than normal BLE due to 7x interval. Of course if you have got far in development with the nRF5340 that is not an option.&lt;/p&gt;
&lt;p&gt;Hope it helps,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way of running BLE on the network core only on nRF5340?</title><link>https://devzone.nordicsemi.com/thread/526634?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2025 18:12:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a24a53ff-82bf-46dd-b452-a7e2d8f1311d</guid><dc:creator>nfbe</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;thanks for your reply. I was not expecting to see any large jitter (&amp;gt;&amp;gt; the connection interval) for my device, but I actually do observe it. The reason for choosing nrf5340 was to decouple the transmission via standard BLE (or other radio protocols) from my time critical application, which essentially requires to be in the range of 1ms in a loop reading sensors and every now and then sending a notification. In &amp;gt;&amp;gt;99% of the cases everything on the application side works as expected and the notification takes between 50 and 120&amp;nbsp;&amp;micro;s on the app core. Unfortunately every now and then the notify takes far longer even though I have only the main thread running from my application side and a cyclic hardware interrupt firing regularly but not firing in the first 200&amp;micro;s after calling the notify... so this interrupt should not be the original cause of my jitter problem.&lt;/p&gt;
&lt;p&gt;I implemented a simple IPC communication from app core to net core instead of the notify and that runs &amp;quot;rock steady&amp;quot; with no jitter to speak of and no outliers always taking less than 50&amp;micro;s on the app core. Of course I needed to replace the net-core by an IDC-service code... which gave me the opportunity to better understand the communication and also to use some gpios on the net core side for oscilloscope &amp;quot;debugging&amp;quot;.. and, I obviously disabled BLE...&lt;/p&gt;
&lt;p&gt;=&amp;gt; so, if I would be able to either:&lt;/p&gt;
&lt;p&gt;a) debug and measure the communication between app core and net core in the BLE case (which would mean changing the hci_rpmsg code to e.g. control some gpio pins for oscilloscope measurements) I might be able to better understand the source of the problem.&lt;/p&gt;
&lt;p&gt;or&amp;nbsp;preferably:&lt;/p&gt;
&lt;p&gt;b) use my simple IPC communication to decouple app core and net core and then have something different from the &amp;quot;standard&amp;quot; hci_rpmsg on the net core, I would be able to keep my inter core communication absolutely the same no matter which type of radio protocol I implement on the net core (standard BLE, llpm or ESB - if possible on the nrf5340 net core only) as alternatives for different communication partners.&lt;/p&gt;
&lt;p&gt;I would like to try your suggestion on adjusting priorities, if that could solve my problem in case a). Since my work loop code runs in the main thread, I assume it will have priority 0, because I do not actually assign a priority to it. That&amp;nbsp;leads to two questions&lt;/p&gt;
&lt;p&gt;=&amp;gt; how do I change priority? I guess I would need to create a thread to run my application&amp;#39;s critical loop and assign some priority to it, or can I change the priority of the main thread?&lt;/p&gt;
&lt;p&gt;=&amp;gt; since whatever is interrupting the notify function is not a thread or interrupt I explicitly created from my application side, I assume it is somehow related to a zephyr driver ... maybe BLE?&lt;br /&gt;--&amp;gt; So: how do I find out, what is causing the effect&lt;br /&gt;--&amp;gt; So: which priority level should I assign to my work loop?&lt;/p&gt;
&lt;p&gt;To give you some background to my latency and jitter requirements:&lt;/p&gt;
&lt;p&gt;The possible applications of my device depend on the total transmission latency of the chain. It would be top notch to reach something stable below 3 ms, most applications would still tolerate 10 ms , which could be reached with a 7.5ms connection interval, if communication errors would occur next to never and a few use cases&amp;nbsp;will also work with up to 20 ms. &lt;br /&gt;If it would be possible to have a choice of protocol depending on the capability of the radio-communication partner, it would be ideal for my device.&lt;/p&gt;
&lt;p&gt;In short:&lt;/p&gt;
&lt;p&gt;1) I would like to reach latencies and jitter both in the range of 1 ms (ESB or llpm) to be able to stay below 3 ms always.&lt;/p&gt;
&lt;p&gt;2) I absolutely need to reliably have maximum latencies of 1 connection interval + 3&amp;nbsp;ms (BLE)&lt;/p&gt;
&lt;p&gt;With a BLE central capable of 7.5 ms connection interval and no other communication going on in parallel,&amp;nbsp;I currently see the following (this central can reliably communicate with a BLE peripheral in less than 10ms):&lt;br /&gt; very often&amp;nbsp;the transmission&amp;nbsp;takes &amp;lt;(1 connection interval + 3ms), but not always... sometimes the transmission&amp;nbsp;needs up to (2 connection intervals + a little bit) using my application on a nrf5340dk or on my own custom device.&lt;/p&gt;
&lt;p&gt;Unfortunately I do not exactly understand your reference to the nrfx drivers. The links do not really lead to pages with a detailed description but a list of all drivers supported. Could you please tell me, which drivers would be relevant to solve my problem of core communication and/or BLE on the nrf5340?&lt;/p&gt;
&lt;p&gt;Thanks for your advice.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Jens&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way of running BLE on the network core only on nRF5340?</title><link>https://devzone.nordicsemi.com/thread/526533?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2025 11:58:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00b3e986-380a-4ed4-8890-00e563c4a4f5</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi Jens,&lt;/p&gt;
&lt;p&gt;The netcore should handle all the realtime requirements of the BLE connection, so even though the&amp;nbsp;host still run on the application, there should be no realtime requirement by the host that should prevent the application to have the highest priority for the nRF5340, so if you observe that the application interrupt do not behave as you expect (e.g. have jitter), I suspect you may need to adjust the priority of the thread you want to run in the application. How much jitter do you observe or how much jitter can you allow?&lt;/p&gt;
&lt;p&gt;If you want to have even better control you may need to look at using the low level nrfx drivers:&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/nrfx-apis-latest/page/nrfx_drv_supp_matrix.html"&gt;https://docs.nordicsemi.com/bundle/nrfx-apis-latest/page/nrfx_drv_supp_matrix.html&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/nrfx-apis-latest/page/nrfx_examples_desc.html"&gt;https://docs.nordicsemi.com/bundle/nrfx-apis-latest/page/nrfx_examples_desc.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>