HAL Port — Implementation Details
This documentation explains how the eCos HAL specification has been
mapped onto the EVBA7 Eval Board hardware, and should be read in conjunction
with that specification. The EVBA7 Eval Board platform HAL package complements
the ARM architectural HAL and the LPC2xxx variant HAL. It provides
functionality which is specific to the target board.
Following a hard or soft reset the HAL will initialize or
reinitialize many of the on-chip peripherals. This includes the PINSEL
functions and LED bank. There is an exception for RAM startup
applications which depend on a ROM monitor for certain services.
For ROM startup, the HAL will perform additional initialization,
programming the various internal registers including PLL (for the
clocks), Memory Mapping control registers to map SRAM to 0x0, and
Memory Acceleration Module (MAM). The details of the early hardware
startup may be found in the header
Linker Scripts and Memory Maps
The platform HAL package provides the memory layout information needed
to generate the linker script. The key memory locations are as follows:
- on-chip Flash
This is located at address 0x0 of the memory space, although
after hardware initialization, the start of internal SRAM is mapped over
locations 0x0 to 0x40. This region ends at 0x20000. No flash driver is
provided for the on-chip Flash. The MAM is enabled to accelerate memory
reads from this area.
- internal SRAM
This is located at address 0x40000000 of the memory space, and is 16,
32 or 64k in size, depending on the chip fitted. The first 64 bytes
are mapped to location 0x0000000. When this is the only RAM available,
the virtual vector table starts at 0x40000050 and extends to
0x40000150. The remainder of SRAM is available for use by ROM based
applications. For RAM startup applications, SRAM below 0x40001000 is
reserved for the GDB stubrom and the remainder is available for the
On boards fitted with the PA-EVBA7-144 adaptor and where the external
SRAM is being used, only the first 64 bytes are used as described
above. The remainder of internal SRAM is not used by eCos.
- external SRAM
This SRAM is only present if the EVBA7 is fitted with a PA-EVBA7-144
adaptor. It is located at address 0x81000000 of the memory space, and
is 1MByte in size. When this memory is being used for applications
the virtual vector table starts at 0x81000050 and extends to
0x81000150. The remainder is available for use by ROM based
applications. For RAM startup applications, memory below 0x81010000 is
reserved for RedBoot and the remainder is available for the
- on-chip peripherals
These are accessible at location 0xE0000000 onwards. Descriptions
of the contents can be found in the LPC2000 User Manual.
The LEDs may be accessed from C++ with the following function:
extern void hal_diag_led(int leds);
Values from 0 to 16 will be displayed on the LED bank representing the binary value
with 1 being on and 0 being off, and with P0.7 being the MSB, and P0.4 the LSB.
The LEDs are also used during platform initialization and only P0.4 should be illuminated
if booting has been successful. Other LED indications represent the stage in the initialization
process that failed.