Getting Started LPCOpen Ethernet Examples
Getting Started LPCOpen Ethernet Examples
The steps described in the document were done using the LPC1769 MCU like the one in the LPCXpresso
board for LPC1769 with CMSIS DAP probe, but the same principles are applicable to any LPC MCU.
Software versions
The steps described in this document are valid for the following versions of the software tools:
o LPCXpresso v8.1.4
o LPCOpen v2.xx
Boards
o LPCXpresso board for LPC1769 with CMSIS DAP probe
o EA LPCXpresso BaseBoard
o LPC-Link2
Contents
1. Overview and concepts .............................................................................................................................................3
1.1 LPCOpen .......................................................................................................................................................3
1.1.1 Core driver library ........................................................................................................................................3
1.1.2 Middleware ..................................................................................................................................................3
1.1.3 Examples ......................................................................................................................................................3
1.1.4 LPCOpen with an RTOS ................................................................................................................................3
2. Running the lwip_tcpecho and webserver demo applications ..................................................................................4
2.1 Downloading a LPCOpen package .......................................................................................................................4
2.3 Setting up the hardware......................................................................................................................................6
2.3.1 LPCXpresso board for LPC1769 with CMSIS DAP probe ...............................................................................6
2.3.2 EA LPCXpresso BaseBoard............................................................................................................................7
2.2 Importing the LPCOpen examples .......................................................................................................................9
2.4 Building the demo applications .........................................................................................................................12
2.5 Running the demo applications.........................................................................................................................15
2.5.1 lwip_tcpecho_sa demo ..............................................................................................................................15
2.5.2 webserver demo ........................................................................................................................................21
Appendix A - References..............................................................................................................................................26
Getting started with the LPCOpen Ethernet Examples
2 NXP Semiconductor
1. Overview and concepts
1.1 LPCOpen
LPCOpen is an extensive collection of free software libraries (drivers and middleware) and example
programs that enable developers to create multifunctional products based on LPC microcontrollers.
Access to LPCOpen is free to all LPC developers.
1.1.2 Middleware
LPCOpen includes access to key middleware elements:
1.1.3 Examples
LPCOpen includes an extensive set of examples designed to illustrate how to use core driver library
functions and middleware. Examples demonstrate use of:
- The LPCOpen packages can be found on the LPCXpresso installation folder, just make sure the
package to be used is the latest one available:
C:\nxp\LPCXpresso_8.1.4_606\lpcxpresso\Examples\LPCOpen
- On the next page you will find the latest available LPCOpen software package downloads along
with older versions of the packages. Look for your board/device and click on the software
download link, for this example we chose the package for the LPCXpresso IDE but there is also a
package for the IAR and Keil IDEs:
Based on the readme information on the examples, the LPCXpresso LPC1769 board needs to be connected
with base board in order to use the RS232/UART and Ethernet ports. These are the connections and
configurations needed for the boards to work correctly.
- There is a known issue with the LPCXpresso1769/CD board rev D (rev D1 boards are not affected).
Debugging works when the LPCXpresso1769/CD board is standalone but stops working when
mounted on a base board, it also causes that a "CRP DISABLD" USB drive appears on the PC instead
of the debug interface. This happens because the debug MCU (LPC11U35) will start-up in ISP mode
if an external reset signal is low during power-up. This is a typical situation if there is a reset
generator on the base board. So the workaround is to remove R57 on the LPCXpresso1769/CD
board. This will disconnect the ISP enable signal on the LPC11U35 from the external reset signal.
- Since the LPC1769 board will be powered by the baseboard the LPC-Link2 board will be used to
program and debug the demo applications. In order to use an external debugger to program the
LPC1769 MCU, the JP3 connector needs to be shorted to disable the CMSIS-DAP interface and
allow an external debugger to be connected.
- The main power source will be used to power the system and will also be used as USB-to-UART
interface:
- The LPC1769 UART can be connected to one of three different peripherals in the EA LPCXpresso
BaseBoard, for this example we will use the USB-to-UART Bridge (U22) which is the default mode,
all the three jumpers in J7 need to be inserted:
- The Import project(s) wizard will open. There are two ways to import projects, import projects
contained in archives or unpacked projects, for this example chose the Project archive (zip) option
and click on Browse:
- After importing the projects to the workspace these can be closed to avoid having all of them
opened in the workspace. Then we can open only the lwip_tcpecho and webserver demos. Right
click on the projects and click on Open:
- A pop-up window will appear asking if the referenced projects should also be opened, click on
Yes, you should see the projects opened along with the M4 chip and board libraries:
Both of the demos require the board and laptop to be connected to a router since the board will acquire
an IP address via DHCP.
- After this a new message will show up, indicating that 2 SWD devices were found, select the
Cortex-M4 device which is the one used by the example:
- A new window will show up and it will display the connected emulators, select the LPC-LINK2
CMSIS-DAP emulator and click on OK:
- You should now be able to debug the program and step through the code:
- LPCOpen webpage:
http://www.nxp.com/lpcopen
- LPCXpresso webpage:
http://www.nxp.com/lpcxpresso
- EA LPCXpresso BaseBoard:
http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/lpc-cortex-m-
mcus/lpc-cortex-m0-plus-m0/lpc800-low-cost-cortex-m0-plus/ea-lpcxpresso-baseboard:OM11083
- LPC-Link2:
http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/lpc-cortex-m-
mcus/lpc-cortex-m0-plus-m0/lpc800-low-cost-cortex-m0-plus/ea-lpcxpresso-baseboard:OM11083