Name

Configuration — Platform-specific Configuration Options

Overview

The Freescale TWR-K70F120M platform HAL package is loaded automatically when eCos is configured for the twr_k70f120m target. It should never be necessary to load this package explicitly. Unloading the package should only happen as a side effect of switching target hardware.

Startup

The TWR-K70F120M board platform HAL package supports separate variant and platform startup types:

ROM
This startup type can be used for finished applications which will be programmed into internal flash ROM at location 0x00000000. Data and BSS will be put into internal SRAM starting from 0x1FFF0000. The application will be self-contained with no dependencies on services provided by other software. The program expects to boot from reset with ROM mapped at location zero. eCos startup code will perform all necessary hardware initialization.
RAM
Currently unsupported, this is the startup type which is used if relying on either a RedBoot or a GDB stub ROM image programmed into internal flash to download and run applications into RAM via arm-eabi-gdb. It is assumed that the hardware has already been initialized by the ROM monitor. By default the application will use the eCos virtual vectors mechanism to obtain services from the ROM monitor, including diagnostic output.
JTAG
This is the startup type used to build applications that are loaded via a hardware debug interface. The application will be self-contained with no dependencies on services provided by other software. For the variant JTAG startup type the eCos run-time will perform all necessary hardware initialization. When using the platform JTAG startup type the hardware debugger configuration is responsible for initialising the clocks and DDRMC necessary to allow access to the off-chip SDRAM where applications will be loaded.

Virtual Vectors

If the application is intended to act as a ROM monitor, providing services for other applications, then the configuration option CYGSEM_HAL_ROM_MONITOR should be set. Typically this option is set only when building the GDB stub ROM (or RedBoot).

If the application is supposed to make use of services provided by a ROM monitor, via the eCos virtual vector mechanism, then the configuration option CYGSEM_HAL_USE_ROM_MONITOR should be set. By default this option is enabled when building for a RAM startup, disabled otherwise. It can be manually disabled for a RAM startup, making the application self-contained, as a testing step before switching to ROM startup.

If the application does not rely on a ROM monitor for diagnostic services then the serial port will be claimed for HAL diagnostic output.

UART Serial Driver

The TWR-K70F120M board uses the Kinetis's internal UART serial support. The HAL diagnostic interface, used for both polled diagnostic output and GDB stub communication, is only expected to be available to be used on the UART2 port.

As well as the polled HAL diagnostic interface, there is also a CYGPKG_IO_SERIAL_FREESCALE_UART package which contains all the code necessary to support interrupt-driven operation with greater functionality. All six UARTs can be supported by this driver. Note that it is not recommended to use this driver with a port at the same time as using that port for HAL diagnostic I/O.

This driver is not active until the CYGPKG_IO_SERIAL_DEVICES configuration option (within the generic serial driver support package CYGPKG_IO_SERIAL) is enabled in the configuration. By default this will only enable support in the driver for the UART2 port (the same as the HAL diagnostic interface), but the default configuration can be modified to enable support for other serial ports.

Ethernet Driver

The TWR-SER daughterboard is fitted with an Ethernet port connected via a KSZ8041NL PHY to the TWR-K70F120M on-chip Ethernet MAC. This is supported in eCosPro with a driver contained in the package CYGPKG_DEVS_ETH_FREESCALE_ENET.

The driver will be inactive (not built and greyed out in the eCos Configuration Tool) unless the “Common Ethernet support” (CYGPKG_IO_ETH_DRIVERS) package is included in your configuration. As the Kinetis ethernet driver is likely to be used in deeply embedded, low footprint, applications it is most appropriate to choose the lwip_eth template as a starting point when choosing an eCos configuration, which will cause the necessary packages to be automatically included.

SPI Driver

A Kinetis SPI bus driver is available in the package “Freescale DSPI driver” (CYGPKG_DEVS_SPI_FREESCALE_DSPI).

No SPI devices are instantiated by default. Consult the generic SPI driver API documentation in the eCosPro Reference Manual for further details on SPI support in eCosPro, along with the configuration options in the Freescale DSPI device driver.

I²C Driver

A Kinetis I²C hardware driver is available in the package “Freescale I2C driver” (CYGPKG_DEVS_I2C_FREESCALE_I2C).

Flash Driver

The Kinetis's on-chip flash may be programmed and managed using the flash driver located in the “Kinetis FLASH memory support” (CYGPKG_DEVS_FLASH_KINETIS) package. This driver is enabled automatically if the generic “Flash device drivers” (CYGPKG_IO_FLASH) package is included in the eCos configuration.

The driver will configure itself automatically for the size and parameters of the specific Kinetis variant present on the TWR-K70F120M board.