This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C6657 stackHeap and stackSection misunderstanding

Dear all,

I want  to  define a stackHeap  for a task and   not  use the the default stack Section as well.

I have created a new Heap .  You can see below the definition of the heap

var heapMemParamsCM_Env = new HeapMem.Params;
heapMemParamsCM_Env.size = 0x00e7FF00 ;
heapMemParamsCM_Env.align = 8;
heapMemParamsCM_Env.sectionName = "CM_ENVIRONSection";
heapMemParamsCM_Env.instance.name = "cmEnvironHandle";
Program.global.cmEnvironHandle = HeapMem.create(heapMemParamsCM_Env);
Program.sectMap["CM_ENVIRONSection"] = "DDR3"

I have created a new region of memory that is mapped in the external memory, using the platform tool

I want to use the DDR3 memory for the sackheap and the stackSection . The declaration of the new task is the following

var FM_taskFxnParams = new Task.Params();
FM_taskFxnParams.instance.name = "FM_taskFxnHandle";
FM_taskFxnParams.stackSize = 1048;
FM_taskFxnParams.priority = 5;
FM_taskFxnParams.stackHeap = HeapMem.create(heapMemParamsCM_Env);
//TODO: check the definitions below
FM_taskFxnParams.stackSection = ".stack";
Program.global.FM_taskFxnHandle = Task.create("&taskFxn", FM_taskFxnParams);

The .stack section has been defined in the ,cmd file

SECTIONS
{
.stack: > DDR3
}

But the   stack of the stack  is stored in the L2 memory and using the ROV tool I noticed that the stackHeap is null.

Could you clarify what is wrong in the aforementioned definitions  or give to me an other example to use as template.?

Thank you in advance

George

  • George,
    is that allocation for .stack from your custom linker command file or the one generated by XDCtools? There is a setting for stack in the Platform Wizard, where you can define what the allocation for .stack should be.
    Also, do you have any specific reason why you are using .stack for a Task stack. The section .stack is for system stack. If you are not sure what you should use for a Task stack, just don't set it and the default setting will be used.