<?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>CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1506/cmsis-rtos-with-nrf51822-and-s110</link><description>I&amp;#39;m looking into using the CMSIS RTOS on the nRF51822 with the S110 softdevice which I&amp;#39;ve used successfully with other Cortex M0 MCUs. I realize the S110 isn&amp;#39;t well tested with various RTOS, but documentation indicates it should be possible. 
 When initializing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Dec 2015 21:00:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1506/cmsis-rtos-with-nrf51822-and-s110" /><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6711?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2015 21:00:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69a2ac5a-df75-4fec-8f94-72475f85d6c5</guid><dc:creator>Michael Lamming</dc:creator><description>&lt;p&gt;rtx-tick.zip - Not there any more.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6692?ContentTypeID=1</link><pubDate>Tue, 21 Oct 2014 05:07:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19b09af8-e1be-4148-abb8-8ee8e7d69537</guid><dc:creator>Jason</dc:creator><description>&lt;p&gt;for you reference:
&lt;a href="https://github.com/ucxpresso/nano51822/raw/master/documents/getting_started_with_ucxpresso.nrf.pdf"&gt;github.com/.../getting_started_with_ucxpresso.nrf.pdf&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6707?ContentTypeID=1</link><pubDate>Mon, 15 Sep 2014 18:28:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d98e97a-ce86-470d-8ffb-143ea7b44dd2</guid><dc:creator>Mike Thomspon</dc:creator><description>&lt;p&gt;A quick look at my simple reference project indicates that all the RTOS modules combined with all features enabled is about 12K of Flash and about 2K of SRAM.  The Flash usage can be minimized if you don&amp;#39;t include certain features of the RTOS.  The SRAM usage varies greatly by project and how many threads you need for the application and whether you need a timer thread.   I typically configure about 400 bytes of stack space per thread.  Features such as MUTEX and Mailqueues will consume SRAM as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6706?ContentTypeID=1</link><pubDate>Mon, 15 Sep 2014 18:14:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d3bf6a6-05a3-460c-b796-9c471ae176b6</guid><dc:creator>mira67</dc:creator><description>&lt;p&gt;@Mike Thomspon, how much ram/flash space the RTOS consumes in your application? Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6712?ContentTypeID=1</link><pubDate>Tue, 05 Aug 2014 13:13:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4519841c-630c-4358-aa6d-a181d90033cd</guid><dc:creator>Jason</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;For you reference (a C/C++ RTOS framework for nRF51822)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/ucxpresso/nano51822/blob/master/examples/ble/ble_app_hrm/src/main.cpp"&gt;github.com/.../main.cpp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Info:&lt;/p&gt;
&lt;p&gt;SoftDevice version: S110 V7.0&lt;/p&gt;
&lt;p&gt;nano51822, a Fine Tune Module (Only One SoC nRF51822 inside)&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/lpcxpresso_5F00_for_5F00_nrf51822_5F00_21_2D00_29_2D00_07.jpg" alt="image description" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6710?ContentTypeID=1</link><pubDate>Tue, 08 Jul 2014 12:00:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2784c0f3-f376-4cf7-abde-e385121f9209</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;&lt;a href="http://www.speedyshare.com/HUJvA/rtx-tick.zip"&gt;www.speedyshare.com/.../rtx-tick.zip&lt;/a&gt;
no softdevice
no RTC0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6709?ContentTypeID=1</link><pubDate>Sun, 06 Jul 2014 16:54:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e9742cc-4cad-45c4-99e2-b02e55791e4b</guid><dc:creator>Vincent</dc:creator><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;Would anyone be willing to post a basic Blinky_RTX example on github that the community could maintain?
I&amp;#39;m starting from scratch with nRF51, it would be quite nice to get started!
Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6705?ContentTypeID=1</link><pubDate>Mon, 03 Mar 2014 23:07:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6615c3a8-3852-448b-8f06-28d165d62e38</guid><dc:creator>Daniel Bayeh</dc:creator><description>&lt;p&gt;You rock!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6704?ContentTypeID=1</link><pubDate>Mon, 03 Mar 2014 19:20:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95b293e1-2fe5-4b8d-93c3-82dfb37fdf7d</guid><dc:creator>Mike Thomspon</dc:creator><description>&lt;p&gt;Regarding  ble_conn_params.c module, I did convert it to using the CMSIS RTOS timers instead.  It was pretty straight forward to re-implement the timeout timer and add mutex protection of the critical data structures that may be called from multiple threads.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6703?ContentTypeID=1</link><pubDate>Mon, 03 Mar 2014 18:15:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f573fa09-b006-43e8-a427-032cc29a2fdd</guid><dc:creator>Mike Thomspon</dc:creator><description>&lt;p&gt;Daniel,&lt;/p&gt;
&lt;p&gt;I indeed used RTC1 in place of SysTick.  Basically, in the arm_startup_nrf51.s you need to import OS_Tick_Handler() that is provided by CMSIS RTOS in HAL_CM0.c and use it for the RTC1 IRQ handler.  I then created an os_tick_irqack() function that handles the clearing the interrupt as shown below:&lt;/p&gt;
&lt;p&gt;// Acknowledge alternative hardware timer interrupt
void os_tick_irqack (void)
{
// Is this a tick condition?
if ((NRF_RTC1-&amp;gt;EVENTS_TICK != 0) &amp;amp;&amp;amp; ((NRF_RTC1-&amp;gt;INTENSET &amp;amp; RTC_INTENSET_TICK_Msk) != 0))
{
// Clear the interrupt?
NRF_RTC1-&amp;gt;EVENTS_TICK = 0;
}
}&lt;/p&gt;
&lt;p&gt;If you look in the CMSIS RTOS source in the file HAL_CM0.c you&amp;#39;ll find the normal SysTick_Handler() function, but this function is not used on the Nordic so we use the alternate OS_Tick_Handler() in this file which calls the os_tick_irqack().  I think the SysTick_Handler() in the Nordic assembly file is just a legacy left from the standard CMSIS files.  It was confusing to me as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6699?ContentTypeID=1</link><pubDate>Sat, 01 Mar 2014 04:58:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b2b2a67-8673-443c-8601-b16624663d34</guid><dc:creator>Paul</dc:creator><description>&lt;p&gt;I tested S210 V2.0.0 and V3.0.0 side by side.
V3.0.0 won.:-D&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6702?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2014 23:01:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa651996-d430-426e-b65f-f6412e484c55</guid><dc:creator>Daniel Bayeh</dc:creator><description>&lt;p&gt;Mike - thanks so much for your response. I realize now the latency is practically the same regardless of whether an RTOS is used or not, so I guess I will stop worrying about it.&lt;/p&gt;
&lt;p&gt;You modified the RTOS to use RTC1 in place of the sysTick. I am assuming you modified the RTX_Conf_CM.c file. How did you set up the last function - os_tick_irqack? I am assuming you pointed the RTC1 exception to the original sysTick handler.
Where is the sysTick handler function set up to be an exception handler? This might be a silly question, but this is the first time I am delving into the RTOS internals. Can I just rename the RTC1 handler to sysTick handler and that would do it? Also, why is there an exception handler for the sysTick in the arm_startup_nrf51.s file when there is no sysTick timer?&lt;/p&gt;
&lt;p&gt;For the RTC1 conflict with ble_conn_params modue, did you end up using the RTOS&amp;#39;s timer? I am curious.&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6701?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2014 19:27:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:018b6ff7-9188-4b05-a4fd-96cd63cdf4a1</guid><dc:creator>Mike Thomspon</dc:creator><description>&lt;p&gt;Daniel, I&amp;#39;m assuming that you are concerned about interrupt latency. To be honest, I haven&amp;#39;t really considered this too much yet.&lt;/p&gt;
&lt;p&gt;The S110 SoftDevice maintains control over all the interrupts and gets first stab at whatever interrupt occurs. It also enforces the interrupt handlers in the application code and RTOS to operate at two specific priorities which are lower than what the SoftDevice operates at. As long as the limitations are honored by the RTOS and application, the RTOS and SoftDevice seem to co-exist fine and the RTOS shouldn&amp;#39;t intefere with interrupt handling by the S110 SoftDevice.&lt;/p&gt;
&lt;p&gt;With regards to application code running under the RTOS, the S110 SoftDevice will intercept ALL interrupts and redirect those to be handled by the RTOS/application through the secondary interrupt table. This redirection will incur some additional overhead -- probably on the order of a microsecond or so, but I haven&amp;#39;t measured it. Because the S110 interrupt handlers operate at a higher priority than the RTOS and application interrupt handlers, the application code will have to be written in such a way to cope with whatever latency may occur under the S110 SoftDevice. The application code would have to factor this in with or without the RTOS.&lt;/p&gt;
&lt;p&gt;Currently the application I&amp;#39;m working on consists of three threads under the CMSIS RTOS. One thread services packets as they are passed down by the BLE stack, another thread communicates with SPI peripherals and a third thread runs application code that interacts with the user. Queues are used to pass packets betwen the threads and mutex for protecting critical sections of code. The RTOS internally maintains a fourth thread for OS timer management. Things seem to be working fine so far, but we haven&amp;#39;t really started QA work yet to put the system under stress.&lt;/p&gt;
&lt;p&gt;I believe what I describe above properly describes the interaction of the RTOS with the SoftDevice, but I would like to hear perspectives from people more familiar or experienced with the S110 SoftDevice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6700?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2014 04:48:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:155d87d1-2242-4a47-b289-354e1b55f3e2</guid><dc:creator>Daniel Bayeh</dc:creator><description>&lt;p&gt;Hi Guys,&lt;/p&gt;
&lt;p&gt;I am just about to start a project with the 51822 and wanted to use the RTX RTOS. But I only have a couple of months for this project and wasn&amp;#39;t too sure if I can pull it off in time. But seeing the kind of progress you are making is giving me hope that this could work. One thing I am still not too sure about is the interrupt latency. My understanding is that the max latency can be as high as 5ms+. Do your applications tolerate this latency or how did you deal with this?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6698?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2014 01:41:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f1134fa-c020-42b0-8376-0eb63129a8d7</guid><dc:creator>Mike Thomspon</dc:creator><description>&lt;p&gt;With limited testing, it appears that the S110 version 6.0.0 will work successfully with the Keil CMSIS RTOS for our purposes.  To get things working I had to substitute RTC1 for SysTick which unfortunately is not on the nRF51 silicon.  This in turn caused a conflict with the Nordic timer library which also uses RTC1.  I had to rework the ble_conn_params.c library to use the CMSIS RTOS timers because of this, but it wasn&amp;#39;t too much work.  With these changes things have been working pretty well for us and being able to use threading on the nRF51 will make our application development easier.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6697?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2014 16:54:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89ba7d30-fd69-420b-8f69-79ad72f4f8c4</guid><dc:creator>Paul</dc:creator><description>&lt;p&gt;Hi Mike
I was in exactly the same shoe you are last April.
I traced right into the assembly too. There was no solution from Nordic that time. So I modified the RTOS source and recompiled the CM lib, which fix the stack problem. I got the latest silicon a couple of weeks ago. I haven&amp;#39;t got a chance to verify this issue yet.
Do you have any updates?
Paul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6696?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2014 10:22:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb685814-7f6c-47ba-833c-87e679a8a3cd</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;This is actually most likely spot on. There have been fixes to S110 version 6.0.0 to fix its stack pointer use, and I believe this should solve your problem. What threw me of was actually the weird return code you got, since I&amp;#39;ve seen other things causing that previously. I will however have a go at your project now and see if I can get things running.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6695?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2014 01:22:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63c6701c-8fff-4ae6-9231-262a8eef0797</guid><dc:creator>Mike Thomspon</dc:creator><description>&lt;p&gt;Another update.  I&amp;#39;ve figured out that I&amp;#39;m calling sd_softdevice_enable() from the initial RTOS thread and it&amp;#39;s running off the process stack pointer (PSP) when it calls into the function via the SVC interrupt.  The softdevice handler, however, assumes the thread was running off the main stack pointer (MSP) and uses the MSP to extract the SVC number -- which of course is wrong as it&amp;#39;s on the PSP stack.&lt;/p&gt;
&lt;p&gt;It seems the softdevice SVC_Handler should determine which stack was being used when the SVC interrupt was called as it could then correctly pull the SVC number off the correct stack.  I&amp;#39;ll have to investigate further regarding what the work around for this issue might be.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6694?ContentTypeID=1</link><pubDate>Wed, 05 Feb 2014 00:01:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfbdac20-d831-4ca8-9a15-c39a2de55923</guid><dc:creator>Mike Thomspon</dc:creator><description>&lt;p&gt;Looking more into this I now see that the call to sd_softdevice_enable() results in a call the RTOS provided SVC_Handler() which doesn&amp;#39;t correctly pass the SVC call along to the soft device.  The return code is a red herring since it doesn&amp;#39;t come from the softdevice at all.  I&amp;#39;ll investigate how to get the RTOS and softdevice properly sharing the SVC interrupt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6708?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2014 23:05:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e4c61d8-845d-4695-a7bb-ae9a24c95da7</guid><dc:creator>Mike Thomspon</dc:creator><description>&lt;p&gt;Thanks for offering to look at this.  I&amp;#39;ve sent you a PM with a link to an RTOS project based on the ble_app_uart project for the NRF6310 dev board you can build and examine.  I have no problem sharing the project, but it would be best to post a link after the issue is resolved.&lt;/p&gt;
&lt;p&gt;Looking at the CMSIS RTOS use of SVC, it seems to only use SVC 0 which shouldn&amp;#39;t conflict with the S110 softdevice.  I also verified the versions of the SDK and S110 are correct.  I suspect the answer to the issue lays elsewhere.  Perhaps in how the RTOS initializes the NVIC or other cortex peripherals.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CMSIS RTOS with nRF51822 and S110</title><link>https://devzone.nordicsemi.com/thread/6693?ContentTypeID=1</link><pubDate>Tue, 04 Feb 2014 11:38:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:024ea2dc-7806-413c-ac60-0f24346cc427</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;Could it be that there is an overlap between the SVC numbers used by the softdevice and the SVC numbers that the CMSIS RTOS uses? As you can see in the S110 SoftDevice Specification, only SVC number 0x0 to 0xF is available to the application.&lt;/p&gt;
&lt;p&gt;Also, you should make sure that you use the appropriate header files for the softdevice in question. The easiest way to do this is to make sure that you use the SDK that&amp;#39;s built for the softdevice you use, for example SDK 5.1.0 for S110 version 6.0.0 and SDK 4.4.x with S110 version 5.2.1. If you use the wrong one, you may see strange return codes.&lt;/p&gt;
&lt;p&gt;If you have further problems, I&amp;#39;d be happy if you could supply the complete application you&amp;#39;re working with, so I can do a easy test here. If you don&amp;#39;t want to share it here, feel free to create a regular support case.&lt;/p&gt;
&lt;p&gt;Edit: Thinking more about this, and reading your comments below, I realized that what you see is as you&amp;#39;ve found out a consequence of a problem with the stack pointer handling of S110 version 5.2.1. This should however be fixed with 6.0.0, so I&amp;#39;d strongly recommend you to try that instead.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>