Hi,
I have read the pages regarding memory allocation, but the real heap use on the target is quite a bit higher than expected - I hope You can help me understand why.
Port: ARM on LPC2000
When I do not start any tasks - just start the scheduler - and then stop the target, the xNextFreeByte is 580. If I start one task with minimal task size of 128, I get 1160 (ie. 580 bytes extra). Starting two tasks results in 1740 (ie. 2x580bytes).
Starting the scheduler will automatically create the idle task which is way some heap space is taken.
A stack size of 128 on ARM will result in 128 * 4 bytes being used, as each stack item is byte byts (32bits). The little extra allocated is due to the allocation of the TCB for the task.
stack depth is defined in 32bit words, so you have 128 * 4 + memory for task list element. Minimal stack of thread is 18 (16 32bit-registers R0-R15, SPSR and nesting word) I think.