Introduction - Segger J-Link User Manual

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

Advertisement

200
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 break-
points 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 to use the flash breakpoints feature is explained.
How do breakpoints work?
There are basically 2 types of breakpoints in a computer system: hardware break-
points and software breakpoints. Hardware breakpoints require a dedicate 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 debugger modifies the program and replaces the
breakpointed instruction with a special value. Additional software breakpoints do not
require additional hardware units in the processor, 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 of an unlimited number of breakpoints even if the
user application is not located in RAM. On modern microcontrollers this is the stan-
dard 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 is absolutely necessary which
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
extremely fast; on microcontrollers with fast flash the difference between software
breakpoints 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 exe-
cution of the target program is started. A lot of times, more then 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 soft
ware 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 num-
ber 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 microcon-
troller are available to the application program, no memory is lost for debugging.
J-Link / J-Trace (UM08001)
CHAPTER 7
© 2004-2013 SEGGER Microcontroller GmbH & Co. KG
Flash breakpoints

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

This manual is also suitable for:

J-trace

Table of Contents

Save PDF