<?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>nRF5 SDK with SoftDevice and RTOS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119130/nrf5-sdk-with-softdevice-and-rtos</link><description>Hi, 
 I&amp;#39;m setting up the project(VS Code + Make + ARM-GCC) for nRF52840. The project will use nRF5 SDK(not new with Zephyr) and softdevice(both BLE roles). 
 Until now I&amp;#39;ve been using CMSIS RTX5 and I like it. I found few topics here on DevZone that RTX</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Feb 2025 07:40:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119130/nrf5-sdk-with-softdevice-and-rtos" /><item><title>RE: nRF5 SDK with SoftDevice and RTOS</title><link>https://devzone.nordicsemi.com/thread/524729?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2025 07:40:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b12ee4f-5368-46a0-b3f2-eaafd0f66e47</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Other RTOS cannot use SVC when softdevice is enabled. The Nordic SoftDevice (which is a precompiled binary stack) takes over certain system resources, including the SVC interrupt, which it uses for internal operations.If another component (like RTX5) modifies the SVC handler after the SoftDevice is enabled, it can cause a HardFault.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5 SDK with SoftDevice and RTOS</title><link>https://devzone.nordicsemi.com/thread/524463?ContentTypeID=1</link><pubDate>Tue, 25 Feb 2025 01:20:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bc7a3da-ca5f-490c-97c2-d276d3fc96f9</guid><dc:creator>silvio3105</dc:creator><description>&lt;p&gt;Little update:&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve set up little demo with nRF52840 and nRF5 SDK v17.1.0 - device will advertise itself. Everything works without RTX5(5.9.0 with CMSIS RTOS2 API). And almost everything works well with RTX5.&lt;br /&gt;&lt;br /&gt;With RTX5 it starts to advertise and after few minutes(not sure if the period is constant) it just goes to HardFault_Handler.&lt;/p&gt;
&lt;p&gt;I guess that SoftDevice configures SVC interrupt, so I removed &amp;quot;SVC_Setup&amp;quot; from function &amp;quot;&lt;span&gt;svcRtxKernelStart&lt;/span&gt;&amp;quot;, called from &amp;quot;&lt;span&gt;osKernelStart&lt;/span&gt;&amp;quot;. After that RTOS works fine and no hard fault.&lt;/p&gt;
&lt;p&gt;Demo has same base - BLE part while RTOS part has two tasks. Both print to RTT and have little(but not same) osDelay. Now, this seems too easy fix, not sure did Nordic team tried this. I need more info how to put SoftDevice on 100%. Seems too easy to be true.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/aryan"&gt;Susheel Nuguru&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5 SDK with SoftDevice and RTOS</title><link>https://devzone.nordicsemi.com/thread/524021?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2025 08:50:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28d52907-dae2-4262-b1c9-317d3e3692fc</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="silvio3105"]As I see, only FreeRTOS is supported. CMSIS RTOS2 API is not supported? I have to use FreeRTOS directly?[/quote]
&lt;p&gt;Yes we officially support FreeRTOS working on nRF52840 and have given some working examples to work with FreeRTOS + BLE.&lt;/p&gt;
&lt;p&gt;From the image we show that you can ofcourse use any RTOS as the softdevice is RTOS agnostic, Which means that the Softdevices and libraries architecture is not restricting your application to use any other RTOS but when we do not officially support it, it means that we stop testing them. When you find issues using other RTOS like RTX then we do not have confidence to debug as we have no done any regression testing with that solutions.&amp;nbsp;&lt;/p&gt;
[quote user="silvio3105"] I have to use FreeRTOS directly?[/quote]
&lt;p&gt;Please start with one of the examples for FreeRTOS we have shown in the SDK and try to build your application on top of that example as a template. If you want to use RTX or anyother RTOS, then you are on your own. Its doable, but we cannot assist you when you have issues with it.&lt;/p&gt;
[quote user="silvio3105"]Now, I cannot find info about SD and PendSV handler. Does SD use it?[/quote]
&lt;p&gt;Softdevice does not use PendSV and that is the reason FreeRTOS uses it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5 SDK with SoftDevice and RTOS</title><link>https://devzone.nordicsemi.com/thread/523871?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2025 11:16:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc5342ea-7819-44f1-95b4-87bec72e9ace</guid><dc:creator>silvio3105</dc:creator><description>&lt;p&gt;Yes, but...&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/pastedimage1740050098883v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As I see, only FreeRTOS is supported. CMSIS RTOS2 API is not supported? I have to use FreeRTOS directly?&lt;br /&gt;&lt;br /&gt;Found info about SD and systick here -&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/59850/about-rtc-module-systick-and-softdevice"&gt;About RTC module, Systick and SoftDevice&lt;/a&gt;&lt;br /&gt;Now, I cannot find info about SD and PendSV handler. Does SD use it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5 SDK with SoftDevice and RTOS</title><link>https://devzone.nordicsemi.com/thread/523870?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2025 11:12:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38b259a4-7c97-4afb-8331-5e884036c501</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Silvio,&lt;/p&gt;
&lt;p&gt;We stopped supporting RTX as you already mentioned that its interrupt mode was causing issues with softdevice. And also, we did not want to spend too many resources on too many RTOS solutions.&lt;/p&gt;
&lt;p&gt;The source code for FreeRTOS is located at&amp;nbsp;nRF5_SDK_17.1.0_ddde560\external\freertos&lt;/p&gt;
&lt;p&gt;And you can run a BLE example running on FreeRTOS with Softdevice at&amp;nbsp;nRF5_SDK_17.1.0_ddde560\examples\ble_peripheral\ble_app_hrs_freertos.&lt;/p&gt;
&lt;p&gt;I do not want to spend too much time helping you port this SDK to RTX. Instead, please try to use the RTOS that is already supported and tested well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5 SDK with SoftDevice and RTOS</title><link>https://devzone.nordicsemi.com/thread/523854?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2025 09:59:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4a512dd-dc74-4753-9aac-4d1415200e6a</guid><dc:creator>silvio3105</dc:creator><description>&lt;p&gt;Little update:&lt;br /&gt;After reading about RTX5 kernel and SoftDevice interrupts - All interrupts are&amp;nbsp;intercepted by SoftDevice.&lt;br /&gt;If SVC ID is less than 0x10(16) than SVC call is passed to application. RTX5 uses SVC 0 for scheduler, so that will work.&lt;br /&gt;&lt;br /&gt;So, I&amp;#39;m not sure what can cause the problems if RTX5 is used? What is different in nRF FreeRTOS compared to original FreeRTOS?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>