Background Debug Mode interface

From Wikipedia, the free encyclopedia

The Background Debug Mode interface (BDM) 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 begin debugged.

It appears in many Freescale Semiconductor 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 I/O pin is sufficient.

Contents

[edit] 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 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.

[edit] 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

[edit] BDM Functions

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.

[edit] Bibliography

Motorola (Freescale Semiconductor Inc.). CPU12 Reference Manual (CPU12RM/AD).

Freescale Semiconductor Inc. MC9RS08KA2 Data Sheet (MC9RS08KA2, Rev. 1.0).

Freescale Semiconductor Inc. RS08 Core Reference Manual (RS08RM, Rev. 1.0).