Page 1 of 1

Typical footprint

Posted: Thu Nov 22, 2018 2:23 pm
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

Re: Typical footprint

Posted: Thu Nov 22, 2018 3:46 pm
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

Re: Typical footprint

Posted: Fri Nov 23, 2018 11:07 pm
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.

Re: Typical footprint

Posted: Sat Nov 24, 2018 6:37 am
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

Re: Typical footprint

Posted: Fri Nov 30, 2018 1:44 pm
by cschneider
Thanks for your answers !