freertos task switching

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

freertos task switching

1,821 次查看
wxingsheng
Contributor I

I am using the csi_rgb565 example and I am trying to use rtos to run two tasks. The first task is the camera task, which captures images and displays it on the LCD, and the second task is an image processing task, which processes images slowly and runs less frequently than the camera task. I have set two tasks with the same priority but when I started the scheduler, only the camera task is running. The image processing task never runs. I have set USE_PREEEMPTION and USE_TIME_SLICING to 1 but the problem persists. Can anyone help? Thanks!

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

1,649 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Xingsheng:

FreeRTOS uses priority based scheduler. If a higher priority task never blocks on something,  lower priority tasks will not get any time to execute.   I would suggest you check your higher priority task. for example,  vTaskDelay can release CPU, then lower priority task can have an opportunity to run.

Regards

Daniel

0 项奖励
回复

1,649 次查看
wxingsheng
Contributor I

Hi Daniel,

Both my tasks have the same priority so I don't think priority is the problem here. Also, I have added vTaskDelay to one of the tasks but the tasks still didn't switch.

0 项奖励
回复

1,649 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Xingsheng:

Please refer to below link for task switching issues.

task not switching - FreeRTOS 

c - FreeRTOS tasks are not context switching - Stack Overflow 

Regards

Daniel

0 项奖励
回复