Creating Valid LPC1343 Binaries in LPCXpresso

Posted by:  |  Tuesday, January 12, 2010

Go Back

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.

  • Facebook
  • DZone It!
  • Digg It!
  • StumbleUpon
  • Technorati
  • Del.icio.us
  • NewsVine
  • Reddit
  • Blinklist
  • Furl it!

Comments  (1)

  • Felipe

    9/11/2011 12:00:00 AM

    Hi!
    I wonder how I can do it for the eclipse.
    when using:
    arm-none-eabi-size ${BuildArtifactFileName}; arm-none-eabi-objcopy -O binary ${BuildArtifactFileName} ${BuildArtifactFileBaseName}.bin; checksum ${BuildArtifactFileBaseName}.bin;

    he accuses the following error:
    /usr/bin/sh: checksum: command not found
    cs-make[1]: [post-build] Error 127 (ignored)

    Thanks!
Add a comment!
  1. Formatting options