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.

What does the error logging indicate?

Other Parts Discussed in Thread: SYSBIOS

 

When I was debugging my code, there's a error logging information was : "ti.sysbios.knl.Task: line 345: E_spOutOfBounds: Task 0x20001c1c stack error, SP = 0x200010a4". What does this error mean? I've traced the code and found it occured at the call of  "semaphore _pend(semhandle, BIOS_WAITFOREVER)" in my code and at the call of Taks_restore() in the sysbios knl code.

Thanks!

  • From what thread are you calling Semaphore_post() for the semaphore the task is pending on? Sometimes this error occurs when Semaphore_post() is called by an ISR that is not being managed by the SYS/BIOS interrupt dispatcher. 

    Alan

    On Nov 27, 2012, at 6:17 PM, "Jeanne Yi" <bounce-3494060@e2e.ti.com> wrote:

     

    When I was debugging my code, there's a error logging information was : "ti.sysbios.knl.Task: line 345: E_spOutOfBounds: Task 0x20001c1c stack error, SP = 0x200010a4". What does this error mean? I've traced the code and found it occured at the call of  "semaphore _pend(semhandle, BIOS_WAITFOREVER)" in my code and at the call of Taks_restore() in the sysbios knl code.

    Thanks!

  • Jeanne,

    You can see a description of the E_spOutOfBounds  error by going to the CCS Help->Help Contents and then going to the contents pane and selecting SYS/BIOS->API reference->ti->sysbios->knl->Task.  The help page notes this error is raised when a task's stack pointer (SP) does not point somewhere within the task's stack.  This error is raised by kernel's stack checking function. This function checks the SPs before every task switch to make sure they point within the task's stack.

    You don't really provide enough information for Alan or anyone else to say for sure why you are seeing this issue.  What version of BIOS are you using?  On what device?  Can you post your cfg file in this thread?

    Dave

  • David,

    Thank you very much! I've checked the help content before I posted the question. I know there's some problem with stack, but I don't know whether the error mean the stack size for some task is not enough. Because the proj has many code files, I'm sorry it's hard to post them here.

    Can you please give me some possible suggestions to resolve this error?

    Thanks a lot! 

  • Jeanne,

    I didn't ask you to post all of your files -- just one: the BIOS config (.cfg) file.

    You still haven't mentioned what version of BIOS you are using.  And you still haven't mentioned what device you are running on.

    Dave

  • David,

    Sorry I haven't give you enough information.

    I'm using SYS/BIOS 6.33.4.39 and the device is F28M35x.

    Part of the .cfg content is as below:

    var Defaults = xdc.useModule('xdc.runtime.Defaults');
    var Diags = xdc.useModule('xdc.runtime.Diags');
    var Error = xdc.useModule('xdc.runtime.Error');
    var Log = xdc.useModule('xdc.runtime.Log');
    //var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');  //console output,jeanne, 2012.11.29
    var Main = xdc.useModule('xdc.runtime.Main');
    var Memory = xdc.useModule('xdc.runtime.Memory')
    //var SysMin = xdc.useModule('xdc.runtime.SysMin');   //console output,jeanne, 2012.11.29
    var System = xdc.useModule('xdc.runtime.System');
    var Text = xdc.useModule('xdc.runtime.Text');

    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    var Clock = xdc.useModule('ti.sysbios.knl.Clock');
    var Swi = xdc.useModule('ti.sysbios.knl.Swi');
    var Task = xdc.useModule('ti.sysbios.knl.Task');
    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
    //var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
    var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
    var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
    var ti_sysbios_family_arm_m3_Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');

    var Load = xdc.useModule('ti.sysbios.utils.Load');
    /* ================ System configuration ================ */
    var SysFlex = xdc.useModule('ti.mcusdk.utils.SysFlex');
    SysFlex.abortFxn = "&UARTUtils_systemAbort";
    SysFlex.putchFxn = "&UARTUtils_systemPutch";
    SysFlex.readyFxn = "&UARTUtils_systemReady";
    System.SupportProxy = SysFlex;

    /* ================ Driver configuration ================ */
    var McuSdk = xdc.useModule('ti.mcusdk.McuSdk');
    var GPIO = xdc.useModule('ti.drivers.GPIO');
    var UART = xdc.useModule('ti.drivers.UART');

    Task.defaultStackSize = 1024;

    /*
     * Program.argSize sets the size of the .args section.
     * The examples don't use command line args so argSize is set to 0.
     */
    Program.argSize = 0x0;

    /*
     * Minimize exit handler array in System.  The System module includes
     * an array of functions that are registered with System_atexit() to be
     * called by System_exit().
     */
    System.maxAtexitHandlers = 4;      

    /*
     * Uncomment this line to disable the Error print function. 
     * We lose error information when this is disabled since the errors are
     * not printed.  Disabling the raiseHook will save some code space if
     * your app is not using System_printf() since the Error_print() function
     * calls System_printf().
    Error.raiseHook = null;
     */

    /*
     * Uncomment this line to keep Error, Assert, and Log strings from being
     * loaded on the target.  These strings are placed in the .const section.
     * Setting this parameter to false will save space in the .const section.
     * Error, Assert and Log message will print raw ids and args instead of
     * a formatted message.
    Text.isLoaded = false;
     */

    /*
     * The BIOS module will create the default heap for the system.
     * Specify the size of this default heap.
     */
    BIOS.heapSize = 0x2000;

    /* System stack size (used by ISRs and Swis) */
    Program.stack = 0x1000;

     ti_sysbios_family_arm_m3_Hwi.enableException = false;
    ti_sysbios_family_arm_m3_Hwi.nvicCCR.STKALIGN = 0;
    var ti_sysbios_family_arm_m3_Hwi0Params = new ti_sysbios_family_arm_m3_Hwi.Params();
    ti_sysbios_family_arm_m3_Hwi0Params.instance.name = "ti_sysbios_family_arm_m3_Hwi0";
    ti_sysbios_family_arm_m3_Hwi0Params.enableInt = false;
    ti_sysbios_family_arm_m3_Hwi0Params.priority = 16;
    Program.global.ti_sysbios_family_arm_m3_Hwi0 = ti_sysbios_family_arm_m3_Hwi.create(98, "&IPC_rxIntHndlr", ti_sysbios_family_arm_m3_Hwi0Params);
    BIOS.libType = BIOS.LibType_Instrumented;
    BIOS.assertsEnabled = true;
    BIOS.logsEnabled = true;

  • Try removing this line from the config script:

       ti_sysbios_family_arm_m3_Hwi0Params.priority = 16;

    And report the results.

    Alan

  • Hi, Alan,

    Thank you very much!

    The problem has gone with your suggestion!

    Can you please tell me if the priority of IPC Hwi can't be set manually? I want its priority to be the highest in my system.

    Thanks a lot!

  • Jeanne,

    The short answer is yes, you can configure the IPC interrupt to be the highest in your system, and the priority value you should use to achieve this is '0x20'.

    Hwi priority values for M3 devices is a pretty confusing subject.

    For your device, valid values are 0x00, 0x20, 0x40, 0x60, 0x80, 0xa0, 0xc0, and 0xe0.

    Any priority value less than 0x20 (ie your selection of decimal 16) will result in the Hwi module treating the interrupt as a Zero Latency Interrupt and consequently will not be managed by the SYS/BIOS interrupt dispatcher.

    This is why calling Semaphore_post() from that interrupt handler resulted in the Task's spOutOfBounds error.

    ---

    Here is a discussion of Hwi priorites and Zero Latency Interrupt support that might help clarify your understanding:

        http://processors.wiki.ti.com/index.php/SYS/BIOS_for_Stellaris_Devices#Supported_Priority_Values

    Also, take a look the CDOC description of the M3 Hwi module here:

        http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysbios/6_33_04_39/exports/bios_6_33_04_39/docs/cdoc/ti/sysbios/family/arm/m3/Hwi.html

    As well as the CDOC description of the Hwi priority value here:

        http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysbios/6_33_04_39/exports/bios_6_33_04_39/docs/cdoc/ti/sysbios/family/arm/m3/Hwi.html#metapriority

    Sorry for the confusion and frustration. I hope this helps.

    Alan

  • Alan,

    Thank you very much for your kind and detailed explaination! You answer is very helpful for me.

    Thank you!

    Best Regards,

    Jeanne