Background debug mode (BDM) interface is an electronic interface that allows debugging of embedded systems. Specifically, it provides in-circuit debugging functionality in microcontrollers. It requires a single wire and specialized electronics in the system being debugged. It appears in many Freescale Semiconductor products. Background commands are categorized into two types: Non-intrusive commands and Active background commands. Non-intrusive commands can be issued while the user program is running, which include memory access commands.[1]

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 bidirectional I/O pin is sufficient.

I/O signals

edit

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 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 in-circuit emulation, puts basic debugging functions on the chip itself. With a BDM (1 wire interface) or JTAG (standard JTAG) debug port, 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

edit

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 so that programming code on the target system is also required. This is known as in-circuit programming.

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

edit

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

edit

Depending on the target part, the BDM controller may feature a hardware breakpoint register. The register holds a value indicating an address 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.

References

edit
  1. ^ "HCS08 Family Reference Manual". pp. 34–35. Retrieved February 6, 2024.
edit

📚 Artikel Terkait di Wikipedia

In-circuit emulation

to access the on-chip debug circuit that is integrated into the CPU via JTAG or background debug mode interface (BDM) to debug the software of an embedded

BDM

noted political scientist at New York University Background debug mode interface, a programming interface to embedded systems microcontrollers like JTAG

Embedded system

Analog-to-digital and digital-to-analog converters Debugging: JTAG, In-system programming, background debug mode interface port, BITP, and DB9 ports. As with other

RISC-V

Freescale's background debug mode interface (BDM) for some CPUs, ARM, OpenRISC, and Aeroflex's LEON. In instruction feeding, the CPU will process a debug exception

Hardware emulation

efficient debug, comparable to the emulator. Hardware-assisted virtualization Emulator In-circuit emulator Background debug mode interface Examples: Microprocessor

Debug port

debug port on the original Xbox, used by modders Serial Wire Debug (SWD), ubiquitous on Arm Cortex-M microcontrollers Background Debug Mode interface

DBG

to sequence assembly in computational biology Debug module, a type of background debug mode interface supported by certain microcontrollers, such as

Bash (Unix shell)

+p. When privileged mode is enabled, the SHELLOPTS shell variables includes the string "privileged". Enabled via bash --debugger at invocation or via