Problem with StkUnused calculation Topic is solved

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

Problem with StkUnused calculation  Topic is solved

Postby thor.thau » Mon Jan 16, 2017 10:22 am

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.
Thor Thau
Embedded software developer

User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Location: Munich (Germany)
Has thanked: 83 times
Been thanked: 67 times
Contact:

Re: Problem with StkUnused calculation

Postby RoccoMarco » Mon Jan 16, 2017 4:21 pm

Hi,
do you have set CH_DBG_FILL_THREADS as TRUE in chconf.h?
Ciao,
RM

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

Postby thor.thau » Mon Jan 16, 2017 4:34 pm

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.
Thor Thau
Embedded software developer

User avatar
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: Problem with StkUnused calculation

Postby Giovanni » Mon Jan 16, 2017 7:03 pm

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

Postby jayalfredprufrock » Thu Mar 16, 2017 6:14 am

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Problem with StkUnused calculation

Postby Giovanni » Tue Apr 25, 2017 9:20 am

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Problem with StkUnused calculation

Postby Giovanni » Tue Aug 22, 2017 1:17 pm

This problem has been fixed, new plugins are available.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 11 guests