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.

TSK_create CCS4 does not work consistently

 

TSK_Create does not work consistently.. Sometines the task is executed and sometimes it does not.

My sample code is here

 

 

 

 

 

 

TSK_Handle demo_tsk;

 

 

 

// system initialization (doesn't rely on GEL)

 

 

 

// unlock device

LOCAL_kick_unlock();

 

 

 

// turn on uPP LPSC

LOCAL_PSC1_LPSC_enable(0, 19);

 

 

 

// enable uPP pinmux - enable all uPP pin functions

LOCAL_apply_upp_pinmux();

 

 

 

// enable HWI7 (tied to ECM block 2; see TCF)

 

 

C64_enableIER

(1 << 7);

 

 

 

// create task

demo_tsk = TSK_create(LOCAL_upp_demo,

 

NULL

, 0);

 

 

 

if (demo_tsk == NULL

)

LOG_printf(&trace,

 

"TSK_create() failed.\n"

);

  • You haven't provided enough information for any conclusion to be reached.

    Veena KK said:
    TSK_Create does not work consistently.. Sometines the task is executed and sometimes it does not.

    Is the TSK_create() failing?

    Is TSK_create() succeeding but the TSK never executes?

    Where's the rest of your code?  Where's the .tcf file contents?

    Is the code above from main()?

    These questions are just some of the information you need to provide.  You can attach source code with the little paper clip in the compose window.

    Regards,

    - Rob

     

     

  • Hi Rob,

    I'm using DSPBIOS 5.41.09.34 for C6748 Device.

    TSK_create()  creates task initially.. but when I try to execute the same code again and again it fails to create task.

    void main()
    {
      TSK_Handle demo_tsk;
       

        // create task
        demo_tsk = TSK_create(LOCAL_upp_demo, NULL, 0);

        if (demo_tsk == NULL)
            LOG_printf(&trace, "TSK_create() failed.\n");
    }


    // LOCAL_upp_demo is the primary DSP/BIOS TSK function.  It is called
    // after main

    static int LOCAL_upp_demo()
    {
       
            LOG_printf (&trace, "Test Task Creation");
       
        return 0;
    }

    When I run this code the control goes to LOCAL_upp_demo once when I execute it repeadly the task does not get created and does not goto the task created.

    ,tcf file is here

     

    utils.loadPlatform("ti.platforms.evm6748");

     

    /* The following DSP/BIOS Features are enabled. */

    bios.enableRealTimeAnalysis(prog);

    bios.enableRtdx(prog);

    bios.enableTskManager(prog);

     

    bios.MEM.STACKSIZE = 0x1000;

    bios.MEM.ARGSSEG = prog.get("DDR");

    bios.MEM.STACKSEG = prog.get("DDR");

    bios.MEM.GBLINITSEG = prog.get("DDR");

    bios.MEM.TRCDATASEG = prog.get("DDR");

    bios.MEM.SYSDATASEG = prog.get("DDR");

    bios.MEM.OBJSEG = prog.get("DDR");

    bios.MEM.BIOSSEG = prog.get("DDR");

    bios.MEM.SYSINITSEG = prog.get("DDR");

    bios.MEM.HWISEG = prog.get("DDR");

    bios.MEM.HWIVECSEG = prog.get("DDR");

    bios.MEM.RTDXTEXTSEG = prog.get("DDR");

    bios.MEM.TEXTSEG = prog.get("DDR");

    bios.MEM.SWITCHSEG = prog.get("DDR");

    bios.MEM.BSSSEG = prog.get("DDR");

    bios.MEM.FARSEG = prog.get("DDR");

    bios.MEM.CINITSEG = prog.get("DDR");

    bios.MEM.PINITSEG = prog.get("DDR");

    bios.MEM.CONSTSEG = prog.get("DDR");

    bios.MEM.DATASEG = prog.get("DDR");

    bios.MEM.CIOSEG = prog.get("DDR");

    bios.MEM.ENABLELOADADDR = 1;

    bios.MEM.LOADBIOSSEG = prog.get("DDR");

    bios.MEM.LOADSYSINITSEG = prog.get("DDR");

    bios.MEM.LOADGBLINITSEG = prog.get("DDR");

    bios.MEM.LOADTRCDATASEG = prog.get("DDR");

    bios.MEM.LOADTEXTSEG = prog.get("DDR");

    bios.MEM.LOADSWITCHSEG = prog.get("DDR");

    bios.MEM.LOADCINITSEG = prog.get("DDR");

    bios.MEM.LOADPINITSEG = prog.get("DDR");

    bios.MEM.LOADCONSTSEG = prog.get("DDR");

    bios.MEM.LOADHWISEG = prog.get("DDR");

    bios.MEM.LOADHWIVECSEG = prog.get("DDR");

    bios.MEM.LOADRTDXTEXTSEG = prog.get("DDR");

    bios.MEM.NOMEMORYHEAPS = 0;

    bios.MEM.instance("DDR").createHeap = 1;

    bios.MEM.instance("DDR").heapSize = 0x00100000;

    bios.MEM.BIOSOBJSEG = prog.get("DDR");

    bios.MEM.MALLOCSEG = prog.get("DDR");

    bios.LOG.create("trace");

    bios.LOG.instance("trace").bufLen = 1024;

    bios.TSK.STACKSEG = prog.get("DDR");

     

    bios.UDEV.create("UPP");

    bios.UDEV.instance("UPP").fxnTableType = "IOM_Fxns";

    bios.UDEV.instance("UPP").comment = "uPP IOM mini driver";

    bios.UDEV.instance("UPP").initFxn = prog.extern("UPP_INIT");

    bios.UDEV.instance("UPP").fxnTable = prog.extern("UPP_FXN_TABLE");

    bios.UDEV.instance("UPP").params = prog.extern("UPP_DEV_CONFIG");

     

    bios.ECM.ENABLE = 1;

    bios.HWI.instance("HWI_INT7").interruptSelectNumber = 2;

     

    // !GRAPHICAL_CONFIG_TOOL_SCRIPT_INSERT_POINT!

    /* Create application task */

     

    prog.gen();

     

    regards

    Veena

  • You probably need to reset the DSP in some way in between runs, perhaps just a SW reset but might need a harder reset.

    DSP/BIOS tries its best to start up in a way that doesn't rely on any particular HW state, so a reset isn't typically required (just a CCS "Restart/Reload" will often suffice - you are doing a Reload, right?).

    If resetting between runs doesn't solve the issue, or if it does buy you're curious why a reset is required, you can run the app (and *not* do a reset if resetting solves the issue) and then step the DSP/BIOS startup code from the "_c_int00" label and see where things fall down.

    Regards,

    - Rob