Typical footprint

Discussions and support about ChibiOS/RT, the free embedded RTOS.
cschneider
Posts: 2
Joined: Thu Nov 22, 2018 2:17 pm

Typical footprint

Postby cschneider » Thu Nov 22, 2018 2:23 pm

Hello,

I consider using ChibiOS for new development on ARM cortex-M3 and I am wondering if I should use RT or NIL version.
I saw that NIL version's footprint is 1k : http://www.chibios.org/dokuwiki/doku.ph ... :nil:start
I found in forum one user speaking about 15k for RT : viewtopic.php?t=4411

Can I consider this 15k a good value for RT ?

Thanks !
Chris

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Typical footprint

Postby Giovanni » Thu Nov 22, 2018 3:46 pm

Hi,

15kB is waaaay to high.

Nil is about 800 bytes without library extensions, RT is around 8kB in a typical/max configuration. If you could specify which configuration you need I could be more accurate.

RT small configurations are like 2..3kB.

Debug options increase size of course.

Giovanni

electronic_eel
Posts: 77
Joined: Sat Mar 19, 2016 8:07 pm
Been thanked: 17 times

Re: Typical footprint

Postby electronic_eel » Fri Nov 23, 2018 11:07 pm

Also consider RAM usage and allocation strategy, not just code size. With current Cortex-M controllers I find myself restricted by RAM more often than by flash size.

RT uses dynamic memory allocation, NIL uses static allocation.

If RAM is tight and you use dynamic allocation, you could run into a fragmentation problem: The total amount of free memory would be enough to continue your program, but previous allocate/free cycles have left just small continuous chunks that are not enough to allocate one larger continuous block. It can be very hard to make sure you don't have such a problem, as it could depend on one rarely seen execution pattern that is not easy to trigger or predict.

NIL with it's static allocation is safe against this problem.

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Typical footprint

Postby Giovanni » Sat Nov 24, 2018 6:37 am

Sorry but also RT is fully static, it is -able- to use dynamic allocation but it is an option.

There is another difference, NIL objects are generally much smaller, 4 bytes for a semaphore vs 12, 16 bytes for a thread vs 60+. NIL is ideal for very small MCUs, it is its reason to be.

Giovanni

cschneider
Posts: 2
Joined: Thu Nov 22, 2018 2:17 pm

Re: Typical footprint

Postby cschneider » Fri Nov 30, 2018 1:44 pm

Thanks for your answers !


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 7 guests