Go Back

LPCXpresso Support Added to LPC1343 Code Base

Friday, March 23, 2012
Debugging the LPC1343 Code Base in LPCXpresso

I've never been a huge fan of Eclipse, but since it's incredibly hard to argue with the price of LPCXpresso development boards with their removable SWD debuggers, basic support for flashing devices and debugging (size permitting) has just been added to the LPC1343 Code Base.  Since the code base isn't based on CMSIS, and still runs from a Makefile, the process of creating a project and selecting debug or release mode is a bit different, but we've put together a fairly straight-forward tutorial on it here: Debugging the LPC1343 Code Base in LPCXpresso.  Hopefully this will open the code base up to a few more people.

You will need to pull the latest version of the LPC1343 Code Base from Github to take advantage of LPCXpresso support, since the project files need to be more thoroughly tested before an official release.  A final v1.0.0 release of the LPC1343 Code Base is right around the corner, though, wrapping up about 2 years of constant development effort on this library.

Note: Project files also exist for Rowley Associate's Crossworks for ARM, and the fully cross-platform and open-source CodeLite IDE, both of which are found in the /build folder.  A very alpha DLL for CodeLite is also included in /tools, allowing you to program the flash and do step-through debugging via GDB Server with the Segger J-Link, but it's far from ready to see the light of day just yet.

Update 24-Mar-2012: LPCXpresso support has also been added to the LPC1114 Code Base as of v0.7.5.

Full story  | Comments (1)

Creating Valid LPC1343 Binaries in LPCXpresso

Tuesday, January 12, 2010

The LPC1343 includes a wonderfully easy to use USB bootloader that will cause your board to enumerate as a 32KB mass storage device.  All you have to do to update the firmware is delete to old binary file, paste a new one in, and reset the device.  Unfortunately, there's a bug in the current version of the LPCXpresso IDE that inserts the wrong checksum in the binary file, meaning that it will be rejected and you'll automatically go into the bootloader or ISP mode after reset since the contents of the internal flash has been deleted.  While Code Red/NXP has provided a command-line tool to fix this (as of version 3.1), it's awfully annoying to have to go into the command-line every time.  Thankfully, it's easy to add a post-build step to create a binary file and update the checksum to a valid value.  All you have to do is follow these three simple steps:

  1. Right-click on your project in the Project Explorer, and select the Properties menu item.
  2. In C/C++ Build select Settings and switch to the Build Steps tab.
  3. In the Post-build steps group box, change the Command text to the following:

    arm-none-eabi-size ${BuildArtifactFileName}; arm-none-eabi-objcopy -O binary ${BuildArtifactFileName} ${BuildArtifactFileBaseName}.bin; checksum ${BuildArtifactFileBaseName}.bin;

The screen should look something like this:

LPCXpresso Post-Build Steps

Now every time you build your project, a binary file will automatically be created, and the checksum utility will be executed.  All you have to do is copy the .bin file to the board with the USB bootloader.

Full story  | Comments (1)

Electronic & Embedded Fundamentals

These articles are part of our regularly updated Fundamentals series and may be useful if you're new to electronics or embedded development: