Altera_Forum
Honored Contributor
14 years agoTASK_STACKSIZE setting in Simple Socket Server
I just got the Nios II Simple Socket Server example app working on a custom board with a Cyclone III and 512KB SRAM (no other RAM). the original elf file was almost 900kbytes, with a significant portion of that in .bss, so it wouldn't fit in available memory.
To get the memory footprint of the app down to a manageable size i changed the task_stacksize in niosii_simple_socet_server.h from 32768 to 2048. This gave me an elf file size of 339kb and after considerable fussing around with other details, I got the SSS to run correctly on my board. Wooo Hooo !!! Then I added the el camino sd/mmc spi core component to Qsys and tried to run SSS with this configuration to see if anything had broken in the process. The ELF file was still 339KB, but the app crashed after the DHCP task completed with this display on the Nios II Console: Nios II Simple Socket Server starting up. Created "monitor_phy" task (Prio: 9) panic: stack alloc dtrap - needs breakpoint ip_exit: calling func 0x101c794 netclose: closing iface Altera TSE MAC ethernet ip_exit: calling func 0x102428c i changed the task_stacksize from 2048 to 1024 and now the SSS runs without error. All well and good for now. My question is: why was the task_stacksize set so high in the first place, and am i setting myself up for more problems down the road by reducing it to 1024? Thanks in advance for your comments and suggestions.