Thread Size

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
User avatar
tfAteba
Posts: 551
Joined: Fri Oct 16, 2015 11:03 pm
Has thanked: 91 times
Been thanked: 50 times

Thread Size

Post by tfAteba »

Hi Giovanni,

I want to know how we can determine the minimum a thread size so that we just use the amount of memory needed?
Is there also a maximum while creating a thread?

Thank you.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Thread Size

Post by Giovanni »

Hi,

The debug plugin in ChibiStudio is able to report the amount of stack used, you may use the information to optimize the size. You need to activate the stack filling option in chconf.h.

Giovanni
User avatar
tfAteba
Posts: 551
Joined: Fri Oct 16, 2015 11:03 pm
Has thanked: 91 times
Been thanked: 50 times

Re: Thread Size

Post by tfAteba »

Thanks for your answer Giovanni.

But I'm sorry, I'm not using ChibiStudio. My configuration is Ubuntu + Makefile + ChibiOS/RT.

So in this case is there a way do have the same functionality as your debug plugging for example or any other way?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Thread Size

Post by Giovanni »

Hi,

Inspect stack areas and measure unused space by looking at the filler.

Giovanni
User avatar
tfAteba
Posts: 551
Joined: Fri Oct 16, 2015 11:03 pm
Has thanked: 91 times
Been thanked: 50 times

Re: Thread Size

Post by tfAteba »

Thank you Giovanni.

I will look that tonight.
Post Reply