Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: JTAG commands are secret?

2005-11-04 by Eric Engler

--- In lpc2000@yahoogroups.com, <piotr.zbysinski@e...> wrote:
>
> Few weeks ago I asked here (but not only here, in Philips Technical
Support 
> too) about JTAG commands used for Flash memory programming in LPC2K
devices. 
> In fact, nobody has given me complete answer.

To program flash you first need to write some code that you download
to RAM, and then you execute your program from RAM and that will
program the flash.

Several years ago many people used the Angel monitor for this
function. This is a bootloader that also has debug commands (Angel
Debug Protocol) that make it easy to interface to gdb and other
debuggers. Angel was only a serial monitor, which limited its ability
to fully control the embedded chip. You can still find Angel source
code on the web if you look for it. I found it at the Atmel site. You
can learn a lot about the ARM Embedded ICE module by studying that
source code.

Speaking of Embedded ICE, this is the internal module in all ARM7TDMI
chips that provides low-level debugger support. This is the module
that interacts with the JTAG port. Angel used to be the common way to
get at the internals, but today the world has moved to JTAG debugging
instead. JTAG is a faster interface and it doesn't have the
limitations of a serial interface.

Embedded ICE used to be called ICE Breaker. Sometimes you'll see
references to ICE Breaker on the web - this is the same thing.

Since the JTAG is a hardware interface, it can be difficult to work
with from the PC side. So, the Remote Debug Interface (RDI) was
developed to provide a standard interface for software running under
Windows. The best known implementation of RDI is Segger's J-link DLL.
Sadly, this is not an open standard. The j-link Server is a free
program (free, but not open source) that provides a convenient TCP/IP
interface that allows a Windows program to execute RDI commands. gdb
uses this j-link server.

JTAG is the best debugging interface, but its not a good option for
production-ready circuit boards because companies don't want to have a
20 pin port on production boards. So most companies provide a form of
In System Programming (ISP) that is implemented by a small bootloader
program. This bootloader program checks the state of some pins every
time the ARM chip boots, and if it finds the levels its looking for,
it takes control and watches a serial port for commands. This is
similar in concept to Angel, but it does not implement debugging
commands - it only provides flash programming functionality.

I think all the major ARM7TDMI makers have this kind of bootloader,
but this is always implemented differently so its hard to have one
program that can program the flash of any ARM chip. Instead, you
normally need a different program for each chip maker. Most of the
chip makers will provide the details of their serial bootloader if you
contact their tech support people. The Philips bootloader is well
understood and the open source lpc21isp program supports this bootloader.

Atmels new SAM-BA bootloader is pretty new and I don't know of any
open source programs yet, but Atmel has provided the source code for
it so its only a matter of time until open source programs appear for
it. The nice thing about SAM-BA is that it works with both serial
ports and USB ports!

Eric

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.