PCM Flash dump, Part 2


If you have completed part 1 of this article, then you now have a BDM connector on your PCM. From this point forward you have 2 options: Either buy a commercial BDM debugging product, or continue with part 2. The commercial debuggers may include support for dumping and reflashing, and will support OSs other than NT/2000. I've never used any of them so I can't give a recommendation, but a google search for cpu32 bdm debug should turn up some options (and some interesting hacks). If you buy a BDM system then be sure it's for 68332 or CPU32. Other Motorola parts have BDM, but they're not all compatible.

Step 1: Build or acquire a BDM board
If you continue with Part 2 then you'll need to build or acquire a BDM board. This is a small piece of hardware that acts as an interface between your PC's parallel port and the BDM connector from Part 1. Several were designed as part of the efi332 project, the best is known as the "5 chip" BDM board. You can find gerber files and eagle schematic files on the ftp site: ftp://ftp.diy-efi.org/pub/efi332/hardware/5chip-bdm/

If you ask on the efi332 list you may be able to find a parts kit for this board, or even an assembled board. If not the readme includes a parts list, and all of these parts should be available from Digikey. Photo 1 is a picture of an assembled 5 chip BDM board. The readme contains assembly and testing info, please refer to it when building your BDM board. The large connector on the left will go to your PC's parallel port, and the small one on the right will go to the connector you just added to your PCM.


Photo 1 -- Assembled BDM board

Step 2: Install the software
There are 2 pieces of software used for this project. The first is a parallel port driver written by Peter Shoebridge, a former contributer to the efi332 list. This driver only works on Windows NT and Windows 2000. It will not work on any version of Windows 9x, and to the best of my knowledge it will not work with XP either. It is located on the ftp site:
ftp://ftp.diy-efi.org/uploads/nt-bdm-19990907.zip

Use the loaddrv.exe program to load the bdm.sys driver. Both of these are in the .zip file:

loaddrv bdm.sys

If you want more information, Peter Shoebridge has a WWW page describing this driver, and how to build a Windows version of GDB that will interface to it. He does not support this driver anymore, so please do not email him about it. The WWW page is at:
http://www.zeecube.com/bdm/index.htm

Verify that the driver has started by looking in the device manager in the Windows Control panel. In NT, double click devices on the control panel. In 2000, double click administrative tools on the control panel, then computer management, then select Device Manager. Either way, go to the view menu and select "show hidden devices". This will add "Non-Plug and Play drivers" to the driver tree. Look for bdm in the list of non plug and play drivers.

If you get an error it may be because the ECP driver hasn't been started. You can check this in device manager. It should be listed under Ports. In my case the ECP driver wasn't started, which prevented the BDM driver from starting.

The second piece of software is some that I wrote that uses the BDM driver to download the flash into a file, and to reflash from a file. Both are written as 32 bit command line programs. The reflash software is for reference only, as it takes over 30 hours to reflash a 256K image. That can be fixed but I haven't had the time yet to do it.

A zipfile containing the source and executables can be found on the FTP site:
ftp://ftp.diy-efi.org/uploads/dumpflash.zip
Unzip this file in the hierarchy created by the BDM driver .zip file. Copy it into the Source/bdm directory, where it will create a dumpflash subdirectory with the source and executables. The included Makefile assumes that GCC from cygwin has been installed, but it shouldn't take much to build the source using Visual C.

Todo list:
There are several things that could be done to improve the software. If you have the knowledge and time to work on any of these then please get with me: