EasyManua.ls Logo

Segger J-Link - Introduction

Segger J-Link
480 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
264 CHAPTER 7 Flash breakpoints
J-Link / J-Trace (UM08001) ©
2004-2017 SEGGER Microcontroller GmbH & Co. KG
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 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 break-
points 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 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 an unlimited number of breakpoints even if the user
application 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
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 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 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.

Table of Contents

Other manuals for Segger J-Link

Related product manuals