RTOS Schedule

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

RTOS Schedule

1,683 次查看
a8Chcx
Contributor V

Hi,

 

I am using MCUXpresso 11.5.0 with SDK 2.11.0 On FRDM-K66 board.

It works fine with single task, I can create, run, delete, and etc...

But, when I create the second one, the first one stop working, like not schedule...

Then, I try "freertos_mutex.c), and it does not work either...

Can anybody tell me how to fix this problem?

Thanks,

Christie

0 项奖励
15 回复数

1,613 次查看
ErichStyger
Senior Contributor V

I really don't know what you mean with 'message'? Have you followed my article above and checked all the points already?

0 项奖励

1,609 次查看
a8Chcx
Contributor V

Hi Erich,

I have the same problem as following link:

https://community.nxp.com/t5/MCUXpresso-SDK/FreeRTOS-Task-Aware-Debug-issue-for-lwip-httpssrv-mbedTL...

 

Can you tell how to fix it finally?

I tried to use heap_3.c in mutex sample and works fine as well...

Thanks,

Christie

0 项奖励

1,612 次查看
a8Chcx
Contributor V

Hi Erich,

What I mean is if I can see the running task, heap size and etc.. when app is running?

"freertos_tasks_c_additions.h" file is included in both projects and I follow your web...

One is working, the other one is not...

Can be related to heap.x because I saw one is using heap_4.c and other one is using heap_3.c?

Thanks,

Christie

0 项奖励

1,603 次查看
ErichStyger
Senior Contributor V

you won't be able to see heap information if you are using a wrapper to malloc() and the likes, because they do not have the information needed. But you will see all the other information.

0 项奖励

1,596 次查看
a8Chcx
Contributor V

Hi Erich,

Thanks.

Have you solve the issue in the following link. Looks like I have the same problem, no data displayed...

https://community.nxp.com/t5/MCUXpresso-SDK/FreeRTOS-Task-Aware-Debug-issue-for-lwip-httpssrv-mbedTL...

 

Thanks,

Christie

标记 (1)
0 项奖励

1,580 次查看
DanielRuvalcaba
NXP TechSupport
NXP TechSupport

Hello Christie

Can you please take a look to following thread? It looks like someone had a similar problem and they’ve found a solution.

https://community.nxp.com/t5/i-MX-RT/FreeRTOS-Run-Time-Statistics-Not-Working/m-p/1341402

Hope this helps, Daniel.

0 项奖励

1,559 次查看
a8Chcx
Contributor V

HI Daniel,

It does not work for me.

Thanks,

Christie

0 项奖励

1,670 次查看
DanielRuvalcaba
NXP TechSupport
NXP TechSupport

Hello

Can you please show me how are you creating your tasks and how your tasks are defined?

Or if I could get a copy of your project to take a deeper look it would be great.

Regards, Daniel.

0 项奖励

1,667 次查看
a8Chcx
Contributor V

HI Daniel,

I try the sample code and works fine.

Then, I change to my code and behavior is wrong.

1) If I use the different priority, it will only print it for higher priority task.

2) If I just print the message on two tasks with same priority, it print the message for one, not two...

Only way to print the message properly is to use mutex with same priority on both tasks.

I use a lot in bare-metal environment and using PRINTF for my debug. I have to use MbedTLS for https server and client, looks like I have to use Free RTOS instead of bare-metal environment. I have the following questions:

1) What is the best way to debug the my application in RTOS?

2) I have one task to read https server page by using https client, it will take around 1 or 2s. Can you tell me how set up the task?

Thanks,

Christie

Questions:

0 项奖励

1,653 次查看
ErichStyger
Senior Contributor V

You have to make sure that every task should return some time (vTaskDelay() or the like) so other tasks have a chance to get CPU time.

As for debugging: see https://mcuoneclipse.com/2017/03/18/better-freertos-debugging-in-eclipse/ or consider using the SEGGER SystemView (https://mcuoneclipse.com/2015/11/16/segger-systemview-realtime-analysis-and-visualization-for-freert... ) as it provides a graphical view when tasks (and why) are running.

I hope this helps,

Erich

0 项奖励

1,628 次查看
a8Chcx
Contributor V

Hi Erich,

Thank you for your help!

After adding VtaskDelay, it works fine...

Then, I tried to debug my application, I click RTOS on IDE, the windows are popped up, but no real-time display, like task name, heapsize, and etc...I am using P&E mutilink USB tool to flash...

1) Can you tell me how to set up debugging?

2) My bear-metal application works fine, can I just create one task, then put bare-metal in it? All functions in bare-metal should work?

3) How many tasks should I create? Any rule?

Thanks,

Christie

0 项奖励

1,621 次查看
ErichStyger
Senior Contributor V

1) Keep in mind that the views are stop-mode views: you have to suspend/halt/pause the target to see the data.

2) That all depends what your application is doing. In general 'yes, but....'

3) There are no rules. Keep in mind that there is always the IDLE task created by the RTOS, plus depending on your setting the timer service task (see for example https://mcuoneclipse.com/2018/05/27/tutorial-understanding-and-using-freertos-software-timers/ ). Usually a system has around 3-6 tasks running, again depending on the application.

I hope this helps,

Erich

0 项奖励

1,619 次查看
a8Chcx
Contributor V

Hi Erich,

When I suspend the application, it says RTOS is not detected.

Do I need to change any setting?

The project I am using is https server demo project from SDK...

Thanks,

Christie

0 项奖励

1,617 次查看
ErichStyger
Senior Contributor V

have you enabled/integrated the freertos_tasks_c_additions.h file?

If not, the debugger expects that data to be present in the application, see https://mcuoneclipse.com/2017/03/18/better-freertos-debugging-in-eclipse/

I hope this helps,

Erich

0 项奖励

1,615 次查看
a8Chcx
Contributor V

Hi Erich,

I tried mutex sample and it displays the message if I suspend app...

But, the other one(sample from https server) can't display anything. My app keeps running, not suspend.

Please tell me if I need to set up something?

Another question: There is any way to see the running messages?

Thanks,

Christie

0 项奖励