Using the command line flash programming tool
With Red Suite 3, Red Suite 4 and LPCXpresso, you can program the flash using a command line utility.
Running the flash programming utility
Note: If using the LPCXpresso debug probe, LPC-Link, see Booting LPC-Link.
Run the flash programming utility with the following options
flash_utility wire -ptarget -vendor=vendor -flash-load[-exec]=filename [-load-base=base_address]
- Where:
flash_utility is one of:
- crt_emu_lpc11_13 (for LPC11xx, LPC12xx or LPC13xx parts)
- crt_emu_cm3_nxp (for LPC17xx parts)
- crt_emu_lpc18_43_nxp (for LPC18/43 parts)
- crt_emu_a7_nxp (for LPC21/22/23/24 parts)
- crt_emu_a9_nxp (for LPC31/32 and LPC29xx parts)
- crt_emu_cm3_lmi (for TI Stellaris LM3S parts)
- crt_emu_cm3_stm32f1 (for STM32F1 parts)
- crt_emu_cm3_stm32f2 (for STM32F2 parts)
- crt_emu_cm3_gen for all other parts
wire is one of:
- (empty) (for Red Probe+, Red Probe, RDB1768v1, or TI Stellaris evaluation boards)
- -wire=hid (for RDB1768v2 without upgraded firmware)
-wire=winusb (for RDB1768v2 with upgraded firmware)
- -wire=winusb (for LPC-Link on Windows XP and Linux)
- -wire=hid (for LPC-Link on Windows Vista or Windows 7)
target is the target chip name. For example LPC1343, LPC1114/301, LPC1768 etc.
vendor is the MCU vendor, for example NXP, STM etc
filename is the file to flash program. It may be an executable (axf) or a binary (bin) file. If using a binary file, the base_address must be specified.
base_address is the base load address when flash programming a binary file. It should be specified as a hex value with a leading 0x.
Note:
-flash-load will leave the processor in a stopped state
-flash-load-exec will start execution of application as soon as download has completed.
Booting LPC-Link
If using LPC-Link (the NXP LPCXpresso evaluation board debug probe) as your debug connection, first of all boot the LPC-Link
Under Windows, use the script
bin\Scripts\bootLPCXpresso type
where type = winusb for Windows XP, or type = hid for Windows Vista / 7.
Under Linux open a Terminal, cd <install_dir>/bin, and run
- dfu-util -d 0x471:0xdf55 -c 0 -t 2048 -R -D LPCXpressoWIN.enc
Examples
To load the executable file app.axf and start it executing on an LPC1758 target using Red Probe, use the following command line:
crt_emu_cm3_nxp -pLPC1758 -flash-load-exec=app.axf
To load the binary file binary.bin to address 0x1000 to an LPC1343 target using LPC-Link on Windows XP or Linux, use the following command line:
crt_emu_lpc11_13_nxp -wire=hid -pLPC1343 -flash-load=binary.bin -load-base=0x1000
To load the executable file app.axf and start executing on a TI LM3S811 target, using Red Probe, Red Probe+, or TI ICDI, use the following command line:
crt_emu_cm3_lmi -pLM3S811 -flash-load-exec=app.axf
