Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

Quick Noobie Question Concerning OS

Posted 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 OS

Posted 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 OS

Posted 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.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS