Typical footprint

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

Typical footprint

Post by cschneider »

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: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Typical footprint

Post by Giovanni »

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: 95
Joined: Sat Mar 19, 2016 8:07 pm
Has thanked: 8 times
Been thanked: 23 times

Re: Typical footprint

Post by electronic_eel »

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: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Typical footprint

Post by Giovanni »

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

Post by cschneider »

Thanks for your answers !
Post Reply