| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
LPCOpen Board (platform) layer

Board layer code
The Board layer provides the board level code for a platform. Board level code consists of early system initialization, debug I/O routing, LED support, and various board level setup functions needed for the various examples.

Common board layer code
The "<LPCOPEN_PATH>\software\lpc_core\lpc_board\board_common" directory contains shared code, such as NOR or NAND drivers or ethernet PHY drivers, that are used on multiple boards and are considered board neutral.

Board early system initialization
The board early system initialization code setups up the initial device clocking, board specific pin muxing, external memory (if available), initializes the FPU (if available), and sets the base address for the vector table. All of this is handled via a single call to SystemInit() from the startup code prior to initialization of the data segments (pre-initialized data and cleared data).

The sys_config.h platform file (Adding platform definitions using sys_config.h) is also usually located with the board files.

Care has been taken with the code in the SystemInit() function to avoid using non-stack data, as the data segments haven't been initialized yet when this function has been called.

The board.h file
The board.h file is a single include file that includes all the necessary Chip and board layer drivers for the system. For most examples, only the board.h file needs to be included.

Including board.h requires that the necessary Chip include path for the device family, the IP include path, and the board include path are in the tool's inclusion list.
Example:
To include board.h for the Embedded Artists LPC1788 and LPC4088 boards, the compiler must have at least the following include paths in it's inclusion list.

- "<LPCOPEN_PATH>\software\CMSIS\CMSIS\Include"
- "<LPCOPEN_PATH>\software\lpc_core\lpc_ip"
- "<LPCOPEN_PATH>\software\lpc_core\lpc_chip\chip_common"
- "<LPCOPEN_PATH>\software\lpc_core\lpc_chip\chip_17xx_40xx"
- "<LPCOPEN_PATH>\software\lpc_core\lpc_board\board_common"
- "<LPCOPEN_PATH>\software\lpc_core\lpc_board\\boards_17xx_40xx\ea_devkit_17884088"
  And one of the two following directories (not applicable to all boards):
- "<LPCOPEN_PATH>\software\lpc_core\lpc_board\\boards_17xx_40xx\ea_devkit_17884088\ea_devkit_1788" (EA1788 board)
- "<LPCOPEN_PATH>\software\lpc_core\lpc_board\\boards_17xx_40xx\ea_devkit_17884088\ea_devkit_4088" (EA4088 board)

In some cases, the same board level code is used for multiple boards, but with different mounted chips. Since the board code is the same for both boards, the sys_config.h file is usually placed in a sub-directory unique for that board that also must be in the compiler inclusion list.
Example that includes sys_config.h for the Embedded Artists LPC1788 board:

- "<LPCOPEN_PATH>\software\lpc_core\lpc_board\\boards_17xx_40xx\ea_devkit_17884088\ea_devkit_1788"
  Example that includes sys_config.h for the Embedded Artists LPC4088 board:
- "<LPCOPEN_PATH>\software\lpc_core\lpc_board\\boards_17xx_40xx\ea_devkit_17884088\ea_devkit_4088"