Using Flash Magic Program LPC
There are two ways to program LPC chips using Flash Magic, ISP mode and
Single Wire Debug (SWD) mode. ISP mode support COM port, USB, CAN and
Ethernet. SWD support LINK2(LPC1800/lpc4300) bridge and LPC11u35 bridge.
This article use four demonstrations to show these programming methods.
1. ISP mode
1.1 UART ISP Mode Demonstration
1.2 USB ISP Mode Demonstration
2. Single Wire Debug(SWD) Mode
2.1 SWD over Link2 Bridge
2.1.1 Introduction
2.1.2 Demonstration
2.2 SWD over LPC11U35
2.2.1 Introduction
2.2.2 Demonstration
2.2.3 Recover board
Download Flash Magic tool from: https://www.flashmagictool.com/
Pay attention use the new version Flash Magic v13.10 or later.
1. ISP mode
NXP Semiconductors produce a range of Microcontrollers that feature both on-
chip Flash memory and the ability to be reprogrammed using In-System
Programming technology. Flash Magic is Windows software from the
Embedded Systems Academy that allows easy access to all the ISP features
provided by the devices. So make chip enter ISP mode, then we can use Flash
Magic program image.
This article mainly demonstrates using UART ISP mode and USB ISP mode,
CAN ISP ant Ethernet are the same.
1.1UART ISP Mode Demonstration
This section describes how to program lpc55s69 using UART, follow below
steps:
1) Connect P6 on board with PC, press the ISP button (and keep it pressed)
while reset the board(press and release RESET button). (Because the first valid
probe message on UART, I2C, SPI or USB locks in that interface, and UART is
connected to P6. ).LPC55s69 enter UART ISP mode.
2) Open Flash Magic, choose LPC55S69 from Device.
Chang…->LPC5500->UART-> LPC55S69
Click “OK”, the Serial port will show.
3) Import hex file you want to program to target from “Firmware” area, config
erase options, there are some options you can choose refer to your own
requirements.
4) Click “Start” button to program. You will see “Device signature does not
match expected value. Expected…” dialog pop up, click yes to move on.
Application can be downloaded to target Flash successfully.
1.2 USB ISP Mode Demonstration
This section describes how to program lpc55s69 using USB, follow below steps:
1) Connect High Speed USB(P9) with PC, press the ISP button (and keep it
pressed) while reset the board(press and release RESET button). LPC55s69
enter USB ISP mode.
2) Open Flash Magic, choose LPC55S69 from Device.
Chang…->LPC5500->USB-> LPC55S69
Click “OK”, “USB Bootloader” will show in Interface.
3) Import hex file you want to program to target from “Firmware” part, config
erase options, there are some options you can choose refer to your own
requirements.
4) Click “Start” button to program. You will see “Device signature does not
match expected value. Expected…” dialog pop up, click yes to move on.
Application can be downloaded to target Flash successfully.
2. Single Wire Debug(SWD) Mode
Flash Magic supports programming some NXP microcontrollers using SWD. In
order to do this, a bridge must be used. The following bridges are currently
supported.
2.1 SWD over Link2 Bridge
2.1.1 Introduction
This bridge uses the USB interface on a LPC1800 or LPC4300 to communicate
with Flash Magic and SWD to communicate with the target device (LPCxpresso
Link2 circuit design). A standalone LPC-Link2 board can also be used.
The LPC1800/LPC4300 must be configured to boot into USB DFU mode. The
NXP LPC USB driver must be installed. The option to install this is part of the
Flash Magic installer, and is optional. If you are unsure if it is installed re-run
the Flash Magic installer and select the option to install it.
Flash Magic will automatically detect the hardware, program in the bridge code
and start using it. Only one bridge can be connected to a PC at once. The bridge
appears as a USB HID device.
To use this bridge choose it from the interface drop-down list in section 1 of the
main window.
The LPC1800/LPC4300 must use a 12MHz crystal. If an LED is connected to
pin P1[1] then it will flash at 500Hz when the bridge code is executing.
The following SWD connections are used:
2.1.2 Demonstration
This section describes how to program lpc54628 using SWD. NXP
LPCxpresso54628 board have integrated Link2 bridge(lpc4322), follow below
steps:
1) Install jumper JP5(DFU LINK) to force DUF mode, connect Debug Link
interface(J8) with PC.
2) Open Flash Magic, choose LPC54628J512 from Device.
Chang…->LPC54000->SWD->LPC54628J512
Click “OK”, Interface will show the SWD over Link2 (Flash Magic detect the
hardware Interface), if no, please check and reconnect your board.
3) Import hex file you want to program to target from “Firmware” part, config
erase options, there are some options you can choose refer to your own
requirements.
4) Click “Start” button to program.
2.2 SWD over LPC11U35
2.2.1 Introduction
This bridge uses the USB interface on a LPC11U30 to communicate with Flash
Magic and SWD to communicate with the target device.
Before using this interface the LPC11U30 must be programmed with the bridge
code. The easiest way to do that is using the mass-storage USB mode. The
binary file can be found in the Interfaces subfolder in the Flash Magic
installation.
Once programmed and running Flash Magic will automatically detect the
hardware and start using it. Only one bridge can be connected to a PC at once.
The bridge appears as a USB HID device.
To use this bridge choose it from the interface drop-down list in section 1 of the
main window.
The LPC11U20/30 must use a 12MHz crystal. If an LED is connected to pin
P0_20 then it will flash at 500Hz when the bridge code is executing.
The following SWD connections are used:
2.2.2 Demonstration
This section describes how to program lpc845 using SWD. NXP
LPCxpresso845MAX board have integrated LPC11u35 bridge, follow below
steps:
1) Install jumper JP3 to force mass-storage USB mode, connect Debug Link
interface(J4) with PC.
2) “CRP DISABLD” shows in PC, delete the “firmware.bin” inside it,
and drag “SWDLPC11U35.bin”(under path Flash Magic\Interfaces ) into it.
3) Remove jumper on JP3, reconnect board(J4) with PC.
4) Open Flash Magic, choose LPC845M301JBD48 from Device.
Chang…->LPC8000->SWD-> LPC845M301JBD48
Click “OK”, Interface will show the SWD over LPC11u35 (Flash Magic detect
the hardware Interface), if no, please check and reconnect your board.
5) Click “Start” button to program.
2.2.3 Recover board
After the steps in 2.2.2( change the firmware in LPC11u35), it can’t be debug
using IDE, if you want to debug, need recover firmware. Download firmware
from NXP websites:
https://www.nxp.com/webapp/sps/download/preDownload.jsp
About changing firmware steps, please refer to steps1)-3) in section 2.2.2.
3. Reference
<Flash Magic Manual>