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.

DSP/BIOS: Don't awake from TSK_sleep

Other Parts Discussed in Thread: CCSTUDIO, TMS320C6747, OMAPL138, OMAP-L137

  Dear E2E!

 I have created a simple DSP/BIOS project, as it is described in DSP/BIOS tutorial

"Lesson 1: Creating a Simple DSP/BIOS Application".

The project builds and loads without any errors. 

But. Afrer "Run" it hangs at BIOS API Function TSK_sleep().

. ... it don't print message "...awake! Time is ...."

 

I can't understand, why... I'm will be very appreciative for any help.

 

 I'm use a platform OMAL-L137EVM.

Work under CCS3.3 (it is shipped with EVM).

Use DSP/BIOS 5.33.

Studing the tutorial in: <DSP/BIOS Install dir>\packages\ti\bios\help\doc\

 

listing of clk.c:

//------------------

/*

 *  Copyright 2008 by Texas Instruments Incorporated.

 *  All rights reserved. Property of Texas Instruments Incorporated.

 *  Restricted rights to use, duplicate or disclose this code are

 *  granted through contract.

 *

 *  @(#) DSP/BIOS_Examples 5,3,3 09-23-2008 (biosEx-j03)

 */

/*

 *  ======== clk.c =======

 *  In this example, a task goes to sleep # number of ticks and

 *  prints the time after it wakes up.

 *

 */

 

#include <std.h>

 

#include <log.h>

#include <clk.h>

#include <tsk.h>

#include <gbl.h>

 

#include "clkcfg.h"

 

/*

 *  ======== main ========

 */

Void main()

{

    LOG_printf(&trace, "clk example started.\n");

}

 

Void taskFxn(Arg value_arg)

{

    Int value = ArgToInt (value_arg);

    LgUns freq;

    Float timeout, milliSecsPerIntr, cycles;

 

    LOG_printf(&trace, "The time in task is: %d ticks", (Int)TSK_time());

 

    /* get frequency of platform */   

    freq = GBL_getFrequency();

 

    /* get cpu cycles per ltime interrupt */

    cycles = CLK_cpuCyclesPerLtime();

   

    /* computer milliseconds per ltime interrupt */

    milliSecsPerIntr = cycles/(Float)freq;

 

    /* compute timeout */

    timeout = value/milliSecsPerIntr;

               

                /*begin while loop ... it is a task to try*/

                //while(TRUE)

                //{

        LOG_printf(&trace, "task going to sleep for %d ticks... ", (Int)timeout);

 

        //TSK_sleep((LgUns)timeout);

                               TSK_sleep((Uns)1);  // try with hand-defined delay ... program pass TS_sleep only when the argument is 0 ...

        LOG_printf(&trace, "...awake! Time is: %d ticks", (Int)TSK_time());

                               //LOG_printf(&trace, "...awake! Time is: %d ticks", (Int)TSK_time());

                //}

                /*end of while loop ... it is a task to try*/

}

//------------------

 

listing of clk.tcf:

//------------------

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

 

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

bios.enableRealTimeAnalysis(prog);

bios.enableRtdx(prog);

bios.enableTskManager(prog);

 

bios.LOG.create("trace");

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

bios.MEM.NOMEMORYHEAPS = 0;

bios.MEM.NOMEMORYHEAPS = 1;

bios.MEM.NOMEMORYHEAPS = 0;

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

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

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

bios.TSK.create("myTask");

bios.TSK.instance("myTask").order = 1;

bios.TSK.instance("myTask").fxn = prog.extern("taskFxn");

bios.TSK.instance("myTask").arg0 = 10;

bios.TSK.create("myTask2");

bios.TSK.instance("myTask2").order = 2;

bios.TSK.instance("myTask2").fxn = prog.extern("taskFxn");

bios.TSK.instance("myTask2").arg0 = 25;

bios.TSK.instance("myTask").priority = 2;

bios.TSK.instance("myTask").priority = 1;

bios.TSK.instance("myTask2").priority = 2;

bios.TSK.instance("TSK_idle").order = 1;

bios.TSK.instance("myTask").order = 2;

bios.TSK.instance("myTask2").destroy();

bios.TSK.instance("myTask").arg0 = 1;

bios.MEM.USEMPC = 0;

bios.MEM.NOMEMORYHEAPS = 0;

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

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

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

bios.MEM.NOMEMORYHEAPS = 1;

bios.MEM.NOMEMORYHEAPS = 0;

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

bios.MEM.instance("L3_CBA_RAM").heapSize = 0x00000080;

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

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

bios.MEM.instance("L3_CBA_RAM").heapSize = 0x00008000;

// !GRAPHICAL_CONFIG_TOOL_SCRIPT_INSERT_POINT!

 

prog.gen();

 

//------------------

 

 

  •  //LOG_printf(&trace, "...awake! Time is: %d ticks", (Int)TSK_time());

    is, of course, without comments:

    LOG_printf(&trace, "...awake! Time is: %d ticks", (Int)TSK_time());

     

    Sorry please for the error in listing,

    but the question is still open. Program cant pass through TSK_sleep()...

  • Hi Vitalli,

    What is the other task doing while the first task is blocked (due to TSK_sleep) ? Does the other task disable interrupts (Hwi) or tasking ?

    Best,

    Ashish

  • Hi Ashish!

    Thank You for response!

    Nothing happens if other task is deleted.

    I can't understand, why, but  it seems that I have found the solution...

    I have changed "Timer selection" of the CLK-Clock Manager. (DSP/BIOS Config -> Scheduling -> CLK-Clock Manager -> Properties ) It was "Timer 1". But I have changed it to "Timer 0".

    After this manipulation the example works as it is described in the tutorial.

    Does TSK_sleep work only when Timer 0 is used as clock source for CLK-Clock Manager?

    Thank You  very much!

    Vitalii

  • Hi Vitalli,

    You should be able to use either timers. I believe one of the timers is expected to be used by ARM9 and its emulation bit is not set correctly. This has the side affect that if the ARM9 core is halted, the timer does not tick. It could be that Timer 1's emulation mode is not set correctly.

    Is the ARM9 core halted when you run your app on the DSP ?


    Best,

    Ashish

  • Hi Ashish!

    Excuse me, but I don't know how to control the condition of the ARM9 Core...

    I use the OMAP137 EVM as EVM for TMS320C6747. So, as I understand, without ARM-Core support. CCS3.3 delivered with the EVM, after installation has two launch-shortcuts: 1) EVMC6747 CCStudio v3.3 2) EVMOMAP-L137 CCStudio v3.3. I use the first one.

    So I suppose, that the ARM9 Core is disabled and halted. Isn't it?

    Thanks for your assistance!

    Best regards, Vitalii

  • Vitalii,

    Your question seems to be more related to how to debug on the ARM core rather than anything specific to SYS/BIOS.  I have moved this thread over to the device forum in hopes that you will get a faster response there.

  • Sorry please!

    Why ARM core?

    I want to learn how can I use DSP/BIOS for DSP applications. I don't want to use the ARM Core.

    Best regards,

    Vitalii

  • Dear E2E!

    May be I have found a solution...

    I have set a checkbox "Reset Timer and TIMMODE" in the dialog box "Properties: CLK - Clock Manager ". With this option my DSP/BIOS - tutorial-program works correctly with all timers (Timer 0 or Timer 1). ... awakes form TSK_sleep(1) ...

    Why this checkbox isn't set on default?

    Thank You very much! Vitalii

  • Hi Ashish/Vitalii,

    Vitali says said:

    So I suppose, that the ARM9 Core is disabled and halted. Isn't it?

    Ashish says said:

    Is the ARM9 core halted when you run your app on the DSP ?

    As per my understanding,

    By default, The ARM core will be in halt state only because this is OMAPL137 device (DSP boot device) whereas OMAPL138 is the ARM boot device (Here, The ARM will wakeup the DSP and run the DSP apps)

    AS of now, We do not care about the ARM core side while you are working with DSP applications and when you are creating DSP/BIOS CCS projects with target type or board type as "OMAPL137"  (It will load appropriate gel files for waking up the DSP);  Provided the DSP app will not communicate with ARM in later point of time

  • Dear Ashish, Dear Titus!

    I suppose, we have found the solution:

    1) when TSK_sleep() (DSP/BIOS) hangs the process - set a checkbox "Reset Timer and TIMMODE" in the dialog box "Properties: CLK - Clock Manager ". I see the examples of the NDK ("helloWorld", "client"). They are DSP/BIOS based applications and all works properly on my platform (L137 OMAP EVM / TMS320C6767EVM). And in all this examples checkbox "Reset Timer and TIMMODE" is selected.

    2) when debugging C6747 application on the OMAP-L137 evm ( "in the mode" TMS320C6747 EVM) it is not nesessary to care about ARM9 core. The ARM core will be in halt state only because this is OMAPL137 device (DSP boot device).

    Thank You very much for help and support!

    If You don't have any remarks, I shall mark this post as "answered" tomorrow.

    Best regards

    Vitalii