I'm attempting to dynamically create a new task on a C6674, however when I attempt to do so I get the following error:
[C66xx_0] ti.sysbios.heaps.HeapMem: line 294: out of memory: handle=0x10826d18, size=76 xdc.runtime.Error.raise: terminating execution
The C code I'm using to create the task is as follows:
Task_Handle backgroundTask; backgroundTask = Task_create((Task_FuncPtr)BackgroundTask, NULL, NULL); //if (backgroundTask == NULL) { // System_abort("Task create failed"); //} System_printf("Starting SYSBIOS\n"); System_flush(); BIOS_start();
I examined the stack in the ROV, and saw the following:
which lead me to believe that the stack was not big enough, however expanding the BIOS.heapSize still resulted in a stack overflow. Upon examining the memory at the stackBase location, I saw that the entire stack was cleared to 0x00000000 before the code even executes. I saw elsewhere on E2E that the stack should be initialized to 0xBEBEBEBE. While changing the linker file to set the .far section as NOINIT stopped the stack from being cleared to 0, the data there was only garbage and still not 0xBEBEBEBE.
I'm attempting to figure out why the stack isn't being properly initialized as I assume this is the reason behind not being able to create a task. I've already verified that creating a new task works using the "Typical Project" for SYSBIOS and that the stack is properly initialized so it seems like whatever does the stack initialization isn't running in my code. I was wondering if anyone could point me to where this init code is located so I can figure out how to get it to run. I've also attached my .cfg file.2046.app.cfg