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)

Building Intel Hex Files with LPCXpresso

Wednesday, December 16, 2009

We've been trying to test out the new LPCXpresso IDE (essentially a free, 128KB-limited version of Code Red's Red Suite) and our own LPC1114 Reference Design, but since we haven't yet set up a 32-bit development environment to be able to make use of the LPC-Link built into the LPCXpresso boards (there are no 64-bit drivers available yet) we were just going to fallback to good old-fashion FlashMagic, and upload the compiled hex files via ISP.  Unfortunately, that meant that we needed a good old-fashion Intel hex file as well!

While LPCXpresso can generate Intel hex files, you need to make a small adjustment to the project settings to do so:

  1. Right-click on your project in the Project Explorer window, and select Properties from the pop-up menu.
  2. Expand C/C++ Build on the left-hand side of the Properties dialogue, and select Settings.
  3. In Settings, switch to the Build Steps tab, and you should see a screen similar to the this:
    Configuring LPCXpresso to build Intel hex files
  4. The post-build command to generate an Intel hex file is already present (at least in v3.1 of LPCXpresso), but it is commented out.  You need to replace the text in Post-build steps / Command as follows:
Original Text
arm-none-eabi-size ${BuildArtifactFileName}; # arm-none-eabi-objcopy -O ihex ${BuildArtifactFileName} ${BuildArtifactFileBaseName}.hex ;
Replacement Text
arm-none-eabi-size ${BuildArtifactFileName}; arm-none-eabi-objcopy -O ihex ${BuildArtifactFileName} ${BuildArtifactFileBaseName}.hex ;

After that, build your project as normal and a .hex file should also be generated in the build folder (for example, /Debug). Please note that you will need to make the same change to both the Debug and Release configurations if you wish to generate Intel hex files for both build types.

For more information on configuring the build output for Code Red, you might want to have a look at Generating srec (Motorola S format), binary, ihex (Intel Hex) files on the Code Red wiki.

Full story  | Comments (20)