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.

XDC runtime error: ti.sysbios.hal.Timer.Params#1: no property named 'MAX_PERIOD'

Other Parts Discussed in Thread: SYSBIOS

 

Hello

following the examples from spruex3g, I tried to create a timer:

/*
 * See documentation in spruex3g, 6.3 Timer Module and
 * file:///opt/ti/CCSv5/bios_6_31_04_27/docs/cdoc/ti/sysbios/hal/Timer.html
 */
var HalTimer = xdc.useModule( 'ti.sysbios.hal.Timer' );
var SignalTransferTimerParams = new Timer.Params();

SignalTransferTimerParams.periodType = Timer.PeriodType_MICROSECS;
SignalTransferTimerParams.period = 1953;

/* Continue the timer and start it automatically with BIOS_start() */
SignalTransferTimerParams.runMode = Timer.RunMode_CONTINUOUS;
SignalTransferTimerParams.startMode = Timer.StartMode_AUTO;

/* Finally, create the timer */
HalTimer.create( Timer.ANY, "&tmrTriggerSignalTransfer", SignalTransferTimerParams );

Compilation fails:

making package.mak (because of package.bld) ...
generating interfaces for package DSP.pt.msgq (because package/package.xdc.inc is older than package.xdc) ...
configuring platforms_ti816x_dsp/debug/App.xe674 from package/cfg/platforms_ti816x_dsp/debug/App_xe674.cfg ...

js: "./App_ti81xx_dsp.cfg", line 129: XDC runtime error: ti.sysbios.hal.Timer.Params#1: no property named 'MAX_PERIOD'
    "./package/cfg/platforms_ti816x_dsp/debug/App_xe674.cfg", line 764
    "./package/cfg/platforms_ti816x_dsp/debug/App_xe674.cfg", line 819
    "./package/cfg/platforms_ti816x_dsp/debug/App_xe674.cfg", line 751

None of the lines relates to something called "MAX_PERIOD".

 

I get this error only if I use XDCscript configuration. In C runtime code, I don't get any compile errors (haven't tested if it really works properly, yet).

Any ideas?

cu

Markus

  • Markus,
    is App_ti81xx_dsp.cfg the name of your config script or your config script is including that file? What's on the line 129? While it does not refer to MAX_PERIOD, it could give some hints to what went wrong.

  • App_ti81xx_dsp.cfg is the name of my config script. Line 129 is this one (the last of the lines I posted above):

    HalTimer.create( Timer.ANY, '&tmrTriggerSignalTransfer', SignalTransferTimerParams );

     

    Thanks,

    Markus

  • I can't really tell what is 'Timer' in the code you posted, but I am guessing somewhere in your code you have:
    var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');

    That other timer module is ISA-specific and has different config parameters. If you create a param structure appropriate for dmtimer.Timer and then pass that structure when creating an instance of hal.Timer, the configuration fails when an unknown parameter is detected. If you need to use dmtimer then create its instance and use its Params structure. Otherwise, use hal.Timer for creating the Params structure.

  • Hello,

    you were right, I mixed up two timers. After I corrected this, the program compiles fine. The config (related to timers) looks like this:

    /* Set the BIOS timer frequency  to 32KHz so as to match with the default timer
     * frequency on Linux
     * This comes from the syslink examples:
     * syslink_02_00_00_68_beta1/ti/syslink/samples/rtos/messageQ/ti81xx/MessageQ_ti81xx_dsp.cfg
     * Unfortunately, I don't know why we need it and what it does.
     */
    var DmTimer        = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
    DmTimer.intFreq.hi = 0;
    DmTimer.intFreq.lo = 32768;

    /* ... */

    /*
     * Configure a timer that starts data transfer from FPGA to DSP
     * See documentation in spruex3g, 6.3 Timer Module and
     * file:///opt/ti/CCSv5/bios_6_31_04_27/docs/cdoc/ti/sysbios/hal/Timer.html
     */
    var HalTimer = xdc.useModule( 'ti.sysbios.hal.Timer' );
    var SignalTransferTimerParams = new HalTimer.Params();

    /* Have a look at the fifo every 256 samples / 131072 samples/second seconds
     * The fifo should be half-filled after this period */
    SignalTransferTimerParams.periodType = HalTimer.PeriodType_MICROSECS;
    SignalTransferTimerParams.period = 500000;  /*1953;*/

    /* Continue the timer and start it automatically with BIOS_start() */
    SignalTransferTimerParams.runMode = HalTimer.RunMode_CONTINUOUS;
    SignalTransferTimerParams.startMode = HalTimer.StartMode_AUTO;

    /* Finally, create the timer */
    HalTimer.create( HalTimer.ANY, '&tmrTriggerSignalTransfer', SignalTransferTimerParams );

     

    Unfortunately, the program fails during initialisation. When I attach the CCS debugger, I can see that the program loops forever in

    initDevice(struct ti_sysbios_timers_dmtimer_Timer_Object *, struct xdc_runtime_Error_Block *)() at Timer.c:145 0x8B0226F0    
    which should be declared here, according to the ccs debugger:

    ti/sysbios/timers/dmtimer/Timer.c

    /*
     *  ======== initDevice ========
     */
    static Void initDevice(Timer_Object *obj, Error_Block *eb)
    {
        TimerRegs *timer;
        UInt hwiKey;

        Timer_TimerSupportProxy_enable(obj->id, eb);

        timer = (TimerRegs *)Timer_module->device[obj->id].baseAddr;

        hwiKey = Hwi_disable();

        timer->tclr = 0;
        while (timer->twps & TIMER_TWPS_W_PEND_TCLR)  // line 145
            ;
        timer->tcrr = 0;
        while (timer->twps & TIMER_TWPS_W_PEND_TCRR)
            ;
        timer->tldr = 0;
        while (timer->twps & TIMER_TWPS_W_PEND_TLDR)
            ;

        if (obj->hwi) {
            /* clear any previously latched timer interrupts */
            Hwi_clearInterrupt(obj->intNum);
            Hwi_disableInterrupt(obj->intNum);
        }

        Hwi_restore(hwiKey);
    }

    Now I'm stuck again. I tried commenting out the DmTimer lines, but nothing changed...

     

    I hope you can help agin,

    Markus

  • Hello,

    to make things worse: The program is looping at the same location if I configure the timer at runtime, like this:

        Timer_Params SignalTransferTimerParams;
        Timer_Params_init( &SignalTransferTimerParams );

        SignalTransferTimerParams.periodType = Timer_PeriodType_MICROSECS;
        SignalTransferTimerParams.period = 500000;
        SignalTransferTimerParams.runMode = Timer_RunMode_CONTINUOUS;
        SignalTransferTimerParams.startMode = Timer_StartMode_AUTO;

        Timer_create( Timer_ANY, tmrTriggerSignalTransfer, &SignalTransferTimerParams, NULL );

    The bold line never returns, exacly like in my previous post...

  • Markus,

    When its in that while loop, did you make sure *timer is pointing to the write address?

    I'm not familiar with this particular device, but it sounds to me like either the timer is not enabled or its not getting clocked.

    In the part of the code that you posted, its simply writing the timer control register and checking the status of that write.

    Another suggestion would be  to see if you can do this from CCS memory window.

    Judah

  • Hello Judah,

    sorry, but I have not enough experience with SYSBIOS to handle your answer.

    -Which write address of *timer do you mean? How can I find it out?

    -I followed the instructions in spruex3g for creating a timer (both static and at runtime). Are any additional steps necessary to enable or clock the timer? Again, how do I find out if the timer is getting clocked?

    -I have access to the timer structure from CCS memory window. What do you mean by "do this" there?

     

    Many thanks for your help,

    Markus

  • Markus,

    From previous experience, it looks to me like you haven't enabled clocks to the Timer.  These clocks are enabled via PRCM module.  Typically clocks are enabled either by Linux if you are running Linux on the Host or by gel files if using CCS to connect.  Are you running Linux on the Host?

    The default gel files may not have the right code to enable these clocks.  Which device are you actually running on?  I may be able to get you the updated gel files with code to enable clocks.

    As far as my previous post,  Those were suggestions for you to determine which timer you were using and whether they are enabled.  Since you saw that you were in the initDevice function below with CCS.  You could try to determine which Timer you are using by looking at the *timer in the function.  You may also be able to use a tool in CCS called ROV.  This would tell you which Timer you are using.  As far as knowing whether the timer is getting clock, you would need to either look at the PRCM registers or look at the Timer registers from a memory window and see if you can modify them.

    /*
     *  ======== initDevice ========
     */
    static Void initDevice(Timer_Object *obj, Error_Block *eb)
    {
        TimerRegs *timer;
        UInt hwiKey;

        Timer_TimerSupportProxy_enable(obj->id, eb);

        timer = (TimerRegs *)Timer_module->device[obj->id].baseAddr;

        hwiKey = Hwi_disable();

        timer->tclr = 0;
        while (timer->twps & TIMER_TWPS_W_PEND_TCLR)  // line 145
            ;

    Judah