OSDumpTask and OSDumpTCBStacks in 5441x

Discussion to talk about software related topics only.
Post Reply
lslarry86
Posts: 20
Joined: Tue Jul 18, 2017 12:28 pm

OSDumpTask and OSDumpTCBStacks in 5441x

Post by lslarry86 » Fri Jan 10, 2020 8:29 am

I suspect I am running low on stack space in a Mod5441x project, and need some help accessing OSDumpTasks and OSDumpTCBStacks. They are not in C:\nburn\lib\MOD5441x.a or DBMOD5441x.a (filesinspected with emacs). The declarations in my ucos.h are grayed out, looks like UCOS_STACKCHECK is not defined. When I force the issue by copying the declarations to my project's main.cpp, the linker can't find the functions.

The missing calls are in some of the other libs:
Larry@LAPTOP-K7402PLE /cygdrive/c/nburn
$ grep -i osdumptask lib/*
Binary file lib/CB34EX.a matches
Binary file lib/DBCB34EX.a matches
Binary file lib/DBMCF5208.a matches
...
Do I need to recompile the Netburner libs? I've managed to avoid that in 3 years of NetBurner usage. Is there a reference?

User avatar
TomNB
Posts: 258
Joined: Tue May 10, 2016 8:22 am

Re: OSDumpTask and OSDumpTCBStacks in 5441x

Post by TomNB » Mon Jan 13, 2020 9:52 am

Hello,

We run on everything from a single chip with 32k of ram, to a larger platform like the 5441x with 64MB of ram. The default stack size if 8k. You can change that in constants.h (tools 2.x). Or, if you create a task, you can specify any value you wish. Alternatively, if you are declaring something large, like a buffer, you can make it static so it goes in the global space.

lslarry86
Posts: 20
Joined: Tue Jul 18, 2017 12:28 pm

Re: OSDumpTask and OSDumpTCBStacks in 5441x

Post by lslarry86 » Mon Jan 13, 2020 12:48 pm

Hi Tom, I can see the declared stack sizes, and have changed a bunch of on-stack arrays to static. None were bigger than 64 bytes. I suppose I could declare a new task with a nice big stack for all my UserMain stuff. But this is supposed to be a high reliability system. Now that I think I have seen a problem, I want to be able to inspect stack usage at runtime. So maybe I should have asked "is it some kind of mistake that OSDumpTask and OSDumpTCBStacks are left out of the 5441x libraries and what do I have to do to get access to those functions?"

User avatar
pbreed
Posts: 813
Joined: Thu Apr 24, 2008 3:58 pm

Re: OSDumpTask and OSDumpTCBStacks in 5441x

Post by pbreed » Tue Jan 14, 2020 4:45 pm

To dump stacks aetc..
The system needs to add additional things to the Task control blocks...

So to make these appear you need to modify the ucos stack checking flags in nburn\include\predef.h
and then REBUILD everything.

So the flag :

#define UCOS_STACKCHECK (1)

Will get you both

void OSDumpTCBStacks( void );
and
void OSDumpTasks( void );


You might also like:
#define UCOS_TASKLIST (1)
and
void ShowTaskList( void );

Post Reply