Task switch time in m52259 and MQX 3.8

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Task switch time in m52259 and MQX 3.8

865 次查看
same
Contributor II

Hi,

I have a m52259 board and MQX 3.8 on it.

I want to know how long is the context switch time between tasks.

I have multiple small tasks, and every task at end of its code will make another task ready and make itself suspended. But I strongly need to know the context switch time.

is there anyone know it?

 

Thanks everybody

标签 (1)
标记 (3)
0 项奖励
2 回复数

396 次查看
same
Contributor II

I found it here:    https://community.freescale.com/message/107966#107966

thanks DavidS

System Parameters
Context Switch
4.30us413.12us 1MHz
Service Interrupt and return to task
1.51us145.40us 1MHz
System Timer/Tick Overhead
2.52us242.40us 1MHz

Task Management
Create Task
51.02us4.90ms 1MHz
Delete Task
174.00us16.70ms 1MHz
Block Task
4.30us413.12us 1MHz
Ready Task
3.73us358.32us 1MHz
Yield Task
6.73us646.32us 1MHz

Task Queues
Suspend Task
16.78us1.61ms 1MHz
Suspend Task Context Switch
7.91us758.96us 1MHz
Resume Task
6.19us594.32us 1MHz
Resume Task Context Switch
10.48us



1.01ms 1MHz

0 项奖励

396 次查看
TomE
Specialist II

Measure it.

I always set up a spare 16 or 32 bit hardware timer running at 1MHz. On the MCF5329 I'm using, that's one of the DMA Timers. Then any code can read "the current time in microseconds" either side of a function, event or task. It can print it, store it in a variable (for inspection in the debugger), accumulate, log or whatever you want to do.

Of course the simplest thing is to turn a LED on that is connected to a hardware pin at point "A" in your code and turn it off at point "B". You then measure the time with an oscilloscope. Make sure to measure the overhead of turning the LED on and off, as on some hardware ports it can be surprisingly slow. I've worked on a non-Freescale CPU that took 200 or more CPU clocks to write to a GPIO pin!

Tom

0 项奖励