Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12603 Discussions

uC/OS-II Stack Size always at maximum defined

Honored Contributor II



I need help in understanding what could be the cause of the phenomena I see. 

I have a webserver application (started from the altera example) to which I added a couple of other threads 

- Database - a thread polling a large number of periphery components (i2c, Avalon-MM) and updates the latest value in a global array 

- Http - accepts connections, fetches files from ZipFS, parses them and replaces certain strings with the values from the large array 

- watchdog, etc... 

- terminal --> I have also implemented a stack checking command.  



  1. application up, no link -> Http not started; DATABASE uses ~4KB of stack  

  2. http started, 1st request -> Database uses maximum defined.  



Interesting, if I allocate 64KB or 4MB (which it uses completely), the application is stable in both cases, no difference. 

The whole application uses ~ 1MB, so the I can't explain how it reaches those numbers... 


My questions: 

  1. What could be the reason the OSStatChk is reporting me these numbers? 

  2. From my observation, this numbers returned by OSStatChk are the maximum ever used since startup. Is there a way to reset these counters? 


********************************************************* *** OS_TASK *** used free ********************************************************* HTTP_TASK 28356 37180 TERMINAL_TASK 3776 4416 DATABASE_TASK 262144 0 PHYMON_TASK 3968 4224 WATCHDOG_TASK 3812 4380 TELNET_TASK 5996 10388
0 Kudos
1 Reply
Honored Contributor II

Moving to the new "Other Operating Systems" forum. This is where all non-Linux OS related questions will go moving forward.

0 Kudos