Hi!
How I can determine the stack size of a static thread?
For example in THD_WORKING_AREA:
/*
* Working area for the LED flashing thread.
*/
static THD_WORKING_AREA(myThreadWorkingArea, 128);
/*
* LED flashing thread.
*/
static THD_FUNCTION(myThread, arg) {
while (true) {
LED_ON();
chThdSleepMilliseconds(500);
LED_OFF();
chThdSleepMilliseconds(500);
}
}
Thanks!
Size stack in static threads
Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
Re: Size stack in static threads
Hi,
There is an option in chconf.h that enables a stack filler, you can use a debugger to see how much memory is left. In ChibiStudio there is a debug plugin that does that automatically, it shows all threads and their attributes.
Giovanni
There is an option in chconf.h that enables a stack filler, you can use a debugger to see how much memory is left. In ChibiStudio there is a debug plugin that does that automatically, it shows all threads and their attributes.
Giovanni
-
- Posts: 2
- Joined: Sat Mar 03, 2018 12:27 pm
- Has thanked: 4 times
Re: Size stack in static threads
Giovanni wrote:Hi,
There is an option in chconf.h that enables a stack filler, you can use a debugger to see how much memory is left. In ChibiStudio there is a debug plugin that does that automatically, it shows all threads and their attributes.
Giovanni
Hi
I changed CH_DBG_FILL_THREADS in chconf.h to TRUE. after clean and rebuild and run the application via debugger I couldn't find a place to watch the amount of stack the is used.
I guess it should be in ChibiOS/RT 4.x.x Debug View tab. but it is totally empty. Should I do anything further?
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
Re: Size stack in static threads
Hi,
You need to press the refresh button on the ChibiOS view (top right), you also need to do this AFTER chSysInit() has been called and while the application is stopped.
Giovanni
You need to press the refresh button on the ChibiOS view (top right), you also need to do this AFTER chSysInit() has been called and while the application is stopped.
Giovanni
-
- Posts: 4
- Joined: Mon Apr 16, 2018 10:37 pm
Re: Size stack in static threads
Hi, everyone
How do I use and configure the chibios plugin? Do you have any tutorials? I downloaded and rode some demos but I did not understand how to check the memory for each thread..
Thanks for help me!
How do I use and configure the chibios plugin? Do you have any tutorials? I downloaded and rode some demos but I did not understand how to check the memory for each thread..
Thanks for help me!
-
- Posts: 4
- Joined: Mon Apr 16, 2018 10:37 pm
Re: Size stack in static threads
gujoseleite wrote:Hi, everyone
How do I use and configure the chibios plugin? Do you have any tutorials? I downloaded and rode some demos but I did not understand how to check the memory for each thread..
Thanks for help me!
Complementing..
I work with an arduino board and would like to debug via Chibios Studio, but I can not configure some debugger settings. I do not know how to define in debbuger the "targets" that should be observed ...
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
Re: Size stack in static threads
Hi,
The ChibiOS plugin does not require any configuration, stop execution and refresh the view using the small yellow-ish button in the view toolbar.
Have you tried the video guides on Play Embedded? there are several tutorial you could try.
http://www.playembedded.org
Giovanni
The ChibiOS plugin does not require any configuration, stop execution and refresh the view using the small yellow-ish button in the view toolbar.
Have you tried the video guides on Play Embedded? there are several tutorial you could try.
http://www.playembedded.org
Giovanni
-
- Posts: 4
- Joined: Mon Apr 16, 2018 10:37 pm
Re: Size stack in static threads
Giovanni wrote:Hi,
The ChibiOS plugin does not require any configuration, stop execution and refresh the view using the small yellow-ish button in the view toolbar.
Have you tried the video guides on Play Embedded? there are several tutorial you could try.
http://www.playembedded.org
Giovanni
Hi,
I used a demo for arduino uno that is in chibios studio and created a new project following the tutorial: http://www.chibios.org/dokuwiki/doku.ph ... s:eclipse2.
But in the debugger configuration in "startup tab", I do not know which "targets" to put in the case of the arduino platform. The soft_reset_halt monitor and soft_reset_halt monitor commands among others in the tutorial are used for another platform. When executing the debug the project apparently works however the commands that you indicated are not available and in some the message: "Target Request Failed: Do not know how to run."
Thanks for answering!
- Giovanni
- Site Admin
- Posts: 14444
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1074 times
- Been thanked: 921 times
- Contact:
Re: Size stack in static threads
Hi,
Those are OpenOCD commands, if you are using an ST-Link then the launch configuration is always the same, you can copy from another project. If you are using a different debugger then you should refer to the OpenOCD documentation, it could be different.
Giovanni
Those are OpenOCD commands, if you are using an ST-Link then the launch configuration is always the same, you can copy from another project. If you are using a different debugger then you should refer to the OpenOCD documentation, it could be different.
Giovanni
Who is online
Users browsing this forum: No registered users and 14 guests