freertos task switching

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

freertos task switching

1,866件の閲覧回数
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,694件の閲覧回数
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,694件の閲覧回数
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,694件の閲覧回数
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 件の賞賛
返信