FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [February 2012 Threads] Quick Noobie Question Concerning OSPosted by J. Day on February 29, 2012 Hi Folks-
I am trying to get my unsupported port working on an HCS12XA256 processor. I have narrowed down my problem to the context switch. My system tick is working etc. But there is an issue in the context switch that I am working on. My question is not about the prorting problem rather in using the OS itself.
I have created two real simple tasks where each flashes a separate LED. I have disabled pre-emption (configUSE_PREEMPTION=0). My objective is to see if, for each task, I can run the task to completion then perfrom a context switch using the portYIELD() macro. Each task is running the the required for(;;) {} loop. There are three tasks running. The idle task plus the two LED tasks.
Since I dont have a working OS to test this out on at the moment, is my approach acceptable? In essence, I'm trying to emulate a simple round robin shecheduler. Both tasks are at the same priority, but higher than the idle task.
RE: Quick Noobie Question Concerning OSPosted by Richard on February 29, 2012 A port has to switch context form an interrupt and also from a task (when it yields, blocks, or unblocks another task). Your test is a good starting point in getting the context switch working from the task. Once that is working you can do the same from the interrupt.
In your test, if there is no preemption, both tasks have the same priority, and the priority is above the idle task then.........the first task should run until it calls taskYIELD, then the next task should run until it calls taskYIELD, then the first task should run again, and so on back and forth between the tasks. The idle task should never run.
Regards.
RE: Quick Noobie Question Concerning OSPosted by J. Day on March 1, 2012 Thanks for the clarification.
This is quite an impressive piece of work and I really hope to get it working on my processor. I will purchase the documentation once I have the basic port going. I know where my problem is now and working on the fix.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|