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.

TMS320C6748: timer work abnormally in 64bit mode

Part Number: TMS320C6748
Other Parts Discussed in Thread: OMAPL138

Based on L138 Starterware example: C:\ti\OMAPL138_StarterWare_1_10_04_01\build\c674x\cgt_ccs\omapl138\lcdkOMAPL138\timer

/******************************************************************************

** INTERNAL MACRO DEFINITIONS
*******************************************************************************/
#define STR_LEN (13)
//#define TMR_PERIOD_LSB32 (0x17FFFFFF)
#define TMR_PERIOD_LSB32 (0x07FFFFFF)
#define TMR_PERIOD_MSB32 (0x1)
//#define TMR_PERIOD_MSB32 (0x0)

the example set timer work in interrupt mode to output count to console every 1 second. 

But set TMR_PERIOD_MSB32 =1 or any value other than 0, the output 9 to 8 very quickly, it should be just 1 second, then 7, 6, 5 with normally interval, but output 4 only 1 second after 5., then 3, 2. 1, and 0 only 1 second after 1. like below: 

9.8...........7...........6...........5,4...........3.............2.............1,0.

Seems sometimes the TMR_PERIOD_MSB32 doesn't work.

Please help verify.

  • Hi Tony,

    The team is notified. They will post their feedback directly here.

    BR
    Tsvetolin Shulev
  • Hi Tony,

    Starterware is no longer supported. Recommendation is to migrate to the latest Processor SDK RTOS:
    www.ti.com/.../PROCESSOR-SDK-C6748
  • Sahin,
    If no support, why starterware still exist under PDK? there are many customer refer Starterware.
    did you verify this feature? it is not related to which specific SDK or Starterware.
    my question is the timer 64bit mode works abnormal.
  • Starterware is still supported/part of Processor SDK for AM335x/AM437x devices, but for OMAP-L13x/C674x it is no longer supported. We provide this guidance on the Starterware download page, and we urge customers to start new development using the Processor SDK baseline.

    I recommend testing the timer example provided in Processor SDK to see if you are still running into the same issue. It can be found under C:\ti\\pdk_omapl138_1_0_5\packages\ti\csl\example\timer. I hope this is an option for you. 

    Otherwise, please see if these E2E threads can help resolve your issue:

    https://e2e.ti.com/support/processors/f/791/t/558354

    https://e2e.ti.com/support/processors/f/791/p/339219/1184825

  • Seems both posts you provided are discussing based on starterware code.

    how to build the example under C:\ti\\pdk_omapl138_1_0_5\packages\ti\csl\example\timer? I did not find entrance in C:\ti\\pdk_omapl138_1_0_5\packages\makefile to build the example.

    actually my question is not related to code itself.

  • Tony,

    I'm sorry for the delay. The CSL examples are makefile-based and the binaries can be built using the top-level PDK makefile.

    (It appears the instructions here are out of date: software-dl.ti.com/.../Device_Drivers.html

    So please do the following:
    > cd pdk/packages
    > set SDK_INSTALL_PATH=C:\ti
    > pdksetupenv.bat
    > gmake csl

    The binaries can then be found at pdk\packages\ti\binary\ti\csl\obj\omapl138\c674\release\

    EDIT: The above CSL examples apply only to AM57xx devices. For C6748, we have a 64-bit timer example in the TI-RTOS workshop:

    https://training.ti.com/ti-rtos-workshop-series-1-10-welcome

    The source code can be downloaded from here: https://training.ti.com/sites/default/files/docs/TI_RTOS_labs_sols_rev4.00.zip


    I hope this helps.

  • Sahin,

    #1. So the CSL timer example doesn't work  for c6748? right? and I building with your command, no example binary generated.

    #2. the example you provided is based on Logic PD evm, and it is also not a public processor SDK example, will it support by BU?

    #3. the example you provided is not very clear about using the timer.  the I2C_init() and LED_init is evmomapl138_bsl library function, Since Starterware is not supported anymore, I think logicPD BSL is not supported also. 


    //---------------------------------------------------------------------------
    // main()
    //---------------------------------------------------------------------------
    void main(void)
    {

    hardware_init(); // init hardware via Xware

    BIOS_start();

    }


    //-----------------------------------------------------------------------------
    // hardware_init()
    //-----------------------------------------------------------------------------
    void hardware_init(void) //called by main
    {
    I2C_init(I2C0, I2C_CLK_400K); // init I2C channel - BSL
    LED_init(); // init LED BSL

    }

    in the app.cfg, timer configure as below, I can't get detail configuration about the timer with below script.

    BIOS.libType = BIOS.LibType_Custom;
    BIOS.logsEnabled = true;
    BIOS.assertsEnabled = true;
    var timer0Params = new Timer.Params();
    timer0Params.instance.name = "Timer_2";
    timer0Params.period = 500000;
    Program.global.Timer_2 = Timer.create(2, "&ledToggle", timer0Params);

    //-----------------------------------------------------------------------------
    // ledToggle() ISR (called by BIOS Hwi, see app.cfg)
    //-----------------------------------------------------------------------------
    void ledToggle(void) //called by main
    {
    LED_toggle(LED_1); //toggle LED_1 on C6748 EVM

    i16ToggleCount += 1; // keep track of #toggles

    Log_info1("LED TOGGLED [%u] times", i16ToggleCount);

    }

    #4. Actually, the starterware timer example is very simple, at least it is more simple than the lab example, my question is also simple, when set TMR_PERIOD_MSB32 other than 0, the interrupt period is abnormal.

    int main(void)
    {
    /* Set up the UART2 peripheral */
    UARTStdioInit();

    /* Set up the Timer2 peripheral */
    TimerSetUp64Bit();

    /* Set up the AINTC to generate Timer2 interrupts */
    TimerIntrSetUp();

    /* Enable the timer interrupt */
    TimerIntEnable(SOC_TMR_2_REGS, TMR_INT_TMR12_NON_CAPT_MODE);

    .........

    }

    #define TMR_PERIOD_LSB32 (0x07FFFFFF)  //1 second
    #define TMR_PERIOD_MSB32 (0x1)    // No problem with 0, if with non-zero, the period is abnormal.


    /*
    ** Setup the timer for 64 bit mode
    */
    static void TimerSetUp64Bit(void)
    {
    /* Configuration of Timer */
    TimerConfigure(SOC_TMR_2_REGS, TMR_CFG_64BIT_CLK_INT);

    /* Set the 64 bit timer period */
    TimerPeriodSet(SOC_TMR_2_REGS, TMR_TIMER12, TMR_PERIOD_LSB32);
    TimerPeriodSet(SOC_TMR_2_REGS, TMR_TIMER34, TMR_PERIOD_MSB32);
    }

  • Hi Tony,

    Yes, that's correct, the CSL examples are only available on AM57xx devices. The code in the workshop is still supported as well as it is based on TI-RTOS. It will also run on the LCDK board, please refer to page 5-22 of the workshop's lab manual: training.ti.com/.../TI_RTOS_Kernel_Workshop_Lab_Manual_rev4.00.pdf