AvrX Real Time Kernel

Home
Up
AvrX Fifo
Overview
Theory
Getting Started
AvrX 2.6
AvrX 2.3 IAR
Mail

AvrX 2.6 for IAR and GCC C compilers

Download AvrX 2.6f Now

AvrX 2.3 has been rewritten to support 16 bit pointers and interface directly with C compilers.  The number of tasks, semaphores, messages and timers is limited only by system SRAM.

  1. The internal data representation was changed to little-endien to make Avrx data structures compatible with C.  This allows extensions to AvrX to be written in C.  An added bonus is that astudio.exe, Atmel's debugger, can display and trace Avrx data structures such as linked lists of running tasks.
  2. Explicit in-line code (Epilog() in particular) has been replaced with #define macros.  The inline construct was causing astudio some grief.  Actually, due to optimization issues with IAR I just got rid of Epilog() macro and now tasks can call it like any other entry point.  It is a little slower and a little fatter, but in the overall scope it isn't an issue.  The GCC version still uses a macro to "rjmp _Epilog".
  3. All register usage has been changed to use nicknames, defined in "avrxctoasm.inc"  This file allows the code to be portable between IAR and GCC.
  4. Two AvrX api have changed: AVRX_TASK and AVRX_DEFTASK.  Now they are AVRX_IAR_TASK and AVRX_GCC_TASK and AVRX_IAR_DEFTASK and AVRX_GCC_DEFTASK, respectively.  The issue here is that IAR C uses a second stack for parameters passing and automatic variable allocation.  The task stack is declared in these two API and that required that the API change.  See example code for usage.  Naturally, if you only use one or another compiler you would only use the appropriate API.
  5. To paper over differences between IAR and GCC in how chip variants are specified and how interrupt handlers are dealt with I added two new files: avrx-io.h, avrx-signal.h,  and included a file that will be added to IAR C compiler in a June release: avrio.h.  If one sticks with the GCC compiler, these files are not needed.  If one sticks with IAR they replicate the GCC techniques, which are needed for efficient SRAM usage.  If one uses the IAR interrupt support, the stack usage will be considerably larger.
  6. A new mechanism has been incorporated to set the kernel stack.  It involves a new API.  See samples and test cases for details.  The API is "AvrXSetKernelStack()"

See AVR Tools to get the GNU GCC compiler.  Contact your IAR representative to purchase the IAR ICCAVR compiler tool suite.

After installing the compiler, you need to download and expand the GCC AvrX 2.6f.zip file.  After deciding where you want the source on your hard drive, you will need to create a DOS environment variable that has the complete path to the directory. Then you need to build the AvrX Library and try it out by building the examples and running them on the STK200/300/500 development boards, or in the  simulator. 

Current Status:

18-Sep-05

Release GCC AvrX 2.6f.zip  This version adds AvrXFifo module for buffered I/O support between tasks and interrupt handlers.

A generic 8 bit, no parity, one stop, serial i/o driver code has been added as a new sample.  The serial driver comes in two flavors: buffered and un-buffered.  There is a sample application that illustrates how to use the code.

Another significant change: Task attributes (GCC) were changed from NAKED to NORETURN which allows stack based variables at the top level.  Now tasks can declare local structures (TimerControlBlocks, MessageControlBlocks) as automatic variables.

Many minor code changes were incorporated to support IAR users.  Unfortunately I am unable to test these changes (they were copied from modified code a user posted).

IAR support is old.  Although the files should work, there might be minor issues to resolve.  The makefiles are completely out of data although it appears that most folks using AvrX with IAR use the embedded workbench to manage projects.  The IAR makefiles are retained in the project to help users to get started.  If you plan to use IAR compilers, make sure you sign up for the mailing list and ASK.

24-Mar-04

Various minor changes have been made to avrx to track changes in avr-gcc.  Find the latest code in the files section of the Yahoo Groups mailing list: http://groups.yahoo.com/group/avrx

05-June-01

Released AvrX version 2.6 for the avr-gcc and IAR C compilers.

To Do List:

  1. Write tutorial going over each sample code and illustrating how AvrX works by using the debug monitor single step features.
  2. Write a section describing coding issues and essential differences between IAR and GCC versions.
  3. Re-write the overview of AvrX to remove the differences between the old and new versions
  4. Add the TimerMessage mechanism to AvrX 2.3
  5. Split the theory paper into two to cover the differences between IAR assembly and AVR-GCC compiler as it pertains to writing AvrX Code.