RTOS Schedule

cancel
Showing results for 
Search instead for 
Did you mean: 

RTOS Schedule

548 Views
a8Chcx
Contributor IV

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 Kudos
15 Replies

478 Views
ErichStyger
Senior Contributor IV

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

0 Kudos

474 Views
a8Chcx
Contributor IV

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 Kudos

477 Views
a8Chcx
Contributor IV

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 Kudos

468 Views
ErichStyger
Senior Contributor IV

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 Kudos

461 Views
a8Chcx
Contributor IV

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

Tags (1)
0 Kudos

445 Views
DanielRuvalcaba
NXP Employee
NXP Employee

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 Kudos

424 Views
a8Chcx
Contributor IV

HI Daniel,

It does not work for me.

Thanks,

Christie

0 Kudos

535 Views
DanielRuvalcaba
NXP Employee
NXP Employee

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 Kudos

532 Views
a8Chcx
Contributor IV

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 Kudos

518 Views
ErichStyger
Senior Contributor IV

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 Kudos

493 Views
a8Chcx
Contributor IV

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 Kudos

486 Views
ErichStyger
Senior Contributor IV

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 Kudos

484 Views
a8Chcx
Contributor IV

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 Kudos

482 Views
ErichStyger
Senior Contributor IV

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 Kudos

480 Views
a8Chcx
Contributor IV

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 Kudos