This documentation explains how the eCos HAL specification has been
mapped onto the IAR KickStart board hardware, and should be read in conjunction
with that specification. The KickStart 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 LPC2106, the region is of size 128Kbytes, ending
at 0x20000. 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
120Kbytes, ending at 0x1e000. 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 KickStart boards although most of these are attached to lines
associated with peripherals. However 4 LEDS are available for application use from C.
The following C function may be used:
Values from 0 to 15 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
P0.13 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 LPC2106 at board
initialisation time:
PINSEL0:
P0.0/P0.1 for UART0
P0.2/P0.3 for I2C
P0.4/P0.5/P0.6/P0.7 for SPI
P0.8/P0.9 for UART1
P0.10-P0.13 as GPIO-controlled LEDs
P0.14 EINT1
P0.15 EINT2
PINSEL1:
P0.16 EINT0
P0.17-P0.21 as GPIO, although in practice these are used for JTAG
if a JTAG unit is connected.
P0.22-P0.31 as GPIO inputs