This documentation explains how the eCos HAL specification has been
mapped onto the EA QuickStart board hardware, and should be read in conjunction
with that specification. The QuickStart Board platform HAL package complements
the ARM architectural HAL and the LPC2xxx variant HAL. It provides
functionality which is specific to the target board.
Startup
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 cyg/hal/hal_platform_setup.h.
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. The size of this region depends on the LPC2xxx microcontroller variant
in use. In the case of the LPC2148, the region is of size 512Kbytes, ending
at 0x80000. However the last few blocks of Flash are reserved for use as
bootblocks for the ISP/IAP firmware, resulting in a usable Flash size of
500Kbytes, ending at 0x7d000. 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. If using GDB stubs ROM, or another ROM monitor, the
virtual vector table starts at 0x40000050 and extends to 0x40000150. The
remainder of SRAM is available for use by applications. For RAM startup
applications, SRAM below 0x40001000 is reserved for the GDB stubrom and the
remainder is available for the application. An exception is if the on-chip
Flash driver is to be used. In that case, the top 32 bytes of SRAM are used
by it. This is automatically handled in the port's memory layout files if
the flash driver is present in the configuration.
on-chip peripherals
These are accessible at location 0xE0000000 onwards. Descriptions
of the contents can be found in the LPC2xxx User Manual for the appropriate
microcontroller variant.
Real-time characterization
The tm_basic kernel test gives statistics gathered about the real-time
characterization and performance of the kernel. The sample output is shown here
for information. The test was built in ARM mode, which provided better performance
than Thumb mode.
LEDs are available on the Prototype board. Most of these are attached to lines
associated with peripherals present on the Prototype board, or the QuickStart
board itself. However 9 LEDS are available for application use from C.
The following C function may be used:
Values from 0 to 511 will be displayed on the LED bank representing the binary value
with 1 being on and 0 being off. The LEDs used are connected to P0.10-P0.13 and
P0.17-P0.21, and with P0.21 being the MSB, and P0.10 the LSB.
The LEDs are also used during platform initialization and only P0.10 should be illuminated
if booting has been successful. Other LED indications represent the stage in the initialization
process that failed.
Other Issues
The following pin assignments are configured by default for LPC2148 at board
initialisation time:
PINSEL0:
P0.0/P0.1 for UART0
P0.2/P0.3 for I2C
P0.4/P0.5/P0.6 for SPI
P0.7 as PWM2 for buzzer on Prototype board
P0.8/P0.9 for UART1 (which is available on prototype board)
P0.10-P0.13 as GPIO-controlled LEDs
P0.14 EINT1 (available as button on prototype board)
P0.15 EINT2 (available as button on prototype board)
PINSEL1:
P0.16 EINT0 (available as button on prototype board)
P0.17-P0.21 as GPIO-controlled LEDs
P0.22 as GPIO output for SPI_SEL_MMC on prototype board
P0.23 as GPIO output for SPI_SEL_LED on prototype board
P0.29 as GPIO input for MMC/SD card detect on prototype board
P0.30 as EINT3 (available as button on prototype board)
(rather than GPIO input for SD write protect on prototype board)
All other pins set as GPIO inputs
PINSEL2:
P1.26-P1.31 for JTAG
All other pins set as inputs