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

Porting FreeRTOS to AT89LP

Posted by babicka_baba on March 2, 2013
Hello everybody,
I just got a school assignment that requires me to write a small embedded application with some RTOS. At the same time, I have a work assignment to rewrite firmware for our legacy hardware using the AT89LP4052 microcontroller from the 8051 family. This led me to idea that I could do both at once, and real-time scheduling would actually ease the development of the application. Googling around a bit, it turns out that 8051 family is not well supported among RTOSes. The only RTOS that claims official support for AT89s is RTX51 tiny, but since this is a small project, the cost is prohibitive.

Out of the free variants, FreeRTOS is the only one to claim at least SOME support for 8051, but the controller in the demo (​C8051F) seems quite different. Now, the question is: could anyone give a rough estimate how much effort would it take to port FreeRTOS to AT89? Or would that be possible at all given the very limited computing resources? I really only need scheduling. I do not have much microcontroller experience, I come from the PC world, but I think I learn pretty quickly :-)

Thanks very much for any hints!
Martin

RE: Porting FreeRTOS to AT89LP

Posted by Dave on March 2, 2013
You will not get a preemptive OS running on a device with so little RAM. There are cooperative and run to completion products that might work.

RE: Porting FreeRTOS to AT89LP

Posted by babicka_baba on March 2, 2013
Thanks very much for the quick reply! I dare asking few more questions :-)

There is some support for cooperative multitasking in the FreeRTOS, namely co-routine support and configUSE_PREEMPTION flag. Would any of this let me get away with this little RAM or do I need something much more lightweight than FreeRTOS?

I tried Googling for a cooperative RTOS, but mostly found only code snippets and nothing that would really look like RTOS, the only exception being QP Nano and MiCOS. Is this because cooperative multitasking is so simple it is not worth an actual RTOS? Or could you point me towards some interesting variants?

Best regards
Martin

RE: Porting FreeRTOS to AT89LP

Posted by Richard Damon on March 2, 2013
The problem you will run into is that even though you are only using co-routines, FreeRTOS is still based on a model that supports true multi-tasking, which will tax the capabilities of a processor as small as the 8051.

It might be possible to look at how co-routines are implemented and do something similar after stripping out the multi-tasking code. This might end up being too small of an OS to qualify for the school assignment, although you may get extra credit for actually building the RTOS instead of just using one.

RE: Porting FreeRTOS to AT89LP

Posted by babicka_baba on March 2, 2013
Turns out the correct Google phrase was "Non-preemptive rtos" :-) I actually found something useful! Now its time to try that out....
If there is any way to use FreeRTOS in a non-preemptive way with very little ( < 64B) RAM, let me know!

RE: Porting FreeRTOS to AT89LP

Posted by babicka_baba on March 2, 2013
Oh, beaten. Thanks for the info!

RE: Porting FreeRTOS to AT89LP

Posted by Richard Damon on March 2, 2013
64 Bytes of RAM is probably too little Ram for FreeRTOS, as even with configUSE_PREEMPTION set off, it is still based on a preemptive model (it just won't do a preemptive task switch). with only 64 bytes, you probably can't even have two tasks, each with their own full stack frame. That really is a VERY small machine. I suspect that at that size the only thing that will fit would be something based on a model similar to FreeRTOSs co-routines (or the Timer call back method), with no support for anything more complicated, as this model does not need multiple stack frames.


[ 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