Jump to content

Background debug mode interface

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Kzurell (talk | contribs) at 21:01, 23 October 2006 (initial entry). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

The Background Debug Mode interface (BDM) is a single-wire signal and associated on-chip hardware that gives in-circuit debugging functionality in microcontrollers. 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.

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.

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

Bibliography

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