![]() |
LPCOpen Platform
v1.03
LPCOpen Platform for NXP LPC Microcontrollers
|
The procedure here explains how to start Keil UV4 multi-projects for a supported LPCOpen platform, configure the projects, build and deploy the projects, and then debug them.
The example below shows the steps for the LPC1788 device on the Embedded Artists LPC1788 platform, but the same procedure applies to all platforms.
Starting a multi-project view
Multiple examples are organized into multi-projects groups for UV4. To select a project group, double-click the appropriate multi-project file in the Keil examples directory for the chip you want to use. Once a multi-project file is started, all the examples associated with that project will be shown in the Project view.
For example, if you want to build examples for the Embedded Artists LPC1788 platform, you'll need to go to the "lpcopen/applications/lpc17xx_40xx/keil_uvision_projects" directory and then select one of the multi-project files there.
Selecting and building the board library for the examples
All examples depend on a board library. Before building an actual example, this library needs to be built. Right-click on the lib_lpc_boards_chip project (where chip is the device family you are using) in the project view and select "Set as active project". In the target selection drop-down box, select the platform the library should be built for.
Then select "Build" from the project menu to build the library. This only needs to be performed once unless any code related to the board files has been changed.
In the example below, the lpc17xx_40xx library for the Embedded Artists LPC1788 board is selected.
Selecting and building other libraries
Some examples require other libraries to be built prior to using them. For example, the USBLIB examples require the appropriate USB libraries to be built before the examples can be built. These libraries are built using the same approach as the board library - right click the project, select the board or device the library should be built for, and then selecting "Build" from the project menu. The image below shows the LPC178x_8x USBLIB device library selected. You may need to select and build mutiple USBLIB libraries for an example using the same project, but with different configurations.
In the example below, the 17xx/40xx USBLIB library is selected and one of a number of possible USBLIB library builds can be performed by selecting the configuration and then building it. You can build all the libraries for the USBLIB project by selecting and building all configurations.
Changing the default optimization level
All library and application projects for Keil are configured to build at full optimization. This setting is (Level 3 (-O3)). Using this level of optimization typically makes the code harder to debug, but gives the best possible code size and performance. You can change the optimization settings by opening the project options by right-clicking on the project in the project browser window and selecting Options. Then select the C/C++ tab and select the optimization level you want for your build images. Using an optimization level of (Level 0 (-O0)) will give a better debug experience, but a larger image.
Selecting and building an example
To select an example to build, right-click on it and select "Set as active
project". In the target selection drop-down box, select the board the example should be built for.
Then select "Build" from the project menu to build the example.
The image below shows the LPCUSBLIB AudioOutputDevice example selected with the Embedded Artists LPC1788 board (iflash_ea_devkit_1788) selected as the build target.
Programming the example into the board
To program the example into the board, select "Download" from the FLASH menu. The image will be programmed into the board.
Debugging the example
Once the image has been programmed into the board, select "Start/Stop debug session" from the debug menu to start the debug session. The debugger will attach to the board and stop at the start of the code. You can use the step, run, stop, and breakpoints selections on the debug menu to control run operation.