Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12420 Discussions

uC/OS-II Stack Size always at maximum defined

Altera_Forum
Honored Contributor II
830 Views

Hi, 

 

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.  

 

Scenario: 

  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
Altera_Forum
Honored Contributor II
112 Views

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

Reply