Flash Magic to Program LPC1768 Cortex-M3

In this tutorial, we’ll learn about how to use flash magic to program LPC1768 Cortex-M3 Microcontroller. We will be using in built bootloader program to flash the ARM NXP LPC1768 microchip.The latest version of flash magic can be downloaded from www.flashmagictool.com. You can read more about flash magic on official website. Here in this article we’ll show you step-by-step procedure to get things done. As a basic, one must know that flash magic works with the ISP bootloader built into almost every LPC device from NXP, and allows us to update the flash content on your MCU via simple UART connection.

So far in this tutorial we’ll need LPC1768 microcontroller development board or compatible and FT232R Breakout Board/FTDI Cable. You simply need to connect the LPC1768 microcontroller board to breakout board as follows,

connecting-ft232rl-to-lpc1768 Board
Connecting the FT232RL to LPC1768 Board

One can use either FT232RL Breakout Board/FTDI Cable as USB to UART converter. Whichever possible for you at point in time.

Now we have almost done with hardware side connections. We assume that you have already installed flash magic on your PC/Laptop. First step we have to do is, to enter device into ISP mode. And to do that after powering LPC1768 board, you have to hold first ISP Switch (P2.10) and then press RESET after that quickly release RESET button first and then ISP Switch. Here you get your LPC1768 microcontroller into ISP Mode (which is running inbuilt (primary) bootloader).
Flash Magic to Program LPC1768 Cortex-M3
Button Press Sequence to Enter ISP Mode

Preparing Softwares & Setting: Flash Magic to Program LPC1768 Cortex-M3

Next step is to open the Flash Magic tool and configure it for LPC1768 Microcontroller.

  • Start Flash Magic if you haven’t already done so.
  • Click on ‘Select Device’ button and select the appropriate chip from popup window. In this case we have to select ARM Cortex-M –>LPC1768
Select Device/Microcontroller
  • Select Device/Microcontroller
  •  After choosing right device, we need to set the Baud rate, COM Port and Oscillator Frequency         (12.00 in the case of LPC1768 Board).
  • Check the “Erase block used by Hex File” checkbox.
  • Locate the UART.hex file created when you built your project with “Browse..” button. This is the compiled code that will be written to the flash of device.
  • Check “Verify after programming” button

The final setting should look similar to this

flash magic to program LPC1768
Flash Magic Configured for LPC1768

Configure UART Connection: You can check the UART connection and make sure that you are indeed in ISP mode by selecting the ISP–>“Read Device Signature…” menu item. If everything is properly configured, and the device is in ISP mode you should see something as below

Verify Connection by reading device signature

Flash the Device: To flash the device with .hex file, we simply need to click the start button and once flashing process is complete, you just simply RESET your device and your new firmware should start executing. You can use any precompiled hex file from previous projects from this series.

If you have any problem, you probably haven’t entered ISP mode on board (Please make sure button press sequence to initiate ISP Mode, even from datasheet if it needed), or your UART port isn’t properly configured. Double check your setting in windows device manager and in Flash Magic. Make sure you have followed through al steps. [If you’re using FT232R breakout Board or FTDI Cable then you may want to make sure you have latest FTDI drivers installed.

We hope you will find this tutorial helpful to use flash magic to program LPC1768 Cortex-M3. If you have question then write in comment section of a post. In future we’ll try to get little deeper into concept of bootloader, but we thinks this is enough for this tutorial.

Get Free Courses & Webinars
You'll receive only high quality learning material, tips & tricks
I agree to have my personal information transfered to MailChimp ( more information )
We respect your privacy

About Umesh Lokhande

Umesh Lokhande holds a Master degree in Scientific Instrumentation from University of Applied Sciences Jena, Germany. and has previously worked at Orbotech, Alere Technologies etc. Umesh is also a founder and first author of BINARYUPDATES.COM


Register | Lost your password?