Motorola Background Debugging Mode Driver for Windows
The Motorola Background Debugging Mode (BDM) for the CPU32 or Coldfire series allows target debugging in an unobtrusive manner similar to using an In Circuit Emulator.
BDM provides functionality to start/stop the target, step though the program and read/write target memory and registers. When controlled by a debugger, this provides a very powerful means of developing code for embedded processors.
Commercial tools are available, usually at considerable cost.
The GNU toolset has been available for many years on UNIX platforms and contains a pretty complete set of tools, including compiler, assembler, debugger and associated components. The results of having an open source code policy have resulted in a great variety of configurations and ports to many different processors, so much so that most embedded 16 and 32 bit processors can be targeted either straight out of the box or with little effort.
Several people have been working on BDM implementations as a back end to the GNU debugger, GDB. Thanks to these people, the whole community benefits with commercial grade FREE development tools. Most of this work however, has been on Linux or various flavours of UNIX. Thanks to the folks at Cygnus Solutions, who produced CYGWIN, which provides a UNIX like environment for WIN32 platforms, running the GNU toolset is viable under Microsoft Windows 95/NT.
BDM Interface Circuits
There are several BDM circuit designs for the CPU32 processors in the public domain.
The original "2-chip" design is available here.
A revised "5-chip" design is available here.
A PAL based design by Pavel Pisa is here and the equations are here.
Schematics for P&E Micro PAL based designs for CPU32 are here and Coldfire here.
To communicate with the target through BDM, a device is connected to the PC parallel port. There is a circuit in the public domain that may be used for the Motorola CPU32 family and a number of commercial versions for other variants. Two device drivers exist for Linux to control the public domain interface and the Motorola ICD interface and now the Coldfire (MFC5206/7) series using an interface by P&E Micro. Both drivers originated from code by Scott Howard of Motorola and Michael Schraut of Technische Universitaet Muenchen and Eric Norum. (Not sure exactly who did what, sorry if I left anyone out.) Latterly, additional work has been done by Gunter Magin on the CPU32 and Chris Johns for Coldfire support.
My work has been to port these driver sources to Windows NT (Sorry no support for 95/98).
This initial release has only been tested on the SBC5206AN Coldfire EVB.
I am in the process of trying to integrate the following configurations:
The following procedure should get GDB running with the driver under CYGWIN on Windows NT.
Please note this is an early release and has only been tested on a single installation of both the toolset and operating system. The driver source came from Chris Johns for Linux and I am uncertain of how much testing it has received. Having said that, the test program runs fine on my SBC5206 EVB.
|1.||Get the latest CYGWIN release from Cygnus Solutions. You need both full.exe and
Follow instructions on the Cygnus site to install this release.
|2.||To build the GDB from source, get a copy
of gdb-4.18 from your local gnu archive and then download this zip file or this tar ball.
|3.||Unpack the above zip file and apply
gdb-4.18-bdm.patch (in the patches sub-directory) to the gdb 4.18 directory.
|4.||Copy the following files into the GDB
And put the libBDM.a library somewhere where it will be found by the
compiler when building gdb (i.e. /lib).
|5.||Configure GDB as follows: ./configure --target=m68k-bdm-coff
make GDB. If all goes well, the result should be a running GDB debugger. Run the new GDB
and check the target reported on startup. It should report m68k-bdm-coff.
|6.||Next, install the NT device driver as
The driver should start and will start automatically on each boot.
(Check the Control Panel/Devices app to be sure.)
|7.||The driver exposes several device names,
one for each CPU / interface / parallel port combination supported. For instance on a
machine with one parallel port, the following device names are exposed:
If more than one parallel port is installed in the machine,
additional devices are created for each extra parallel port (-pe2 -pe3 etc.)
|8.||Plug the interface into a (the) parallel
port and run the test program chk.exe with the appropiate device name as the argument.
(Again note that only the P&E Coldfire interface has been tested so far.)
Run the chk program from the test directory thus (substituting the appropiate device name):
The test should exercise the target and result in no errors (hopefully).
Next try GDB and see if that works.
Contact me with any problems or successes.
|David Fiddes - Motorola Coldfire Development Resources||Great Coldfire resource site. Binary
versions of GCC for Linux and NT, plus lots of other good stuff.
|BDM Interface for Motorola 683xx MCU||A good source of BDM info by Pavel Pisa.
|Object Software Inc.||Scott Howard's Object Software site. Has
GNU Compiler for Embedded targets - M68k and PowerPC and BDM module.
|Eric Norum's FTP site||Latest version of LINUX BDM driver
|Cygnus Insight Debugger||Cygnus Solutions Insight graphical
debugger front-end to GDB.
|RTEMS RTOS||Real-time open source operating system from OAR Corp.|
|Copyright (c) Peter Shoebridge, 1999-2001.||