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
Typical footprint
- 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
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
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
-
- Posts: 77
- Joined: Sat Mar 19, 2016 8:07 pm
- Been thanked: 17 times
Re: Typical footprint
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.
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.
- 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
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
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
-
- Posts: 2
- Joined: Thu Nov 22, 2018 2:17 pm
Who is online
Users browsing this forum: No registered users and 7 guests