segger.com

Can I use Unlimited Flash Breakpoints in CFI NOR flash?

Yes. On some CPUs, using Unlimited Flash Breakpoints is the only way to set breakpoints in external flash memory. For example, in Cortex-M systems, the typically available six hardware breakpoints of the Flash Patch and Breakpoint (FPB) unit cannot be used to set breakpoints in external memory on most Cortex-M systems, as the address range of the unit is limited.

This means that if you are using a Cortex-M3 or Cortex-M4 with external flash, a program located in that external flash cannot be debugged with most common emulators. An exception is J-Link with the Unlimited Flash Breakpoints license.

In other words, when debugging a program located in external flash on a Cortex-M device, a J-Link with the Unlimited Flash Breakpoints license, such as J-Link Ultra, is almost essential.

What is special about software breakpoints in flash?

Unlimited Flash Breakpoints allows you to set an unlimited number of breakpoints even if your application program is not located in RAM but in flash memory. This scenario was very rare before ARM microcontrollers entered the market.

This technology made powerful yet inexpensive ARM microcontrollers available for systems that previously required external RAM. The downside is that it is not possible to debug larger programs by loading them entirely into RAM, as the RAM is typically not large enough to hold both program and data. These chips usually contain about four times as much flash as RAM.

As a result, with standard debuggers, only two breakpoints can be set. This limitation makes debugging difficult, as debuggers often require two breakpoints simply to step over a single line of code. With Unlimited Flash Breakpoints, this limitation no longer applies.

How does this work?

The concept is very simple.
The J-Link software reprograms a flash sector to set or clear a breakpoint.

What performance can I expect?

A RAM-resident code module, specifically designed for this purpose, sets and clears flash breakpoints extremely fast. On microcontrollers with fast flash, the difference between breakpoints in RAM and in flash is hardly noticeable when using Unlimited Flash Breakpoints.

How is this performance achieved?

Considerable effort has gone into making Unlimited Flash Breakpoints both usable and convenient. Flash sectors are programmed only when necessary, typically when execution of the target program is started.

In many cases, multiple breakpoints are located within the same flash sector, allowing several breakpoints to be programmed by modifying only a single sector. The contents of program memory are cached, avoiding time-consuming reads of flash sectors.

A smart combination of software and hardware breakpoints allows hardware breakpoints to be used frequently, especially during source-level stepping, which avoids unnecessary flash reprogramming. A built-in instruction set simulator further reduces the number of required flash operations.

This minimizes delays for the user while maximizing the lifetime of the flash. All resources of the ARM microcontroller remain available to the application, and no memory is reserved for debugging. All of the optimizations described above can be disabled if required.

Can I use Unlimited Flash Breakpoints with different software components?

Unlimited Flash Breakpoints can be used with the following J-Link software components:

For more information about how to use Flash Breakpoints with these software components, please refer to the corresponding manuals.

What about licensing?

Unlimited Flash Breakpoints is licensed on a per-J-Link basis and requires a J-Link with Unlimited Flash Breakpoints support. Unlimited Flash Breakpoints can also be used with J-Link ARM RDI and the J-Link GDB Server.

If you want to use Unlimited Flash Breakpoints with J-Link ARM RDI, an additional license for this software component is required.

To receive a free 30-day trial license, please send an email including your J-Link serial number to sales@segger.com.

Read the original on segger.com ↗