Installing eLua on the LPC2468 CPU from NXP

The LPC2468 CPU from NXP is one of the CPUs on which eLua is very happy to run, because of its very generous resources: 512k of Flash and 96k of SRAM on-chip memory, loads of peripherals, up to 72MHz operating frequency, external memory bus and other goodies. eLua is so happy with this chip, in fact, that a board designed specifically for eLua was built around it. You can find the full specifications of the board here. This is the board that we're going to use in this tutorial.

Prerequisites

Before you'll be able to use eLua on the LPC2468 CPU, make sure that:

Burning eLua to the LPC2468 using the Flash Magic software

Before actually downloading the eLua image to the CPU, the board must be configured for proper USB operation (note that this should be done only once, not everytime you need to program a new eLua image). The steps for this procedure are listed below:

  1. make sure that jumper JP1 on the board is set to position "USB" (2-3) if you want to power your board from the USB bus.
  2. connect your board to the PC using an USB cable.
  3. if needed, install the FTDI drivers you downloaded earlier.
  4. once the drivers are properly installed, start the FTDI FT_PROG software downloaded earlier and choose "Devices", "Scan and Parse". If everything is OK, your device should show up in the left part of the FT_PROG window, under "Device Tree".
  5. in "Device Tree", select "USB_Config_Descriptor", then enter "500" in the "Max Bus Power" field in the upper right part of the FT_PROG window. It should look like below: FT_PROG power settings
  6. (optional) now it's a good time to give your eLua board a good description :) In "Device Tree", select "USB_String_Descriptors", then enter "eluaproject.net" in the "Manufacturer" field in the upper right part of the FT_PROG window, and "eLua demo board" in the "Product Description" field. It should look like below: FT_PROG strings
  7. choose "Devices", "Program". The new settings will be written to the FTDI chip internal memory, and the board will automatically re-enumerate.

Once your board is properly configured (remember, you only need to do this ONCE!), follow the next steps to program your eLua image to the board as many times as you need to:

  1. make sure that jumper JP1 on the board is set to position "USB" (2-3) if you want to power your board from the USB bus.
  2. make sure that JP2 (ISP), JP3 (RST), JP6 (RDX0) and JP7 (TDX0) are connected on the board.
  3. connect the board to the PC using an USB cable.
  4. find the serial port used by the board. Open "Device Manager" in Windows, go to "Ports (COM & LPT)" and look for a serial port named "USB serial port" or something similar. If unsure, simply unplug the board. The serial port that disappears from the list after unplugging the board is your board's serial port.
  5. start Flash Magic and click on "Select Device" under "Step 1 - Communications". In the "Device Database" window that appears, select "ARM7" and then double click on "LPC2468" (NOT "LPC2468 Ethernet").
  6. select the COM port from step 4 in "COM Port", set the baud rate to 230400, "Interface" to "None (ISP)", and "Oscillator (MHZ)" to 12.
  7. under "Step 2 - Erase", select "Erase blocks used by Hex File".
  8. under "Step 3 - Hex File", select your LPC2468 eLua hex file.
  9. (optional) under "Step 4 - Options", select "Verify after programming" if you want to verify your downloaded image.

After all the steps above, the Flash Magic windows should look similar to the image below (my LPC2468 serial port is COM14):

Flash Magic Settings

All that's left to do is hit the "Start" button, and wait (the whole process takes a while). When it's finished, close Flash Magic and remove the JP2 (ISP) and JP3 (RST) jumpers from the board, then reset it.

That's it! You now have eLua programmed on your board, so you can start your terminal emulator and enjoy it, as described in using eLua.