Name

eCos Support for the Atmel AT91SAM9G45-EKES Evaluation Kit — Overview

Description

This document covers the configuration and usage of eCos and RedBoot on the Atmel AT91SAM9G45-EKES Evaluation Kit. The AT91SAM9G45-EKES contains the AT91SAM9G45 microprocessor, 128Mbytes of SDRAM, 256Mbytes of NAND flash memory, an Atmel Dataflash, an Atmel serial EEPROM, a Davicom DM9161A PHY, two SD/MMC sockets, a DAC, external connections for two serial channels (one debug, one flow controlled), ethernet, USB host/device, and the various other peripherals supported by the AT91SAM9G45. eCos support for the devices and peripherals on the boards and the AT91SAM9G45 is described below.

For typical eCos development, a RedBoot image is programmed into the start of NAND, and the board will load this image from reset. RedBoot provides gdb stub functionality so it is then possible to download and debug stand-alone and eCos applications via the gdb debugger. This can happen over either a serial line or over ethernet.

This documentation is expected to be read in conjunction with the SAM9 processor HAL documentation and further device support and subsystems are described and documented there.

Supported Hardware

The NAND flash contains the second level bootstrap, AT91Bootstrap, in the first block. This initializes the system clocks and the SDRAM. It then loads a 320KiB program image from offset 0x20000 in the NAND into SDRAM at 0x20008000 and then jumps into it. Typically this image will be a ROM version of RedBoot.

The Dataflash consists of 8192 blocks of 528 bytes each. The topmost block is used to manage the flash and the next four block holds RedBoot fconfig values. The remaining blocks can be used by application code.

There is a serial driver CYGPKG_IO_SERIAL_ARM_AT91 which supports both the Debug Unit and USART serial devices. The debug serial port at J10 and flow controlled port at J11 (connected to USART channel 1) can be used by RedBoot for communication with the host. If any of these devices is needed by the application, either directly or via the serial driver, then it cannot also be used for RedBoot communication. Another communication channel such as ethernet should be used instead. The serial driver package is loaded automatically when configuring for the AT91SAM9G45-EKES target.

There is an ethernet driver CYGPKG_DEVS_ETH_ARM_AT91 for the on-chip ethernet device. The platform HAL package is responsible for configuring this generic driver to the hardware. This driver is also loaded automatically when configuring for the AT91SAM9G45-EK board.

There is a watchdog driver CYGPKG_DEVICES_WATCHDOG_ARM_AT91WDTC. This driver is also loaded automatically when configuring for the board.

There is a driver for the on-chip real-time timer controller (RTTC) at CYGPKG_DEVICES_WALLCLOCK_ARM_AT91RTC. This driver is also loaded automatically when configuring for the target.

The SAM9 processor HAL contains a driver for the Two-Wire Interface (TWI) controller on the AT91SAM9G45. This type of bus is also known as I²C®. Further documentation may be found in the SAM9 processor HAL documentation. Note that the implementation of the TWI device on this part appears to have changed from earlier parts. This device does not now appear to be able to handle a repeat start sequence.

There is a driver for the MultiMedia Card Interface (MCI) at CYGPKG_DEVS_MMCSD_ATMEL_SAM_MCI. This driver is loaded automatically when configuring for the AT91SAM9G45-EKES target and allows use of MMC and Secure Digital (SD) flash storage cards within eCos, exported as block devices. Further documentation may be found within that package.

The platform HAL provides definitions to allow access to devices on the SPI bus. The HAL provides information to the general AT91 SPI driver (CYGPKG_DEVS_SPI_ARM_AT91) which in turn provides the underlying implementation for the SPI API layer in the CYGPKG_IO_SPI package. All these packages are automatically loaded when configuring for the board.

Furthermore, the platform HAL package contains support for SPI dataflash cards. The HAL support integrates with the CYGPKG_DEVS_FLASH_ATMEL_DATAFLASH package as well as the above SPI packages. That package is automatically loaded when configuring for the target. Dataflash media is then accessed as a Flash device, using the Flash I/O API within the CYGPKG_IO_FLASH package, if that package is loaded in the configuration.

In general, devices (Caches, PIO, UARTs, EMAC) are initialized only as far as is necessary for eCos to run. Other devices (RTC, I²C, SPI, MCI etc.) are not touched unless the appropriate driver is loaded, although in some cases, the HAL boot sequence will set up the appropriate PIO configuration.

Tools

The AT91SAM9G45-EKES support is intended to work with GNU tools configured for an arm-eabi target. The original port was undertaken using arm-elf-gcc version 4.3.2, arm-elf-gdb version 6.8, and binutils version 2.18.