Problem with StkUnused calculation Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
Post Reply
thor.thau
Posts: 17
Joined: Thu Jul 07, 2016 12:37 pm
Has thanked: 2 times
Been thanked: 7 times

Problem with StkUnused calculation

Post by thor.thau »

ChibiStudio: Preview 17
ChibiOS: 16.1.6
SVN: branches/stable_16.1.x@10032
MCU: STM32F030x8

I have thread where I statically declared working area with a size of 2048 bytes. THD_WORKING_AREA(waThread, 2048U); When I debug and look in ChibiOS/RT 3.x.x Debug View -> Threads tab then the StkUnused is calculated as 0.

Example from my debug view

Code: Select all

Address      StkLimit     Stack        StkUnused
0x20000658   0x20000690   0x20000E14   0


It works correctly if I set the thread working area to 1024 bytes instead.
User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Has thanked: 83 times
Been thanked: 67 times

Re: Problem with StkUnused calculation

Post by RoccoMarco »

Hi,
do you have set CH_DBG_FILL_THREADS as TRUE in chconf.h?
thor.thau
Posts: 17
Joined: Thu Jul 07, 2016 12:37 pm
Has thanked: 2 times
Been thanked: 7 times

Re: Problem with StkUnused calculation

Post by thor.thau »

RoccoMarco wrote:Hi,
do you have set CH_DBG_FILL_THREADS as TRUE in chconf.h?


Yes, it is set to TRUE and I also checked with the debugger that all the stack memory was set to 0x55.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Problem with StkUnused calculation

Post by Giovanni »

I will look into the plugin, there could be something in there.

Moving into "bug reports".

Giovanni
jayalfredprufrock
Posts: 36
Joined: Tue Jan 13, 2015 6:33 am
Has thanked: 8 times

Re: Problem with StkUnused calculation

Post by jayalfredprufrock »

Not sure if this is related, but I have also noticed strange stkunused calculations recently. The majority of my threads are actually reporting more unused stack space than what they have allocated (some times > twice as much). I'm using the the 3.0 eclipse plugin (4.0 version doesn't seem to work for me, at least on OSX). I'm also running the latest release of Chibios (but also tried rolling back a few versions without seeing any difference). I'm positive the FILL_THREADS option is turned on and I see plenty of 0x55 in between my thread stacks. Am I supposed to be using the 4.0 plugin?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Problem with StkUnused calculation

Post by Giovanni »

Hi,

The 4.0 plugin is specific for RT4, it does not work with RT3 and vice versa.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Problem with StkUnused calculation

Post by Giovanni »

This problem has been fixed, new plugins are available.

Giovanni
Post Reply