Background Debug Mode interface
Encyclopedia
Background Debug Mode interface is an electronic interface that allows debugging
Debugging
Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware, thus making it behave as expected. Debugging tends to be harder when various subsystems are tightly coupled, as changes in one may cause bugs to emerge...

 of embedded system
Embedded system
An embedded system is a computer system designed for specific control functions within a larger system. often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. By contrast, a general-purpose computer, such as a personal...

s. Specifically, it provides in-circuit debugging
In-circuit emulator
An in-circuit emulator is a hardware device used to debug the software of an embedded system. It was historically in the form of bond-out processor which has many internal signals brought out for the purpose of debugging...

 functionality in microcontrollers. It requires a single wire and specialized electronics in the system being debugged.
It appears in many Freescale Semiconductor
Freescale Semiconductor
Freescale Semiconductor, Inc. is a producer and designer of embedded hardware, with 17 billion semiconductor chips in use around the world. The company focuses on the automotive, consumer, industrial and networking markets with its product portfolio including microprocessors, microcontrollers,...

 products.

The interface allows a Host to manage and query a Target. Specialized hardware is required in the target device. No special hardware is required in the host; a simple bi-directional
Bi-directional
Bi-directional may refer to:* Bi-directional text* Two-way communication* Bi-directional railway signalling* Controls at each end of a tram or railcar...

 I/O pin is sufficient.

I/O signals

The signals used by BDM to communicate data to and from the target are initiated by the host processor. The host negates the transmission line, and then either
  • Asserts the line sooner, to output a 1,
  • Asserts the line later, to output a 0,
  • Tri-states
    Three-state logic
    In digital electronics three-state, tri-state, or 3-state logic allows an output port to assume a high impedance state in addition to the 0 and 1 logic levels, effectively removing the output from the circuit...

     its output, allowing the target to drive the line. The host can sense a 1 or 0 as an input value.


At the start of the next bit time, the host negates the transmission line, and the process repeats. Each bit is communicated in this manner.

In other words the increasing complexity of today’s software and hardware designs is leading to some fresh approaches to debugging. Silicon manufacturers offer more and more on-chip debugging features for emulation of new processors.

This capability, implemented in various processors under such names as Background Debug Mode (BDM), JTAG and on-chip emulation, puts basic debugging functions on the chip itself. With a BDM (1 wire interface) or JTAG (standard JTAG) debug port
Debug port
Debug port is a port included in a device to simplify development and debugging, which is not necessary for normal functioning of it. Debug ports are usually not removed or disabled to avoid costs of design changes, and can be used by modders and hackers to get extra functionality.Examples:*...

, you control and monitor the microcontroller solely through the stable on-chip debugging services.

This debugging mode runs even when the target system crashes and enables developers to continue investigating the cause of the crash.

Microcontroller application development

A good development tool environment is important to reduce total development time and cost. Users want to debug their application program under conditions that imitate the actual setup of their system. Because of that, the capability to debug a user program in an actual target system is required. This is known as in-circuit debugging. Furthermore, most new MCUs have nonvolatile memory such as flash memory
Flash memory
Flash memory is a non-volatile computer storage chip that can be electrically erased and reprogrammed. It was developed from EEPROM and must be erased in fairly large blocks before these can be rewritten with new data...

 so that programming code on the target system is also required. This is known as in-circuit programming
In-System Programming
In-System Programming is the ability of some programmable logic devices, microcontrollers, and other programmable electronic chips to be programmed while installed in a complete system, rather than requiring the chip to be programmed prior to installing it into the system.The primary advantage of...

.

To support in-circuit debugging and programming requirements, the HC08 Family has the monitor mode and the HCS08 and RS08 utilize a background debug mode (BDM). The background debug hardware on the HCS08 consists of a background debug controller (BDC) and debug module (DBG). The background debug hardware on the RS08 consists of the background debug controller (BDC) only.

BDM commands

The BDM host can issue commands with parameters to the target. Some commands allow reading or writing of blocks of the target's memory, individual registers in the CPU, or registers not available to the target.

Examples include:
BDM commands
READ_BYTE Read a byte from memory
WRITE_BYTE Write a byte to memory
GO Start/resume executing at current program counter location
WRITE_PC Write a value to the program counter
READ_PC Read the value of the program counter
WRITE_X Write a value to the index register
READ_X Read the value of the index register
READ_SP Read the value of the stack pointer

BDM Functions

Depending on the target part, the BDM controller may feature a hardware breakpoint
Breakpoint
In software development, a breakpoint is an intentional stopping or pausing place in a program, put in place for debugging purposes. It is also sometimes simply referred to as a pause....

 register. The register holds a value indicating an address
Memory address
A digital computer's memory, more specifically main memory, consists of many memory locations, each having a memory address, a number, analogous to a street address, at which computer programs store and retrieve, machine code or data. Most application programs do not directly read and write to...

in memory. When the target part's CPU accesses that location in memory, the BDM hardware can take control of the target part, stop program execution, and begin operating in Background Mode.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK