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.

Hwi_stack.c

Other Parts Discussed in Thread: SYSBIOS

The code is below. In the debugger its apparent that xdc_target__isaCompatible_28 is undefined and I see no docs that give guidance on defining this and where? I would think stack checking for HWI during dev would be important enough to mention somewhere (-:  ??

Hwi_stack.c

Void ti_sysbios_hal_Hwi_checkStack()
{
#ifdef xdc_target__isaCompatible_28
    volatile UInt one = 1;
    UInt16 *stackTop;

    stackTop =  (UInt16 *)(STACK_BASE) + (SizeT)(&_STACK_SIZE);

    /*
     * SDOCM00084944
     * extraordinary effort to coerce compiler into NOT
     * performing the subtraction of 1 at compile time
     */
    stackTop -= one;

    if (*stackTop != (UInt16)0xbebe) {
#else
    UInt8 *stackTop;

    stackTop = (UInt8 *)STACK_BASE;

    if (*stackTop != (UInt8)0xbe) {
#endif
        Error_raise(NULL, Hwi_E_stackOverflow, 0, 0);
    }

  • Mark,
    the macro used in that code and some others are defined by the target. Users do not need to define it explicitly, unless you are rebuilding SYS/BIOS without using XDCtools. Are you debugging your own rebuilt copy of SYS/BIOS or it's the original code shipped with the product?

    Also, which version of SYS/BIOS are you using, and for which CPU?

     

  • I did not rebuild sysbios.

    I did have a concern as i had 2 sysbios versions under c:\ti so i deleted the older one recently

    I also saw some warnings in a ccs5 window about rtsc nor having a proper config

    I started from the supplied example wizard and choose 28335

    *** System properties:
    DEFAULT_CCS_TARGET_CONFIGURATION=C:\New_SysBios_CCSV5_Workspace\New_SyBios_CCSV5\NewTargetConfiguration.ccxml
    XDCPATH=C:/ti/bios_6_33_05_46/packages;C:/ti/ccsv5/ccs_base;C:/New_SysBios_CCSV5_Workspace/New_SyBios_CCSV5/.config/;C:\ti\xdctools_3_23_03_53\packages
    awt.toolkit=sun.awt.windows.WToolkit
    ccs.debugServerDir=C:/ti/ccsv5/ccs_base/DebugServer
    ccs.inCleanMode=false
    ccs.inDevelopmentMode=false
    ccs.inTestMode=false
    config.rootDir=C:/ti/xdctools_3_23_03_53
    dvt.binDir=C:\ti\ccsv5\ccs_base\DebugServer\..\dvt\bin
    dvt.dir=C:\ti\ccsv5\ccs_base\DebugServer\..\dvt
    eclipse.application=org.eclipse.ui.ide.workbench
    eclipse.buildId=M20120208-0800
    eclipse.commands=-os
    win32

  • under view->available product it says

    This view is empty as there are no RTSC configuration files open

  • Mark,

    By default, Hwi stack checking is enabled. The stack check is done within an internally installed Idle function.

    Hwi stack checking is disabled if either of these hal Hwi module config parameters are set to false:

      Hwi.initStackFlag

      Hwi.checkStackFlag

    The CDOC associated with these parameters can be found within the ti.sysbios.hal.Hwi module CDOC pages:

        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/index.html

    The xdc_target__isaCompatible_28 macro IS defined within the xdc/std.h file stream.

    I'm not sure how to enable the CCS editor view to properly show that xdc_target__isaCompatible_28 is defined.

    Alan

  • well the debugger clearly shows the macro is not defined so the check never occurs

    Could there be an issue because in the .cfg or the code i used to create the hwi? I have included these

    var Defaults = xdc.useModule('xdc.runtime.Defaults');
    var Diags = xdc.useModule('xdc.runtime.Diags');
    //var Log = xdc.useModule('xdc.runtime.Log');
    //var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
    var Main = xdc.useModule('xdc.runtime.Main')


    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    var Hwi = xdc.useModule('ti.sysbios.family.c28.Hwi');
    var Task = xdc.useModule("ti.sysbios.knl.Task");
    var Sem = xdc.useModule('ti.sysbios.knl.Semaphore');
    var Event = xdc.useModule('ti.sysbios.knl.Event');
    var Idle = xdc.useModule('ti.sysbios.knl.Idle');
    //Idle.addFunc('&flash_Test');  


    /*
     * Create a LoggerBuf and make it the default logger for all modules.

    var LoggerBufParams = new LoggerBuf.Params();
    LoggerBufParams.numEntries = 16;
    var logger0 = LoggerBuf.create(LoggerBufParams);
    Defaults.common$.logger = logger0;

    Main.common$.diags_INFO = Diags.ALWAYS_ON;
     */
    Program.stack = 0x100;

    BIOS.libType = BIOS.LibType_Custom;

    // Remove below 2 lines after debugging
    BIOS.customCCOpts = BIOS.customCCOpts.replace("-o3", "-o0");
    BIOS.customCCOpts += " -Dxdc_FILE=__FILE__ ";
    print(BIOS.customCCOpts);
    BIOS.logsEnabled = false;
    BIOS.assertsEnabled = true;

    NOTE I RECENTLY commented out the creation of the actual HWI's as I am revamping my system 

    int CreateBiosObjects(void)
    {
        Hwi_Params hwiParams;
        Hwi_Handle myHwi;
        Error_Block eb;

        Clock_Params clockParams;
        Clock_Handle myClk1;



        Error_init(&eb);

        Hwi_Params_init(&hwiParams);
        Clock_Params_init(&clockParams);

        /* HWI for PIE Vec 101   */
        hwiParams.enableAck = 1;
        hwiParams.disableMask = 0x0;
        hwiParams.restoreMask = 0x0;
        hwiParams.enableInt = 0;
    #if 0
        myHwi = Hwi_create(101,CAN_LowPriorityISR,0,&eb);
        if(myHwi == NULL)
        {
            while(1);
        }
        Hwi_enableInterrupt(101);

        myHwi = Hwi_create(83,DmaMcbspBReadIsr,0,&eb);
        if(myHwi == NULL)
        {
            while(1);
        }
        Hwi_enableInterrupt(83);

        myHwi = Hwi_create(82,DmaMcbspBWriteIsr,0,&eb);
        if(myHwi == NULL)
        {
            while(1);
        }
        Hwi_enableInterrupt(82);
    #endif

  • The code is grey in CCS clearly showing its not defined

  • I agree that its "clearly showing its not defined".

    However, if you examine the dissassembly window, I think you'll see the code is actually present.

    Alan

  • Alan yes we can close this the code in the disassembly does not match the greyed out code in the c source window as it does in other debugger

    (-: