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/TCI6630K2L: Task_sleep accuracy is different between DSP and ARM core.

Part Number: TCI6630K2L

Tool/software: TI-RTOS

Hello,

In CCS6.2, theTask_sleep time is different between DSP and ARM core.

Task_sleep(1000) is not 1 second delay on the ARM(gnu) target SYS/BIOS.

but it is 1 second with the DSP target.

evmK2L

BIOS version: : bios_6_46_04_53

XDC version : xdctools_3_32_00_06_core

ARM Compiler version: GNU v4.9.3(Ninaro)

the same clock configration in the .cfg

Why is Task_sleep accuracy different?

  • Hi,

    I've notified the TCI66x team. Their feedback will be posted here.

    Best Regards,
    Yordan
  • Hi,

    My first guess was the defined clock speed. I consulted with the BIOS team and that was their thought as well, i.e. that the CPU frequency specified in the configuration file doesn’t match the actual frequency of the board.

    BIOS.cpuFreq.lo = x;
    BIOS.cpuFreq.hi = y;

    Note that this setting doesn’t actually change the CPU frequency. That is set via PLL and crystal on a given board. This setting must match the board setup.

    /*!
    * ======== cpuFreq ========
    * CPU frequency in Hz
    *
    * This configuration parameter allow SYS/BIOS to convert various
    * periods between timer ticks (or instruction cycles) and real-time
    * units. For example, timer periods expressed in micro-seconds need
    * to be converted into timer ticks in order to properly program the
    * timers.
    *
    * The default value of this parameter is obtained from the platform
    * (the clockRate property of {@link xdc.cfg.Program#cpu Program.cpu})
    * which is the CPU clock rate when the processor is reset.
    *
    * @a(Example)
    * If CPU frequency is 720MHz, the following configuration script
    * configures SYS/BIOS with the proper clock frequency:
    * @p(code)
    * var BIOS = xdc.useModule('ti.sysbios.BIOS');
    * BIOS.cpuFreq.hi = 0;
    * BIOS.cpuFreq.lo = 720000000;
    * @p
    */
    config Types.FreqHz cpuFreq;
  • Hello db_woodall,

    I added CPU frequency to the configuration file as your opinion.

    BIOS.cpuFreq.hi = 0;
    BIOS.cpuFreq.lo = 983039978;

    This frequency is the ARM PLL on the EVM board that initializes in the K2L gel file.

    However, the accuracy of Task_sleep does not change and is faster than 1 second.

    Are the clock settings different in the SYS / BIOS version between arm and dsp?

    Thank you,

  • It does sound like either something isn't configured properly or one of the cores is not running at the frequency that you expect.  Take a look at the BIOS user guide, the examples at the end of section 5.2.  You can use BIOS_getCpuFreq and BIOS_setCpuFreq to make adjustments, and Clock_getTicks and Task_sleep to test.

     -dave

  • Hi ,

    The result of the BIOS_getCpuFreq() is set to 1000000000 in ARM BIOS

    and the clock frequency is 1200000000 in DSP BIOS.

    BIOS_setCpuFreq(&cpuFreq) does not change the clock frequency.


    I think the ARM BIOS library does not change the clock.

    Any Suggetions?

    Regards.

  • Did you try this example:

    BIOS_getCpuFreq(&cpuFreq);
    cpuFreq.lo = cpuFreq.lo / 2;
    BIOS_setCpuFreq(&cpuFreq);
    key = Hwi_disable();
    Clock_tickStop();
    Clock_tickReconfig();
    Clock_tickStart();
    Hwi_restore(key);

    The _setCpuFreq function does not modify the hardware clock frequency, only the rate at which the timer will expire for a given timeout.  Also (from the BIOS user guide):

    All Clock functions run in the context of a Swi. That is, the Clock module automatically creates a Swi for
    its use and run the Clock functions within that Swi. The priority of the Swi used by Clock can be changed
    by configuring Clock.swiPriority.

  • It seems that my explanation was incorrect.

    BIOS_getCpuFreq(&cpuFreq);
    cpuFreq.lo = cpuFreq.lo / 2;
    BIOS_setCpuFreq(&cpuFreq);
    key = Hwi_disable();
    Clock_tickStop();
    Clock_tickReconfig();
    Clock_tickStart();
    Hwi_restore(key);

    As you said, the value of cpuFreq is changed.

    ex) 1000000000 -> 12000000000

    However, the accuracy of Task_sleep does not change.

    That is, The tick for the 1 second delay of Task_sleep is 10000 instead of 1000.

    Why is the accuracy difference between DSP and ARM BIOS?

    Even though the hardware clock is the same.

    If so, do we have to use the ticks of Task_sleep differently in our application?

    Thanks.