An Arduino Library for Nil RTOS

Discussions and support about ChibiOS/NIL, the almost nil RTOS.
wgreiman
Posts: 33
Joined: Sun Oct 23, 2011 3:21 pm
Been thanked: 2 times

Re: An Arduino Library for Nil RTOS

Post by wgreiman »

I have ported the latest Nil RTOS files to Arduino as NilRTOS20130720.zip http://code.google.com/p/rtoslibs/downloads/list.

Here is a post with more information http://forum.arduino.cc/index.php?topic=178532.0.

I have included an SD FAT library I wrote for Arduino, a Nil friendly I2C library, and ADC library.
ryan
Posts: 1
Joined: Mon Oct 14, 2013 10:13 pm

Re: An Arduino Library for Nil RTOS

Post by ryan »

I'm new to the whole RTOS way of doing things, but have successfully put together a "project" with 4 threads on a ATmega328P (think Arduino Uno). When trying to add another thread I run into freezes and crashes which I can only assume mean I'm running out of heap space to run it all.

Since I've never had to give much thought to how much memory to allocate to each thread or what size the whole heap is before, can anyone point me in the right direction to figure out more accurately how much memory to give each thread? And how to know when I'm running up against the limit of available RAM?

Thanks in advance for any pointers!
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: An Arduino Library for Nil RTOS

Post by Giovanni »

64 bytes is a good start usually for threads that do not call anything from their function, if you call complex functions from your thread then try 128 or 192.

Note that Nil is static, it does not allocate memory at runtime, it is a good idea to look at the .map file for details.

Giovanni
colin
Posts: 149
Joined: Thu Dec 22, 2011 7:44 pm

Re: An Arduino Library for Nil RTOS

Post by colin »

ryan wrote:I'm new to the whole RTOS way of doing things, but have successfully put together a "project" with 4 threads on a ATmega328P (think Arduino Uno). When trying to add another thread I run into freezes and crashes which I can only assume mean I'm running out of heap space to run it all.

Since I've never had to give much thought to how much memory to allocate to each thread or what size the whole heap is before, can anyone point me in the right direction to figure out more accurately how much memory to give each thread? And how to know when I'm running up against the limit of available RAM?

Thanks in advance for any pointers!


If you haven't already, make sure you enable all the ChibiOS/RT debugging options in the chconf.h file. On an ARM platform with a JTAG debugger, you would be able to inspect a special location in memory where ChibiOS/RT puts information about an error when an assertion fails, but I don't know how you can do this on an ATmega328...
Tommino
Posts: 7
Joined: Thu Sep 20, 2012 1:16 pm

Re: An Arduino Library for Nil RTOS

Post by Tommino »

Hello,

is there any short-term plan to have latest NilRTOS version also for AVR, resp. directly for Arduino? I was trying to compile repository Nil version with help of old nilcore file(s) for AVR and it was not easy and I didn't finis it. Is somebody working on it already?
Thanks a lot!

Best regards,
Tommino
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: An Arduino Library for Nil RTOS

Post by Giovanni »

Hi,

The Nil has been merged with ChibiOS 3.0, the AVR port is missing right now but it is the next thing I will add, I imagine then Bill will update his excellent libraries using the new code.

Giovanni
Tommino
Posts: 7
Joined: Thu Sep 20, 2012 1:16 pm

Re: An Arduino Library for Nil RTOS

Post by Tommino »

Hi Giovanni,

it sounds good, thanks.
-Tommino
Jim Ford
Posts: 1
Joined: Fri Dec 20, 2013 11:33 pm

Re: An Arduino Library for Nil RTOS

Post by Jim Ford »

What's the current status of NilRTOS, please?

I've been looking at nilRTOS20137020 and have a few questions to ask. I've posted them on the Arduino forum, but so far not had a response.

Has development of NilRTOS on the AVR petered out?

Jim
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: An Arduino Library for Nil RTOS

Post by Giovanni »

Hi,

As far I know the development of Arduino libraries is still ongoing, the author posted here just yesterday about it.

memberlist.php?mode=viewprofile&u=200

If you have general questions about Nil, not specific to Arduino, you may ask here too.

Giovanni
Post Reply