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.

Code non functional with new compiler. v 7.2

Other Parts Discussed in Thread: SYSBIOS

I have a piece of code in my project

    streamParams.maxIssues = NUM_BUFS;
    chanParams = audioIfChanDefaultInfo[1].chanParam;
    chanParams->edmaHandle = hEdma;
    streamParams.chanParams =(UArg)&audioIfChanDefaultInfo[DriverTypes_OUTPUT];

    /* open the I/O streams */
    outStream = Stream_create("/audio0", DriverTypes_OUTPUT,&streamParams, &eb);

this compiles and executes correctly when compiled with TMS320C6x C/C++ Compiler v6.1.5.

This however generated COFF format and we needed ELF format. So we moved to TMS320C6x C/C++ Compiler v7.2.0. Now the executable generated gives the following error for the same code.

t=0x001da250] [tid=0x0] xdc.runtime.Main: Welcome to devnodeServer's main()
[t=0x00000015:c25ecf5d] [tid=0x0] ti.sysbios.knl.Task: ERROR: "", line 330: E_stackOverflow: Task 0x8b106d50 stack overflow.
ti.sysbios.knl.Task: line 330: E_stackOverflow: Task 0x8b106d50 stack overflow.
xdc.runtime.Error.raise: terminating execution

I even moved to latest version of 7.2 compiler and we still get the same error. What can we try to fix this issue?

  • This error is coming from BIOS. I will move this to the BIOS forum so the folks there can help you with this.

  • Thanks. I put it under compiler forum because the same code base worked when compiled with 6.x compiler. Actually his issue is very urgent for us and any help will be appreciated.

  • Can you please tell me what version of BIOS did you use with codegen v6.1.5 and which version for v7.2.0?

    The error states that your Task stack overflowed.  This means you need to increase your task's stack.  You can do that by either changing it on a per task basis or changing the default stack size.  Why this is happening now could depend on a number of things.  One could be that you were close to an overflow before and this new compiler put you over the  limit.  Or it could be that defaults could have changed assuming you are using different BIOS versions.

    To change on a per task basis you need to change the 'stackSize' of the instance parameter.

    Task_Params_init(&taskParams);
    taskParams.stackSize = 1024;
    Task_create(Fxn, &taskParams, &eb);

    To change the default stack size, this needs to be done a config time in your .cfg file.

    var Task = xdc.useModule('ti.sysbios.knl.Task');
    Task.defaultStackSize = 0x1000;

    Judah

     

  • Thanks.

    In both cases teh BIOS version is 6.31.4.27. I did try to increase the knl task stacksize. That did not help. In fact the original code had no stacksize defined and it still worked. To do away wiht this error I allocated a stack of 8092 but I still get this error.

    Sachin

  • Task = xdc.useModule('ti.sysbios.knl.Task');
    var params = new Task.Params;
    params.priority = 5;
    params.stackSize = 8192;

    this is what I have now and I still get the error.

  • You are getting a stack overflow in one of your tasks.   BIOS is catching this curing task switch and throwing an assert() and halting.

    ELF should not need more stack than COFF, so I'm a bit puzzled by this.   Maybe the timing is slighlty different which is causing this problem.


    I suggest you use ROV to review your current stack usage on the COFF build and see how close to the limit you are.   You might be right at the limit and getting luck on COFF. And ELF is slightly different and taking you over the top.    ROV is documented in the BIOS User's Guide.

    To remedy, you can change the default stack size in the configuration tool.  This will change the stacksize for tasks where you do not specify their stack size.

    Task = xdc.useModule('ti.sysbios.knl.Task');
    Task.defaultStackSize = 8192;

    You can specify task stack size on a per Task basis via the params.stackSize parameter to the Task_create() API (Task.create in the .cfg file).


    -Karl-

  • Thanks Karl,

    I tries increasing the stack 3 times, starting with 0x1000, then 0x2000 and finally 0x3000. none of the three help and I get same error. I am beginning to think it is not a stack size issue (albeit the error I get seems to point to that) but some very basic pointer/structure issue exposed when moving from COFF to ELF. What else can I do to figure this out.?

    Sachin

  • One more question on this topic. In the error I see

    Task 0x8b106d50 stack overflow

    What is the significance of 0x8b106d50. Is it that the task that has had a stack overflow should be at that address? I ask this because when I look at that I address I see only NOPs.

  • Hi Sachin,

    The pointer displayed in the Task overflow error is the Task object handle, not the Task function.  This is data, not code--so looking at it in a disassembly window won't yield anything very insightful.

    Regards,

    Shreyas

  • I now see a different warning if I try to set the stack size in configuration file. I have already posted a new thread for that.

    I am trying to set the TSK stack size in cfg file but that seems to be ineffective. I get following warnings

     

    warning: ti.bios.MEM: "/sim/scratch_a0850441/Centaurus/mfp_3_21_07_26_2011/bios_6_32_02_39/packages/ti/bios/MEM.xs", line 360: ti.bios.MEM : Cannot change xdc.cfg.Program.stack. Parameter changed elsewhere
    warning: ti.bios.TSK: "/sim/scratch_a0850441/Centaurus/mfp_3_21_07_26_2011/bios_6_32_02_39/packages/ti/bios/TSK.xs", line 361: ti.bios.TSK : Cannot change ti.sysbios.knl.Task defaultStackSize. Parameter changed elsewhere
    warning: ti.bios.TSK: "/sim/scratch_a0850441/Centaurus/mfp_3_21_07_26_2011/bios_6_32_02_39/packages/ti/bios/TSK.xs", line 361: ti.bios.TSK : Cannot change ti.sysbios.knl.Task idleTaskStackSize. Parameter changed elsewhere

    What could be going wrong?