Setting up an IDE environment

There are many ways how to start with LPCXpresso development boards. For example you can use a simple LED blinking code with FreeRTOS operating system (follow chapter 4 and 5 of PLCXpresso V7 User Guide). There is also an option to use a semihosted project and print messages in the debug environment (use first part in Hello World example).

We decided to test LED blinking as simple as possible – without an OS. This is also the way which the microcontroller will be used in an actual OpenRex board. To setup the default environment follow these steps:

1. Go to LPCXpresso download page and select installer of IDE Development Tool for your operating system

Preparing a binary file

Now we are going to generate an output binary which will be then sent into the microcontroller. At this point we have setup PLCXpresso software or opened it from the last time. Here are the steps you need to follow to prepare binary output:

1. Be sure we have opened library project for your microcontroller – for LPC1347 open CMSIS_CORE_LPC13Uxx project, for other chip from LPC13xx family apart from LPC1347, use CMSIS_CORE_LPC13xx project instead.
Follow this step if you haven’t done it yet.

2. Open an existing project (You can use this project as a starting point)

Go to Quickstart Panel (located on the bottom left corner) and click on Import project(s)

Now your new binary should be running on the NXP. We tested it with a simple blink program.

Programming procedure on OpenRex board

The programming process is very similar as we use for iMX6 Rex. The main difference with on-board MCU is that we don’t need to use any cables. ISP and Reset signal will be controlled directly by CPU. To simplify the process we created a simple shell script:

Done! The RED LED close to the Power jack should start blinking in approximately 1s interval.

Appendix – How to compile LPC13xx compiler (toolchain) for ARM

To be able to compile source codes for LPC13xx directly on OpenRex, you will need “gcc-arm-none-eabi” compiled for ARM. You can download the one I have compiled here (and follow the steps here), or you can try to compile it by yourself. Important! It takes a long time (over 10 hours) to compile the gcc-arm-none-eabi on OpenRex. It is recommended to use a SATA drive.

4) Unpack it

5) Prepare to build prerequisites

Now, this is the tricky part. In case you start building the prerequisites, you will notice a lot of errors. To go around it, we will download the latest versions of the problematic packages and replace them in the src directory. It’s not the correct way to do it, but it is quick, simple and it does the job: