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.

CCS/AM5728: DSP Timer project link errors

Part Number: AM5728
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

   I try to add a timer to my CCS PROJETCT FOR dsp1 on AM5728.   the BIOS version is bios_6_46_05_55

here is the code I add to the main.c

---------------------------------------------------------------------

#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Clock.h>
#include <ti/sysbios/hal/Timer.h>
#include <ti/sysbios/knl/Swi.h>
#include <ti/sysbios/knl/Semaphore.h>

.......

//create timer
Timer_Params_init(&timer1params);
timer1params.period = 1000; //unit:us
timer1params.runMode = Timer_RunMode_CONTINUOUS;
timer1params.startMode = Timer_StartMode_USER;
timer1 = Timer_create(Timer_ANY, Timer_Cycle_Function, &timer1params, &eb);

..............

---------------------------------------------------------------------------------------------------------------------------

when linking , ccs report :

undefined first referenced
symbol in file
--------- ----------------
ti_sysbios_hal_Timer_Params__init__S ./src/main.obj
ti_sysbios_hal_Timer_create ./src/main.obj

Did I miss some headers? 

  • The RTOS team have been notified. They will respond here.
  • Hi,

    Try to add: #include <ti/sysbios/timers/dmtimer/Timer.h> if it helps.

    We have similar timer example as part of the USB driver test application. Check pdk_am57xx_1_0_xx\packages\ti\drv\usb\example\bios\biosTimer.c

    Regards, Eric
  • I had change my code and pass the link process, but fail in runing the timer function.

    --------------------------------------------------------------------------------------------------------

    //create timer
    Timer_Params_init(&timer1params);
    timer1params.period = 1000; //unit:us
    timer1params.periodType = Timer_PeriodType_MICROSECS;
    timer1params.arg = 1;
    timer1params.runMode = Timer_RunMode_CONTINUOUS;
    timer1params.startMode = Timer_StartMode_USER;
    //timer1 = Timer_create(Timer_ANY, Timer_Cycle_Function, &timer1params, &eb);
    timer1 = Timer_create(9, Timer_Cycle_Function, &timer1params, &eb);
    if (Error_check(&eb))
    {
    Log_error0("main: failed to create timer startup thread");
    }

    -------------------------------------------------------------------------------------------------------------------------------

    while using Timer_ANY, it can pass the error check, but case the linux kernel to report errors, and the Timer_Cycle_Function is not called.

    while use and ID ( I test 1,7,9,12),  it run into error check.I trace into the create function, the Timer_module->availMask check allways return false

  • I dig into the timer_create function, and find out oly gp timer 5 is mask available.
  • If you find only timer5 is available but you want to use another timer, you can use TimerSupport.availMask in SYSBIOS, see:
    e2e.ti.com/.../720202

    Regards, Eric
  • Thansks for you answer. But I am not care of what timer it use. I just can get any timer work.

    The timer Id is 5, so the real timer Timer_create function init is gp timer 6. 

    It seem that the memory of timer is not map correctly in mmu. Any access to 0x48822000 case errors and all is 0 when I use memory bowser to wath the timer reg value.

    But I do see a line in the pagetable output, showing 0x48800000 map to the same address. 

    It was the default setting in rsc table from the example project without any change.

    whould it be the timer module clock is not enabled?

  • Hi,

    You may need to run the GEL file to enable the timer clock. See ccs_8_0_0\ccsv8\ccs_base\emulation\boards\am572x\gel\AM572x_prcm_config.gel.

    Attached is a A15 timer CCS project. The timer is configured inside .cfg file, you may change that and add the same code into your C file. The .cfg also has setup of MMU.

    When MMU is enabled, you can't see the correct memory contents from CCS memory window on A15, but you can check that on C66x using the timer address.

    Regards, Eric

    Timer_A15.zip

  • Thanks for you help! I'll try it later. 

    I want to know where  to find infomation about HWI connection in that show in the cfg file, since I will need to set up HWI too.

  • Hi,

    For HWI, please check: software-dl.ti.com/.../Hwi.html

    Also, there are on-line training: processors.wiki.ti.com/.../BIOS_Online_Training

    Regards, Eric
  • I fix the problem by enable the clock in TIMER6_CLKCTRL. 

    I just can't understand why the dmtimer.h functons did not enable the clock for user, when creating the timer.

  • Hi,

    No, the timer clock is enabled externally, not by SYSBIOS. Glad you find this! In standalone test applications we used GEL to do the SOC level initialization and it enables the clock.

    Regards, Eric