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.

why would C++ Class copy result in Task_sleep goto abort?

Other Parts Discussed in Thread: SYSBIOS

i am developing a c/ c++ dspbios project  under ccs 4.1.2 ,when i copy one class A to class A0,then call Task_sleep,the program would goto abort.the cold is as follows:

//calss  Enc_STAT;

 

Enc_STAT A0;

Enc_STAT A;

void updateState()

{

...

A0=A;

Task_sleep(10);

...

}

if i delete  A0=A;the program run fine.i don't know why? please help me!

  • I suspect that you are overrunning your task stack.

    Try increasing the size of your task stack and see if the problem clears up.

    You can increase the size of all task stack by adding the following to your config script:

        var Task = xdc.useModule('ti.sysbios.Task');

        Task.defaultStackSize = 16384;   /* sets all task stacks to 16,384 bytes by default */

    As long as you don't explicitly set the stack size in the Task.Params structure passed to Task.create() or Task_create(), the tasks will inherit their stack size from this Task module parameter.

    Alan

  • thanks Alan DeMars ,i had done as what you said,now the task runs  ok.you are really very kind and smart.but i don't  know the relationship of the Program.stack  and task  stack;should i define the Program.stack  bigger than the task  stacksize?

  • Program.stack defines the size of the stack used during the system initialization sequence and within main() (ie the 'C' stack).

    Program.stack also defines the size of the interrupt or Hwi stack.

    During the BIOS_start() call within main(), the 'C' stack is re-assigned for use as the Hwi stack.

    The stacks associated with each task are then used when their corresponding task function is running.

    Alan

  • thank you very much!