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,
One can use either FT232RL Breakout Board/FTDI Cable as USB to UART converter. Whichever possible for you at point in time.
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
- 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
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
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.