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.

RTOS: SYSBIOS

Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hi,

When I moved to new SYSBIOS 6.50.01.12 (device : C2000 F28335), I found one difference and would like to have your feedback.

In our project we have some common  "code" for several applications.

The .cfg is one of the common stuff.

Depending on the application, the CPU clock may be 30Mhz, 60 Mhz, 120 Mhz, 150 Mhz.

But we do not want to indicate it in the cfg as we have an unique cfg for different application.

So between the : " void main(void)"  and the  BIOS_start();

I wanted to configure all what is based on the CPU clock.

So to set the period of the clock module I was doing:

// Get the period of the Clock manager in number of CPU ticks

timer_handle = Clock_getTimerHandle();

period_ticks_clock_manager = Timer_getPeriod(timer_handle);

 

// Calculate the number of ticks to

period_ticks_ID = (Float32_t) period_ms;

period_ticks_ID = period_ticks_ID * ((Float32_t) (freq.lo/1000u));

period_ticks_ID = period_ticks_ID / ((Float32_t) (period_ticks_clock_manager));

period_ticks_ID++; // add one tick by convention (to wait N cycles we need to set N+1)

Clock_setPeriod(handle_periodic_function, (UInt32_t) period_ticks_ID);

Clock_start(handle_periodic_function);

But now when I call "timer_handle = Clock_getTimerHandle();"  it looks like the structure is not initialized by SYSBIOS because the handle does not

point on a correct structure.

could you indicate if it is normal if I am doing something not correctly ?

Thanks for your support,

Mathieu

RTOS: C2000 and SYSBIOS 6.50.01.12

  • Complement of information:
    When I am calling : timer_handle = Clock_getTimerHandle();
    I arrive in the SYSBIOS function:

    * ======== Timer_getPeriod ========
    */
    UInt32 Timer_getPeriod(Timer_Object *obj)
    {
    return (TimerDevices[obj->id].PRD);
    }

    ti_sysbios_knl_Clock_Module__state__V : 0x8996
    -> the value of obj->id is in my case: - -8080 instead of 0 as expected..
  • I've assigned this thread to an engineer, but with the US holiday the response is going to be a little slow.

    Todd
  • Mathieu,

    Some questions/comments:

    1) It looks like you are trying to set the Clock module period dynamically when your application is running.  Is this correct?  The Clock *module* tick period is a fixed constant established when the application is built.  It cannot be changed at runtime.  You can access this period in your application C code by:

    #include <ti/sysbios/knl/Clock.h>

    tickPeriod = Clock_tickPeriod;

    The units of “Clock_tickPeriod” is *microseconds*.

    2)  If you want to get the Clock tick period in units of *counts* of the underlying Timer object (that the Clock module is using) you can use:  Clock_getTickPeriod()

    3) The code snippet shows calls to Clock_setPeriod() and Clock_start().  These APIs are for an individual Clock object, not the Clock module itself.  Is this what you are intending?

    4) If you want to know the CPU clock rate at runtime (for “Depending on the application, the CPU clock may be 30Mhz, 60 Mhz, 120 Mhz, 150 Mhz.”), have you tried using the  BIOS_getCpuFreq() API?

    5) You moved to SYSBIOS 6.50.01.12.  Which previous version were you using where you saw different results?

    6) Can you please describe more “But we do not want to indicate it in the cfg as we have an unique cfg for different application.”?   Are you using one common .cfg for multiple applications, and then each individual application has an additional .cfg file?

    7) You indicate “When I am calling : timer_handle = Clock_getTimerHandle();  I arrive in the SYSBIOS function:  Timer_getPeriod()”.  Clock_getTimerHandle() will not call any functions, can you explain this comment?

    Thanks,
    Scott

  • Hi Scott,

    Thanks a lot for your answer.

    As you recommend I removed all the init of sysbios and it works fine.

    Thanks a lot

    Mathieu