andrewfrazer wrote on Wednesday, March 16, 2016:
Im using version 8.2.3, which is what is bundled with the most recent version of Microchip Harmony, and basing my work on the same that is provided ( tcpip_client_server ). I have however removed all but one of the services, so it only is running the udp server as that is all i need.
in FreeRTOS.h there is this defination
#define configTOTAL_HEAP_SIZE ( ( size_t ) 40960 )
the Project defintaitons have a linker size set of 58368 bytes.
I instlled the Plugin, and it does show the stack sizes… See the screen shot below; I do belive the stack overflow and malloc failed hooks are defined, as when things stop the code ends up in the generalexceptionhander function, sitting in the SYS_DEBUG_Breakpoint() endless loop.
You said the stacks used by the tasks are allocated from the heap… I can see 25616 bytes being used the 9 tasks. I know if i change the heap to less than 50,000 it will stop. So give or take theres another 25000 odd bytes that i have no idea where they are being used.
With a heap this big, I end up running out of memory for my stack.
Here is what is defined size wise for the tasks that are running. The size of the stacks in the plugin tool seem much bigger than what is defined, or are these somethign different.
/* Create OS Thread for Sys Tasks. */
xTaskCreate((TaskFunction_t) _SYS_Tasks,
"Sys Tasks",
1024, NULL, 4, NULL);
/* Create task for file system state machine*/
/* Create OS Thread for SYS_FS Tasks. */
xTaskCreate((TaskFunction_t) _SYS_FS_Tasks,
"SYS_FS Tasks",
2048, NULL, 1, NULL);
/* Create OS Thread for SYS_CONSOLE Instance 0 Tasks. */
xTaskCreate((TaskFunction_t) _SYS_CONSOLE_IDX0_Tasks,
"SYS_CONSOLE Instance 0 Tasks",
1024, NULL, 8, NULL);
/* Create OS Thread for Sys Command Tasks. */
xTaskCreate((TaskFunction_t) _SYS_COMMAND_Tasks,
"Sys Command Tasks",
1024, NULL, 7, NULL);
/* Create task for gfx state machine*/
/* Create OS Thread for USB Tasks. */
xTaskCreate((TaskFunction_t) _USB_Tasks,
"USB Tasks",
1024, NULL, 1, NULL);
/* Create task for TCPIP state machine*/
/* Create OS Thread for TCPIP Tasks. */
xTaskCreate((TaskFunction_t) _TCPIP_Tasks,
"TCPIP Tasks",
1024, NULL, 9, NULL);
/* Create OS Thread for APP Tasks. */
xTaskCreate((TaskFunction_t) _APP_Tasks,
"APP Tasks",
512, NULL, 1, NULL);
/* Create OS Thread for APP3 Tasks. */
xTaskCreate((TaskFunction_t) _APP3_Tasks,
"APP3 Tasks",
512, NULL, 6, NULL);
xTaskCreate((TaskFunction_t) _Flash_Leds,
"Flash Leds",
100, NULL, 4, NULL);
```