Quality RTOS & Embedded Software

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




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) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists