Introduction - Segger J-Link User Manual

Hide thumbs Also See for J-Link:
Table of Contents

Advertisement

216
7.1

Introduction

The J-Link DLL supports a feature called flash breakpoints which allows the user to set
an unlimited number of breakpoints in flash memory rather than only being able to use
the hardware breakpoints of the device. Usually when using hardware breakpoints only, a
maximum of 2 (ARM 7/9/11) to 8 (Cortex-A/R) breakpoints can be set. The flash memory
can be the internal flash memory of a supported microcontroller or external CFI-compliant
flash memory. In the following sections the setup for different debuggers for use of the
flash breakpoints feature is explained.
How do breakpoints work?
There are basically 2 types of breakpoints in a computer system: Hardware breakpoints and
software breakpoints. Hardware breakpoints require a dedicated hardware unit for every
breakpoint. In other words, the hardware dictates how many hardware breakpoints can be
set simultaneously. ARM 7/9 cores have 2 breakpoint units (called "watchpoint units" in
ARM's documentation), allowing 2 hardware breakpoints to be set. Hardware breakpoints do
not require modification of the program code. Software breakpoints are different: The de-
bugger modifies the program and replaces the breakpointed instruction with a special val-
ue. Additional software breakpoints do not require additional hardware units in the proces-
sor, since simply more instructions are replaced. This is a standard procedure that most
debuggers are capable of, however, this usually requires the program to be located in RAM.
What is special about software breakpoints in flash?
Flash breakpoints allows setting an unlimited number of breakpoints even if the user ap-
plication is not located in RAM. On modern microcontrollers this is the standard scenario
because on most microcontrollers the internal RAM is not big enough to hold the complete
application. When replacing instructions in flash memory this requires re-programming of
the flash which takes much more time than simply replacing a instruction when debugging
in RAM. The J-Link flash breakpoints feature is highly optimized for fast flash programming
speed and in combination with the instruction set simulation only re-programs flash that
is absolutely necessary. This makes debugging in flash using flash breakpoints almost as
flawless as debugging in RAM.
What performance can I expect?
Flash algorithm, specially designed for this purpose, sets and clears flash breakpoints ex-
tremely fast; on microcontrollers with fast flash the difference between software break-
points in RAM and flash is hardly noticeable.
How is this performance achieved?
We have put a lot of effort in making flash breakpoints really usable and convenient. Flash
sectors are programmed only when necessary; this is usually the moment execution of
the target program is started. A lot of times, more than one breakpoint is located in the
same flash sector, which allows programming multiple breakpoints by programming just
a single sector. The contents of program memory are cached, avoiding time consuming
reading of the flash sectors. A smart combination of software and hardware breakpoints
allows us to use hardware breakpoints a lot of times, especially when the debugger is source
level-stepping, avoiding re-programming the flash in these situations. A built-in instruction
set simulator further reduces the number of flash operations which need to be performed.
This minimizes delays for the user, while maximizing the life time of the flash. All resources
of the ARM microcontroller are available to the application program, no memory is lost for
debugging.
J-Link / J-Trace (UM08001)
CHAPTER 7
© 2004-2017 SEGGER Microcontroller GmbH & Co. KG
Introduction

Advertisement

Table of Contents

Troubleshooting

loading
Need help?

Need help?

Do you have a question about the J-Link and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

J-trace

Table of Contents

Save PDF