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.

Task_Sleep() is delay

Other Parts Discussed in Thread: LM3S6950, SYSBIOS

Hi, Everyone

I have a question Task_Sleep() on SYS/BIOS.

My customer use this environment

SYS/BIOS 6.33.5.46
XDCtools 3.23.3.53

CPU execute Task_sleep(20ms). but It is delay about 220ms.
We do not use high priority interrupt.

Can you tell me why it is possible to delay if you know ?
and Please give me advice where should I check.

Best Regards
Hiroyasu

  • What device are you using?
    All timeouts are in units of the configured Clock.tickPeriod. What is the Clock.tickPeriod configured for your application? By default, the tickPeriod is set to 1000us (ie 1ms). What is the numerical value of the argument passed to Task_sleep()? If the Clock.tickPeriod is 1000us, then to sleep for 20 ms, you should call Task_sleep(20).

    Alan
  • Hi, Alan

    Thank you for your reply.
    My customer's device is LM3S6950.
    tickPeriod is 1000us and they call Task_sleep(20).

    Can you tell me where should I check ?


    Best Regards
    Hiroyasu

  • 1) Unless manually overridden within the Timer_Params structure, the default frequency used to determine the Timer period is the CPU frequency. What frequency is the CPU running at? By default, I believe the platform configures the system for 80MHz. If you have modified the CPU frequency, have you conveyed that information to BIOS within the .cfg file:

    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    BIOS.cpuFreq.hi = 0;
    BIOS.cpuFreq.lo = 800000000; /* your frequency here */

    2) Using the "Device" tab within the Timer ROV view, what value is being shown for "period" for the timer instance whose timer function is "ti_sysbios_knl_Clock_doTick "? That value is what is being used to generate the 1ms period you've configured for the Clock.tickPeriod. It is based on the BIOS.cpuFreq value which can be seen in the BIOS module view.

    Alan
  • Hi, Alan

    I'm sorry. It was late.

    This is screan shot  of ROV.


    I think below

    Period value * Freq = time

    This understanding is correct ?

    Best Regads
    Hiroyasu

  • Hi, Alan

    Could you reply ?

    Best Regards
    Hiroyasu
  • As far as I know, the sleeping task will only be readied after sleeping. So you do not necessarily need a higher-priority interrupt to block it, any task with equal or higher priority will suffice. Do you have other tasks running?

  • Hiroyasu,

    From the screenshot, BIOS calculated a Period assuming a 50MHz clock, or that timer has been configured to use another clock source. Could you provide the .cfg from the project?

    Derrick