Vous êtes sur la page 1sur 11

User Manual for USB BDM Aug 2006

-1-

Preface
Disclaimer The information in this document is subject to change without notice. The manufacture makes no representations or warranties with respect to contents hereof and specifically disclaims any implied warranties of merchantability or fitness for any particular purpose. The manufacture reserves the right to revise this publication and to make changes from time to time in the content hereof without obligation of the manufacturer to notify any person of such revision or changes. Use USB BDM at your own risk. Nothing is implied outside this document. The manufacture is not responsive for any damage using the USB BDM software and hardware.

USB BDM should work for any Motorola 32 bit CPU with 10-pin BDM connector. The USB BDM has been tested against MC 68331. For detail of the BDM for MC 68331, please refer to http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MC68331&nodeId= 0162468rH3YTLC61650795 and http://www.freescale.com/files/microcontrollers/doc/user_guide/MC68331UM.pdf Terms In this document, target or target board refers to any device that has MC 6833x CPU on it.

NOTICE: Only power on BDM and target AFTER the BDM and target connected. Connect BDM and target with one side power on could burn either BDM or target.

-2-

______________________________________________ TABLE OF CONTENTS


Disclaimer ....................................................................................................................... 2 Chapter 1 Basic concept .................................................................................................. 4 1.1 What is BDM ............................................................................................................ 4 1.2 What can be done with USB BDM ........................................................................... 4 1.3 Some technical data .................................................................................................. 4 Chapter 2 Install USB BDM ............................................................................................. 4 2.1 Setup software........................................................................................................... 4 2.2 Install hardware......................................................................................................... 5 Chapter 3. Using USB BDM software ............................................................................. 6 3.1 Software layout. ........................................................................................................ 6 3.2 Check the version of software............................................................................. 6 3.3 Configure the software........................................................................................ 7 3.4 Commands .......................................................................................................... 8

-3-

Chapter 1 Basic concept


1.1 What is BDM BDM stands for Background Debugging Mode. Here is the pin layout of 10 pin BDM.

For detail BDM information, please refer to chapter 5 of MC68331Ref.pdf. 1.2 What can be done with USB BDM USB BDM provide an affordable yet powerful enough to gain most functions that a professional BDM tool can provide. It allow you to 1. View the registers of the target CPU. 2. Single step the target CPU. 3. Get memory from target board. 4. Set memory to target board. 5. Program flash using target CPU and memory. 1.3 Some technical data USB BDM software is fully configurable to fit your needs. You can even build your own DLL to plug in the software to provide various functions. For detail how to write your own plug in DLL, contact dctbdm@yahoo.com. (A test DLL can be downloaded called DCTTest.dll) With USB 1.1 interface support, USB BDM can: 1. Read target memory at 432KB/s 2. Wrote target memory at 358KB/s 3. Program target flash at 60-100KB/s (depends on the speed of the flash)

Chapter 2 Install USB BDM


2.1 Setup software Unzip (or copy if you use CD) all the files to a folder. If you running XP and lower version of Windows and do not want to use WinUSB Run setup.exe to install USB driver. You must setup the USB driver before USB BDM is plugged in. If you are running Windows XP SP2 or Vista 32bit, you can choose to use Win USB driver, if you use Vista 64 bit, you must use WinUSB driver Plug in the USB, when it ask for driver, point to the driver directory (For Vista 64 bit choose 64 bit, for other versions of Windows, select 32 bit). Check video http://www.usbjtag.com/pafiledb/index.php?act=category&id=5.

-4-

2.2 Install hardware On back of the USB BDM module, one black dot indicates the pin 1. 1. Power off the target board. 2. Plug the BDM connector to the BDM connector on target board. Make sure pin 1 matches the pin 1 of the target BDM connector. Reverse the BDM cause the BDM not function properly. If this happened, power off the target and plug back in. 3. Connect the USB BDM one of the PCs USB slot. 4. Power on the target board.

-5-

Chapter 3. Using USB BDM software


3.1 Software layout.

1. 2. 3. 4.

Command window accept your command and put result to this window. Register window display the registers of the target CPU. Code display the assembly code. If not configured, this window is empty. Connect status indicate the USB BDM to PC connect state, during the running of the software, you can unplug/plug the USB connector to PC. When BDM not connected, no command can be send to the target CPU. 5. When BDM ON, target can accept command like getting memory or setting memory. When BDM OFF, target CPU is running full speed, to stop the target and let it go to BDM mode, a break command or reset 1 command needs to be sent. A break command can only be sent when BDM is running at full speed after go (or F5) command is used. Check the version of software Help->about, version of the software printed out. Example

-6-

USB BDM is the main application. Test module is the plug in DLL. If present, a new pull down menu exist after the Tools menu.

Configure the software

Before the software can be used, configuration must be done based on your target. 1. Up to 6 memory tabs can be created. 2. The name is the tab name. 3. Start and length defines the memory block. 4. Init value should leave 0 for RAM and FF for flash or ROM. 5. Source code, select the assembly code file. 6. RAM for program flash, you n to allocate 128 KB memory to program the eed target flash. The flash programming uses target memory and CPU. 7. Target select. (This is empty if you do not have a plug in DLL). If you are interested in developing dctbdm@yahoo.com. Target select simplify the process from 1 to 6. An example DLL called (DCTTest.dll) can be put under same directory of USB BDM software and single select of the target can configure everything needed. Here is a look of example configuration.

-7-

Click OK. Start the app again. You can see tabs are created.

Commands USB BDM software is command driven. In command window type help will give you all the command available. Type help command can give detail of that

-8-

command. Up, Down arrow keys can be used to go through the command history in the command window. 1. D Make the address visible. Example: d 405a00 2. Exit. Exit the software. Syntax: exit 3. Reset. Reset the target. Syntax: reset (1) If parameter 1 is used, force the target to BDM mode. You should see BDM ON in BDM state window. Also all registers represent the target CPU registers. If no parameter is used, the target CPU resets and runs at its full speed. You should see BDM OFF and the only way to let target CPU go to BDM mode is to type reset 1. Here is a capture of registers after a reset 1 is issued.

Example: reset 1 4. Break. Force target to BDM mode. Syntax: break. Only when target CPU is running after a reset 1 is issued. 5. Getram. Get the target memory. Syntax: getram startaddress length. Note, if the memory is not in either of the memory range configured, a window pops up ask for the filename to save. Syntax1: getram tabname Example: getram 200000 40000. Example1: getram nvram 6. R. Get/Set register. Syntax: r para1 para2. If no para1 and para2 exist, all the registers of the target will be retrieved. Para1 is the register name and para2 is the value. Example 1: r Example 2: r a7 100. Set r7 to value 100. 7. G. Execute the CPU from current address. (Hotkey F5) Syntax: g param1. If param1 is missing, the CPU runs from current PC address. If param1 exists, it will stop at address param1. NOTE: Due to the nature of MC6833X, this featur e is limited, so try not to put param1 far away from the current address since this feature is done by single step. Sometime this could take forever and restart the application is needed. 8. G=. Execute the CPU from address specified. Syntax: g= param. Example: g= 408000

-9-

9. Save. Save the memory. Syntax: Save tab name. Example: save nvram 10. T. Single step. (Hotkey F10) Syntax: T param, Param is optional. If param exists, the target CPU executes and stop after param number of instructions executed. 11. T= Single step with address. Syntax: T= param1Param1 address. Example: t= 400800 12. Ldram. Load the memory map file. Syntax: ldram address. Syntax1: ldram tabname Example: ldram 400000 Example: ldram code 13. Setram. Write the memory from PC to target board. Syntax: setram addres s length. Syntax1: setram tabname Example: setram 200000 40000 Example1: setram nvram 14. Cmpram. Compare the memory between PC and target board. Result will be present to the command window. If all the memory are synchronized between PC and target memory, an OK message will be shown. Syntax: cmpram address length. Example: cmpram 200000 40000 Example1: cmpram nvram 15. Program. Program the target flash. flash.def should exist to allow this feature to work. If the target chip is not in the list and you cannot find a compatible flash to program, please email usbbdm@usbjtag.com, a newer version flash.def might be created in the future to cover this flash. The program the target might take a while depends on the size to program and the flash chip type. If after a long time, nothing shown in the progress bar, you might need to exit the app and restart again. When select address and length, make sure it fits boundary of a sector of the flash. Refer to the datasheet of each flash type. Syntax1: program. (select start address 406000 and length aa000). Syntax2: program start length Syntax3: program tabname Example: program 406000 aa000 Example1: program code 16. Poke. Syntax: poke address value (word). Example: poke 200000 4000 17. Peek. Peek the target memory (Word). Last two number is the word from the target board. Syntax: peek address Example: peek 200000

- 10 -

18. Init. Initialize the target board so access the memory is possible. You must install the plug in DLL to have this feature. Syntax: init 19. Initusb. Re- init the USB driver. 20. Flshdct. Auto detects the flash type to use for programming. You can execute this command before run program start length). Syntax: flshdct address Example: flshdct 400000 Example1: flshdct code 21. Flshlist, List all the flash supported. 22. Help. Print the command and its syntax. Syntax: help command. If command is missing, all the command will be printed. If command exists, the syntax of that command is printed. Example: help cmpram. 23. CLS. Clear the output and command window.

- 11 -

Vous aimerez peut-être aussi