Next
Previous
Contents
7. Using GDB for Remote Debugging
The gdb manual has information on how to do remote debugging with the targets
that it supports. That is the best place to look. If you have `info' and the
gdb `info' files installed you can run ` 7.1 BDM Support
What is BDM, and why do I want it?
BDM stands for `Background Debug Mode', and it is a special debug interface on some of Motorola's embedded 68K and Power PC processors. BDM allows an external debug system to control and monitor the operation of theembedded processor through a 10-pin proprietary serial interface, without any software support in the target system and without the use of an In-Circuit Emulator (ICE). Using a low-cost interface cable to your PC's printer port, and the right software on your PC, you can perform most of your debugging directly on your target hardware at very low cost. What processors have BDM capability?
Since BDM requires some special hardware on the embedded processor, you can't use it with just any old CPU. It is available only on a select set of Motorola's embedded microprocessors:
What are the capabilities of BDM?
BDM (as implemented in the original CPU32 version) executes a small set of commands over a high-speed, proprietary serial interface that allows your debug host to read and write memory locations; read and write CPU registers; and start, stop, and reset the processor. Breakpoints are implemented by replacing a normal program instruction in your code with a special opcode that forces the processor into BDM. The ColdFire processors implement the same command set, but have some extra hardware support in the form of a hardware breakpoint register. The Power PC implementation of BDM is yet more capable. Instead of using a command language, it allows the debug system to feed CPU opcodes directly to the processor core to be executed. In addition, dedicated hardware implements a small number of hardware breakpoints for code execution, and watchpoints for data accesses. What are the tradeoffs in using BDM for in-circuit debug?
BDM plays off the good old 80/20 relationship; it gives you 80% of the functionality of a full-blown ICE for 20% of the cost.Its major limitations are:
Having said that, it should be noted that many developers regularly do the majority of their hardware and software debugging without using any other debug system, saving the expensive tools for those really difficult problems which cannot be tracked down without some real-time tools. What else can BDM be used for?
Here are a couple of the most common applications:
I am using a PC host system. How do I use BDM via gdb?
The first requirement is an interface cable. There are two options here:
The other item is software support for the host system; a low-level driver is required to control these interface cables since the BDM protocol is not based on standard parallel or serial protocols. 683xx BDM resources
PowerPC (MPC5xx/MPC8xx) BDM resources
I'm using a Unix host system. How do I use BDM via gdb?
If you are on an Intel Linux system, there is a driver to implement BDM for 683xx targets; check out BDM via gdb on PC host. For other systems, several vendors have reasonably low-cost ICE-type products which interface via BDM and communicate with the host system via RS-232 serial ports, or Ethernet. Where can I learn more about BDM?
BDM is fully documented in Motorola's reference manuals, document no. CPU32RM/AD for the 68k devices and MPC860UM/AD for Power PC. These documents may be ordered for free from Motorola's web site, http://design-net.com/home/lit_ord.html. Next Previous Contents |