Hello,
I wonder if there is any thread limit on Chibios?
I am currently running a 3 thread project on an AVR (ATMEGA328P) with 2k of RAM and wenever I try to activate a fourth thread, it simply does not run at all. If I change initialization position on mainthread, then, the last one is never started.
Unfortunately I am using an ICSP programmer without debug support, so I cannot check any of the Debug messages generated by the OS.
I have checked memory after compilation and the whole project is using 1606 Bytes, so there is still free RAM.
The working area for the threads are (64+64+128+64), but as I've said, if I change thread initialization position, the last one never starts.
Is there any configuration on the chconf.h file that may be affecting this?
Thanks
Thread limit?
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Thread limit?
Hi,
Adding threads you use BSS RAM, the main thread stack is allocated on top of the RAM so by adding too many threads (or other objects) you overlap it.
You should be able to see this in the .map file (it is always a good idea to verify allocation there).
In general, threads are only limited by RAM availability.
Giovanni
Adding threads you use BSS RAM, the main thread stack is allocated on top of the RAM so by adding too many threads (or other objects) you overlap it.
You should be able to see this in the .map file (it is always a good idea to verify allocation there).
In general, threads are only limited by RAM availability.
Giovanni