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.

TDA4VM: Time between Task switching

Part Number: TDA4VM
Other Parts Discussed in Thread: SYSBIOS

Hi,

I wanted to know the time taken between switching of tasks.

If I have a task A that prints --> Task A

and another Task B that prints --> Task B

task A  prints--> Task A

Task B prints --> Task B

and so on.....

So, what would be time taken between the switching of these tasks.

Please suggest.

Thanks & Regards,

Piyush Datt Gaur.

  • Hello,

    Can you please provide specific details including which core, operating system, and what you are trying to achieve? There are a lot of factors involved here, the switch overhead in general is minimal. For example, if you are using serial console for prints, the latency for printing will be a lot higher than the task switch itslef.

    Regards

    Hemant

  • Hi,

    We are using TiRTOS and we wanted to write two application for -->

    1) MCU Domain R5 core

    2) Main Domain R5 core

    For both these cores we wanted to create some tasks in the application, so, for those tasks i wanted to know how i can define the periodicity or scheduling interval.

    Please suggest,

    Thanks & Regards.

  • Hi Piyush,

    The switching times should be fairly negligible. There are some reference benchmarks documented in SYS/BIOS Release Notes.

    Please look for "BenchMarks" in the release notes. Following are some benchmarks on SYS/BIOS 6.83.00.18 release. 

    The "ti.platforms.cortexR:AM65X" will be a close reference that you can use for TDA4VM (data is not generated for every possible platform).

    Note that the TI SDKs will be incrementally moving to FreeRTOS from SYS/BIOS on SDK 8.x releases. 

    regards

    Suman

  • Hi,

    Maybe i wasnt able to clearly specify what i meant was --> I want to create multiple tasks using "Task_create()" function on R5 core of Main Domain and MCU Domain, so, for the same how can i define there scheduling frequency or periodicity for each task(like 10 ms, 20 ms, .....).

    I am using "ti-processor-sdk-rtos-j721e-evm-07_03_00_07".

    OS running on A72 is Linux and on other cores is Ti-RTOS.

    Please suggest.

    Thanks & Regards.

  • Hi,

    how can i define there scheduling frequency or periodicity for each task(like 10 ms, 20 ms, .....).

    You can use Task_Params->priority field to set the priority of the task. It will in turn set the order of execution of the tasks. You can also refer TIRTOS doc present at ti-processor-sdk-rtos-j721e-evm-07_03_00_07\bios_6_83_02_07\docs\cdoc\ti\sysbios\knl\Task.html for further details.

    Please refer this thread. As mentioned, SDK 8.x is moving to FreeRTOS in phases.

  • Hi Piyush,

    Task scheduling and Task switching are two different things. Please do refer to the SYS/BIOS User Guide and the above API reference link.

    SYS/BIOS is an RTOS, so it doesn't follow the periodic slice scheduling concept of HLOS. The Task priority that Anubhav pointed will dictate the order of execution among all the READY tasks.

    A simple and easy solution for you would be to use Task_sleep() in your task function that will automatically yield your thread, and make it ready after the elapsed ticks (you would have to convert time to ticks based on the SYS/BIOS Clock frequency). Another solution would be to use Semaphores and pend on them in your Task function, with the Semaphores posted at the desired rate from a Timer function (kinda adding your own scheduling).

    regards

    Suman

  • Hi,

    Can you specify on how to configure clock frequency for mcu1_0.

    Please provide the supporting documentation if it exists.

    Thanks & Regards,

    Piyush

  • Hi,

    Can you specify on how to configure clock frequency for mcu1_0.

    please refer this FAQ. Also, if you have any further query regarding this please create new thread.

    We will keep discussion limited to topic of the thread so that its easier for future customers. Please resolve and create new thread for new issues.