AT91 ARM-Projects

by Martin THOMAS

This is a sub-page of my ARM-Projects-Page where you can find the WinARM toolset (gcc-compiler for ARM and tools), general ARM examples implemented witch gcc and various Philips LPC2000 ARM projects and examples.

You may like to visit my AVR-Projects page too.

Available AT91 Projects and Information (Content)

"Last updated" may be just additional information not always a new version of a software-package. All presented projects should work with minimal modifications in the linker-scripts and source-code on all AT91SAM7 controllers.

If you think that I could help you with your projects: just send an e-mail. I'm looking for "freelance"-jobs.

If you send me an e-mail: Please use your full name (your _real_ full name). And it's always nice to get some kind of feedback if an answer to a question did help or did not help. I often spend a lot of time answering e-mails and would at least like to know if my suggestions did or did not help solving a problem.

Questions or suggestions? Please use the support-forum for WinARM/arm-elf-gcc and the example-projects.



AT91SAM7 GPIO Example

GPIO example application for the Atmel AT91SAM7S64 (should work with all AT91SAM after minimal changes). Based on an example from Atmel for the Keil environment. Source compatible with arm-elf-gcc (as in WinARM). Build tested with WinARM 4/05 and 6/06 but should compile with all arm-elf-gcc toolchains. [Download] (timestamp 20060825, makefile, headers, linker-scripts and startup-code included).

Version history:

AT91SAM7 Interrupts Example

Example application for the Atmel AT91SAM7S64 (should work with all AT91SAM after minimal changes) which demonstrates "AIC"-interrupts by a timer and an external interrupt. Based on an example from Atmel. Build tested with the AT91SAM7S-EK Evaluation Board (the older version with an AT91SAM7S64) and WinARM 8/05 but should compile/link with all arm-elf-gcc toolchains. [Download] (timestamp 20060825, includes makefile, headers, linker-scripts and complete startup-code)

Version history:

AT91SAM7 Serial-IO/UART Example

Example application for the Atmel AT91SAM7S64 (should work with all AT91SAM after minimal changes) which demonstrates UART interfacing (serial I/O) in simple "polled" mode (no ISRs). Based on an example from Atmel but extended by some extra code. Build tested with the AT91SAM7S-EK Evaluation Board (the older version with an AT91SAM7S64) and WinARM 8/05 but should compile with all arm-elf-gcc toolchains.

[Download] (timestamp 20070921, includes makefile, headers, linker-scripts and complete startup-code)

Version history:

AT91SAM7 Serial-IO/UART and Interrupt Example

Example application for the Atmel AT91SAM7S64 (should work with all AT91SAM after minimal changes) which demonstrates UART interfacing (serial I/O) in simple "polled" mode (no ISRs) and interrupts via the vectored interrupt controller (VIC/AIC). Based on an example from Keil but extended by some extra code. A lot of extra work has been done in the interrupt-handling-code, the linker-script and the startup-code. The example-application and code shows:

Additional functions/modifications I have done:

Build tested with the AT91SAM7S-EK Evaluation Board (the older version with an AT91SAM7S64) and WinARM 8/05 but should compile with all arm-elf-gcc toolchains. [Download] (timestamp 20051202, includes makefile, headers, linker-scripts and complete startup-code)

Old version: [Download] (timestamp 20051030, includes makefile, headers, linker-scripts and complete startup-code)


AT91SAM7 USB Examples

AT91SAM7 USB Example 1

Example-application for the Atmel's AT91SAM7S64 (should work with all AT91SAM7S after minimal changes) which demonstrates USB and UART interfacing. Based on an example from Atmel (BasicUSB for IAR-Compiler). Extended by some extra code and ported to arm-elf-gcc/WinARM. The example-application and code shows:

Additional functions/modifications:

Tested with the AT91SAM7S-EK Evaluation Board (the older version with an AT91SAM7S64) and WinARM 8/05 but should compile with all arm-elf-gcc toolchains. [Download] (timestamp 20060901, includes makefile, headers, linker-scripts and complete startup-code).

Version history:

AT91SAM7 USB Example 2

Another example from Atmel ported to the GNU-Toolchain: The code is based on the example USB_UART from Atmel for IAR-EW (name of the original archive: AT91SAM7S-USART_USB-IAR4_40A-1_00, 25. Sept. 2006). The project is a simple USB to UART("RS232") converter. I have added files needed to compile the source with the GNU-toolchain following the Atmel scheme (Compil/srcWinARM/), added a Makefile, added an inf-file since it has not been included in the original package and modified the USB PID to avoid conflicts with the original code (Don't use the USB VID from Atmel an the USB PID in the example in a production device!). Only minor modifications have been done in the original source-code to avoid compiler-warnings. The projects can be built for AT91SAM7S64 and AT91SAM7S256 "out of the box" (see Makefile). Other AT91SAM7 controllers with USB should be supported too after minimal modifications. The package includes files to automate flash programming with FT2232- and Wiggler-based JTAG-interfaces and OpenOCD (make program, OpenOCD binary not included). A readme-file with further information is available in the archive.

Tested with the AT91SAM7S-EK Evaluation Board and the GNU-Toolchain as in WinARM 6/06 but should compile with all arm-elf-gcc toolchains. [Download] (timestamp 20061027, includes makefile, headers, linker-scripts and startup-code). (test)

AT91 USB Core + HID Code ported to GNU/gcc

Preliminary version of Atmel AT91 USB Core and HID code. Based on the Atmel-code Core 1.01 and HID 1.0 for ADS. Tested with the AT91SAM7S-EK with AT91SAM7S64. Since a lot of people have asked: The port ist preliminery (esp. the makefiles). This release includes fixes/modifications proposed in the WinARM/arm-elf/Yagarto-support-forum and a new version of make.exe (3.81 for Win32). This will work around the "sh.exe" problem of the previous version. See readme.txt included in the package for further information.
[Download] (timestamp 20070310, zip-Archive ca. 1,35MBytes)

Modified version of the AT91 HID-code

"EXC" has send a modified version of the HID example which emulates a joystick. From his e-mail: The code works by taking commands from the DBGU for each axis (there is a very basic help screen on the DBGU terminal), and then sends them to the USB port. You can check operation by going into control panel - game controllers and selecting the controller and viewing the axis move after setting a position. It should work with the other processors without too much (if any other than the mt_defs) mods. Thanks for the contribution.
[Download EXC's code] The source-code is based on my the AT91USB the older core+HID gcc-port and currently inherits the "sh.exe"-problem discussed above.


AT91SAM7 "MIPS" example-port

This is a port of the example "AT91SAM7S256-MIPS-IAR4_30A_1_21" provided by Atmel (at91.com) to the GNU arm-elf toolchain. The MIPS-example has not been available for the GNU-toolchain by the time of writing this. I have ported and modified the code for the IAR-compiler to the GNU arm-elf-toolchain.

The benchmark itself is not too useful but I think the modifications done for the GNU-toolchain can be useful for other projects. I have done the port to learn more about the toolchain-internals like assembler, assembler-macros, interwork, newlib and newlib-syscalls etc. and did not care about the "MIPS"-values. Positive "side-effect": some knowledge about porting from IAR to GNU - a deja vue from the AVR Butterfly GCC-port.

Modifications and extensions done:

Tested with the AT91SAM7S-EK Evaluation Board (the older version with an AT91SAM7S64) and WinARM 3/06 but should compile with all arm-elf-gcc toolchains. [Download] (timestamp 20060715, includes makefile, headers, linker-scripts and startup-code).

Version history:

AT91SAM7 "RTT Basic" example GNU-port

This is a port of the example "AT91SAM7S256-RTTBasic" provided by Atmel to the GNU arm-elf toolchain. The example has not been available for the GNU-toolchain by the time of writing this. I have ported and modified the code for the IAR-compiler to the GNU arm-elf-toolchain. The example demonstrates configuration and calibration of the AT91SAM7 RTT so the RTT can be used as "real" realtime clock.

Tested with the AT91SAM7S-EK Evaluation Board (the older version with an AT91SAM7S64) and SAM7-P with AT91SAM7S256 and WinARM 6/06 but should compile with all arm-elf-gcc toolchains.

[Download] (timestamp 20061101, includes makefile, headers, linker-scripts and startup-code).


C++ on an AT91SAM7S with the GNU-Toolchain

Example: at91sam7s64_cpp

A small examples which demonstrates how to use C++ with the GNU-Toolchain on the ARM7TDMI. Implemented functions: classes, static/dymanic objects, inheritance, polymorphism. The code itself is not very interesting but the makefile, linker-scripts and startup-code my be useful for own projects. Tested with an AT91SAM7S64 on an Atmel AT91SAM7S-EK with the toolchain as in WinARM 6/06.

[Download] (timestamp 20060914, includes makefile, headers, linker-scripts and startup-code)

Version history:

Example: at91sam7s_cpp

Yet another small C++-examples. Even less "C++" just one LED-handler-class with a ("static") contructor which handles GPIO-init and two member-functions on/off. But the example-package includes an updated makefile and improved startup-code and linkerscripts (based on my "gamma" example"). Can be configured easily to work with AT91SAM764, AT91SAM7S128 and AT91SAM7S256 and different boards (prepared for the Atmel SAM7S-EK and the Olimex SAM7-P64/SAM7-P256 . Monior modifications needed for AT91SAM7A-series.

[Download] (timestamp 20070507, includes makefile, headers, linker-scripts and startup-code)



AT91SAM7 SWI, Remap, GPIO, PIT and stdio Example ("Gamma")

This example demonstrates the handling of ARM software-exceptions (SWI), memory-remapping/exception-vector-placement, the usage of the periodic intervall timer and stdio ("printf"). I have made this software to learn more about SWI-handling and memory-handling with the GNU-toolchain. The SWI-code should be rather portable i.e. for LPC2000 or STR7. The remapping-code is of cause device-specific (SAM7) but the basic concept can be used for other controllers too. Thanks to the developers and documentations-authors from Anglia-Designs, ARM, Atmel, Sharp, ST and OKI, I have learned a lot from the documents and example-code (I'm sure there is still a lot more to learn...).

List of functions:

The example has been tested with the AT91SAM7S-EK Evaluation Board from Atmel and the SAM7-P board with AT91SAM7S64 and AT91SAM7S256 but should support most AT91SAM7S and Boards after minimal changes. (AT91SAM7A3-port also available - see below)

My GNU-tools-collection WinARM (Version 5/07-testing) has been used for compilation but the code should compile with all arm-elf-gcc toolchains.

[Download] (timestamp 20070830, includes makefile, headers, linker-scripts and startup-code)

Version History:

A user who does not want his name to appear on this page has contributed an adapted version of the "gamma"-example for the AT91SAM7A3. Download the AT91SAM7A3-port [here]. Thanks for the contribution.


AT91SAM7S256 and FreeRTOS Example application

An example application which uses Richard Barry's FreeRTOS on an AT91SAM7S256. Project provided by Darrik Spaude: "I have attached my version of the Atmel AT91SAM7S256 demo source (using FreeRTOS 4.1.0) for consideration into the next WinARM release. It was compiled and tested with WinARM 20060606. It's at least a start for others who would like to use that particular Atmel part AND some form of GCC with the FreeRTOS operating system."

[Download] (timestamp 20060925, zip, ca. 680kB)


Linker-Scripts for the AT91SAM7S256

So far most of the examples on this page just include linker-scripts (ld-files) for the AT91SAM7S64 since my Atmel evaluation-board is one of the early series with this controller. On newer evaulation-boards an AT91SAM7S256 is mounted. To compiler and link the examples for this target modifications in the linker-scripts (memory sections) are needed. Ewout Boks kindly provided modified linker-scripts that can be used directly with all examples which are based on the Atmel source-structure where the startup-code is split in assembler- and c-code. To use the scripts copy the contents of this archive (timestamp 20060825) into the same path as the SAM7S64 ld-files and change the target-settings in the makefile from AT91SAM7S64 to AT91SAM7S256. For those examples based on the Keil source-structure where all startup-code is in an assembler-code file the linker-scripts can serve as templates for the needed modifications in the memory-definitions.

Please check the scripts in the "gamma"-example too. They are newer and offer more options.

Version history:

To my ARM-Projects page (WinARM, Philips LPC2000 ARM projects)

To my Atmel AVR-Projects page


Martin Thomas
mail-adress: mthomas /at/ rhrk /dot/ uni-kl /dot/ de


173566 hits since
Last mod.: Tuesday, 15-Sep-2009 16:43:13 CEST