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.

TImer in Sys/bios

Other Parts Discussed in Thread: TMS320C6670, SYSBIOS

Hi TI,

I am using TMS320C6670 processor.

I am using the GP_timer in SYS/BIOS i am getting  the below errors.

Can anyone help me out to solve this problem.

Description    Resource    Path    Location    Type
 error #20: identifier "package" is undefined    .xdchelp    /typical_GenericC66xxDevice    17    C/C++ Problem
 error #7: unrecognized token    .xdchelp    /typical_GenericC66xxDevice    128    C/C++ Problem
 error #78-D: this declaration has no storage class or type specifier    .xdchelp    /typical_GenericC66xxDevice    435    C/C++ Problem
 error #171: expected a declaration    .xdchelp    /typical_GenericC66xxDevice    475    C/C++ Problem
 error #760: variable "metaonly" is not a type name    .xdchelp    /typical_GenericC66xxDevice    128    C/C++ Problem
 error #20: identifier "interface" is undefined    .xdchelp    /typical_GenericC66xxDevice    48    C/C++ Problem
 error #760: variable "config" is not a type name    .xdchelp    /typical_GenericC66xxDevice    191    C/C++ Problem
 error #7: unrecognized token    .xdchelp    /typical_GenericC66xxDevice    129    C/C++ Problem
 error #20: identifier "LogEvent" is undefined    .xdchelp    /typical_GenericC66xxDevice    493    C/C++ Problem
 error #20: identifier "TimerProxy" is undefined    .xdchelp    /typical_GenericC66xxDevice    166    C/C++ Problem
 error #78-D: this declaration has no storage class or type specifier    .xdchelp    /typical_GenericC66xxDevice    160    C/C++ Problem

Thanks in advance

Regards,

Saravanan K

  • Hi Saravanan,

    Could you explain how did you see the errors?  What exact steps did you take?

    In addition, CCS version and SYS/BIOS version numbers may be helpful.

    Best Regards,
    Atsushi

  • Hi Atsushi,

    I want to use timer for periodic tick generation.

    I am using ccs version 5.3 and SYS/BIOS version 6.3.

    Can you elaborate the steps to be followed in configuring the timer.

    Regards,

    Saravanan

  • Hi Saravanan,

    In the CCS 5.3,

    1. File -> New -> CCS Project
    2. Give some project name in "Project name".
    3. Choose C6000 as Device Family and Generic C66xx Device in Device Variant.
    4. In the Project templates and example, choose SYS/BIOS -> Clock Example.
    5. Click "Next".
    6. In the Products and Repositories, please confirm a SYS/BIOS is checked.
    7. In the Platform, please choose "ti.platforms.evm6670".
    8. Click "Finish".
    9. Project -> Build Project.

    Could you check if it does work?

    You will find Bios_User_Guide.pdf in the installed C:\ti\bios_6_xx_yy_zz\docs.  In the document, there is the section 5.2 Clock.  (Section number may vary.)  You will see explanation how to call a function periodically by this module.

    The table Table 5.1. Timeline for One-shot and Continuous Clocks may also help.

    If you have any questions, please don't hesitate to ask us.

    Best Regards,
    Atsushi

  • Hi Atsushi,

         Thanks for your reply.

           The above example worked fine for me in simulation mode.

         I need to generate hardware interrupt. According to my understanding from bios user guide doc, timer module will generate Hwi instance for timer interrupt whereas

    Clock will generate swi.

    Could you please tell whether my understanding is correct and if so how to use shared timer.

    Regards,

    Janeeth

         

  • Janeeth,

    Yes, you're correct.  The periodic functions are executed in SWI context instead of HWI.

    What is the reason why you actually need HWI instead of SWI?  Do you need to minimize latency and/or jitter to call the function?  I think such requirement often conflicts with timer sharing.

    C6670 has eight 64-bit hardware timers.  (Please refer 7.21.1 Timers Device-Specific Information of data manual (http://www.ti.com/lit/ds/symlink/tms320c6670.pdf).)  If 32-bit timer width is enough, we can have up to 16 timers per device.  Four of the eight 64-bit timers are locally assigned to four DSP cores.  In other word, any core has its own dedicated 64-bit hardware timer and also can access other four 64-bit timers but need to share them among 4 cores.  BIOS uses the local timer, but users are free to use remaining four 64-bit timers.

    Unfortunately, I did not find BIOS support for direct access to the hardware timers.  Instead, MCSDK (http://software-dl.ti.com/sdoemb/sdoemb_public_sw/bios_mcsdk/latest/index_FDS.html) provides CSL (Chip Support Library) to access the hardware timers.  However, the timer is simple hardware, so it is not difficult to access it by registers.  You can refer User Guide (http://www.ti.com/lit/ug/sprugv5a/sprugv5a.pdf).

    To tie a hardware timer to an interrupt, we need to operate interrupt controller.  BIOS provides module 'ti.sysbios.hal.Hwi' for the purpose.  When operating interrupt controller, we need to know event id of the hardware timer.  Table 7-38 System Event Mapping in the data manual says event number 66 through 73 are assigned for the hardware timers.

    If you indeed need to share one hardware timer and call different functions in HWI context at different period, you need to call the functions from the HWI interrupt service routine.  I think it requires application specific design.

    If you have additional questions, please don't hesitate to ask us.

    Best Regards,
    Atsushi

  • Hi Atsushi,

      Thanks for your detailed explanation.

      I need HWIfor preempting the SWI.

     I'll get back to you if i  have further queries.

    Thanks.

    Regards,

    Janeeth

  • Janeeth,

    I'm afraid that I may not understand your application correctly, but one possible hint is, we can assign a priority to any SWI and also periodic functions defined by Clock module.  If you assign the highest priority to the periodic functions.  It prevents the functions be preempted by other SWIs.

    Regards,
    Atsushi