Flash Magic Programming LPC
Flash Magic Programming 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
Pay attention use the new version Flash Magic v13.10 or later.
1. ISP mode
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.
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.
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.
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.
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.
2.1.2 Demonstration
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.
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.
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>