Skip to content
Use a LPC2148 module as a JTAG probe and connect it to GDB via remote protocol over USB Serial.
C C++
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lpcusb/target
ARM.h
ArmSingleStep.cpp
ArmSingleStep.h
FlashDriver.h first commit Apr 18, 2011
HexConversion.cpp
HexConversion.h
JTAG_arm.cpp
JTAG_arm.h
JTAG_arm7tdmi.cpp
JTAG_arm7tdmi.h
JTAG_arm9tdmi.cpp
JTAG_arm9tdmi.h
JTAG_bf533.cpp
JTAG_bf533.h
LPC214x.h
LPCFlash.cpp
LPCFlash.h
Makefile
README Moved some of the 'documentation' to the README Apr 18, 2011
Serial.h
Serial1.cpp
Spec.txt
TargetManager.cpp
TargetManager.h
Timer.cpp
Timer.h
USBSerialStream.cpp
USBSerialStream.h
WatchPointManager.cpp
WatchPointManager.h
blackfin.h
config.h
cppreq.cpp
crt0.s
debug_out.cpp
debug_out.h
fifo.h first commit Apr 18, 2011
fifotest.cpp
gdbparser.cpp
gdbparser.h
jtag.cpp
jtag.h
jtag_asm.h
jtag_asm.s
jtag_backup.cpp
jtag_sync.cpp
ld.ld
ld1.ld first commit Apr 18, 2011
ld1_RAM.ld
main.cpp
stream.h
syscalls.c
target.h
uartStream.cpp
uartStream.h

README

LPCGDB

Introduction

This project was created as a means to enable fast, cheap and robust debugging of
embedded targets such as ARM, BlackFin and others.
By using a LPC214x chip alot of necessary functionality is already there, such as
USB, UART and a bunch of I/O pins.
The idea is that someone should be able to just buy 2 LPC prototype boards and use
one of them to debug the other via USB and gdb. (Also using MXDB)


Features

JTAG
	ARM7 (r4 atleast)
	ARM920T
	BF533

FLASH Programming:
	LPC21x using ISP/IAP?


GDB remote protocol.
Extended remote protocol. (A binary protocol for faster data rates, used by MXDB)





LPC2138 board pins:

J3:
19: RTCK
20: TDO
21: TDI
22: TCK
23: TMS
24: TRST
27: GND

10pin   20pin
1 VCC   1 VCC
2 nTRST 3 nTRST
3 TDI   5 TDI
4 TMS   7 TMS
5 TCK   9 TCK
6 TDO   13 TDO
7 nRST  15 nRST
8 GND   Even pins GND
9 GND   Even pins GND
10 GND  Even pins GND



Example how to load and run something on the gp2x:

(gdb) file <myelf.elf>
(gdb) set debug remote 1
(gdb) target remote /dev/ttyACM0
CTRL-C
(gdb) monitor mmuoff
(gdb) monitor ll@0x100
(gdb) load
(gdb) c


Exmplanation of the "monitor" command.
It sends a command to the GDB stub as a string.
Commands implemented are: "ll", "mmuoff", "mmuon", "id", "targets", "flash", "lpcfreq"

"ll" Loads a small binary into the target RAM at the specified address, and then starts the core at that address.
The small program can read/write target memory communicate through a special debug register that can be read/written from JTAG while the processor is running.
Makes reading/writing memory alot faster.
It's important that the mmu is either off, or that you really know what you're doing regarding virtual addresses and cache.
Also that you don't overwrite the "ll" program with your binary.

"mmuoff" makes sure the MMU is turned off.

"mmuon" Does nothing useful atm.

"id" returns the idcode to GDB

"targets" returns the supported targets.

"flash" instantiates a flash driver, only lpc supported atm.

"lpcfreq" is used by the lpc flash driver internally, it's the lpc's crystal frequency in kHz (iirc)

Something went wrong with that request. Please try again.