FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [July 2016 Threads]
Hi,
I wanted to ask how can I measure the created task execution time with vApplicationTickHook(). It gets called at tick but what should I do to calculate task execution time
Regards,
swam
You may want to look at http://www.freertos.org/rtos-run-time-stats.html which talks about the build in faciltiy to measure task execution time.
Thanks for the reply.Actually the problem is like rhis
there are two tasks one with higher priority and and heavy and otherwithl low priority just printing at some regular interval and i wanted to find exection of both jobs that will occur at some intervals in milliseconds.Is it possible with to meaausre with tickhook?
It would be hard to do that with the tick hook as it is not what the
hook is for, so it does not have access to the information necessary.
As Richard Damon has already highlighted, there is a run time stats
facility which will give you the total amount of time each task is
consuming. If you what the run time for individual executions then you
could use the trace hook macros
http://www.freertos.org/rtos-trace-macros.html - specifically the
traceTASKSWITCHEDIN() or traceTASKSWITCHEDOUT macros - where the
pxCurrentTCB variable is available to you so you know which task is
being switched in or out (depending on the macro you define). A similar
thread:
https://sourceforge.net/p/freertos/discussion/382005/thread/d20f4bf7/
ok thnks alot. Sorry Im new to freeRtos and I have one more thing to ask. I want to change the priority of task I created in main . in some other task as in mycase priority set task and I was having problem that when I do it the following way it doest give any output Am I doing it right?
BaseTypet yReturned;
TaskHandlet communication_handle = NULL; //outside main
~~~
int main
{
.// new code
yReturned = xTaskCreate((pdTASKCODE)communication, (signed char *)"Communication", configMINIMALSTACKSIZE, NULL, 1, &communicationhandle);
zReturned = xTaskCreate((pdTASKCODE)prioritysettask, (signed char *)"Priorityset", configMINIMALSTACKSIZE, NULL, 5, &priorityset_handle);
//
.........
}
~~~
Now wht i m doing is using handler of communication task not inside main but Priorityset one
I am setting the priority of communication task to new value as follows
~~~
static void priorityset_task()
{
while (1)
{
vTaskPrioritySet(communication_handle, 2);
}
}
~~~
Is it the right way to use handler or I need to do something else?
Thanks
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.