?? 00000019.htm
字號(hào):
<?xml version="1.0" encoding="gb2312"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"/><title>linux for ppc chapter 18 jacobw </title></head><body><center><h1>BBS 水木清華站∶精華區(qū)</h1></center><a name="top"></a>發(fā)信人: plato (純真年代), 信區(qū): Embedded <br />標(biāo) 題: linux for ppc chapter 18 <br />發(fā)信站: BBS 水木清華站 (Wed May 30 23:22:52 2001) <br /> <br />Next Previous Contents <br />---------------------------------------------------------------------------- <br />---- <br />18. Debugging <br />18.1 BDM <br />BDM is way cool, especially if you are bringing up a custom board and don't <br />want to invest in an In Circuit Emulator. You should definitely include a BD <br />M connector on any custom hardware, and all off-the-shelf boards have it. Fo <br />r a broad introduction, see: <a href="http://www.macraigor.com/zenofbdm.pdf">http://www.macraigor.com/zenofbdm.pdf</a> <br />Be careful to ensure that the CPU watchdog is disabled in your BDM probes' c <br />onfiguration file, otherwise it will continually reset the CPU and nothing w <br />ill work. In particulary, the watchdog is enabled at reset and must be disab <br />led if you wish to single step from reset. Also check that DER is zero'd whe <br />n running with the debugger. Leaving the BDM probe connected can interfere w <br />ith the target if it is not configured absolutely correctly, which usually i <br />nvolves the BDM probe being completely passive once the kernel is running. S <br />ymptoms are that the kernel crashes with the BDM probe connected, but runs f <br />ine without it. If you are using BDM and experience unexpected kernel crashe <br />s, try disconnecting the BDM probe. <br />If you're using an off-the-shelf board which already has a working rom monit <br />or, you generally won't need to use BDM at all, as you can get by fine with <br />just the serial console. Many developers, particularly those bringing up a c <br />ustom board from scratch, find BDM invaluable; to others it can be more trou <br />ble than it's worth. One advantage of a BDM interface over a kernel debugger <br /> is that you can really "freeze" the CPU including all timers, interrupts et <br />c. <br />MMU Support <br />Some BDM debuggers are capable of performing MMU table walks, which is essen <br />tial for debugging in virtual memory environments such as Linux because othe <br />rwise the BDM port merely deals with raw physical addresses. However, many B <br />DM systems can't do this, so check with the vendor that they support MMU tab <br />le walks on the particular CPU you're interested in before committing to one <br />; otherwise it will be almost impossible to use once the kernel has turned t <br />he MMU on. See: <a href="http://lists.linuxppc.org/listarcs/linuxppc-embedded/199909/">http://lists.linuxppc.org/listarcs/linuxppc-embedded/199909/</a> <br />msg00021.html. <br />Once the kernel is running you can use gdb remotely or even run it natively <br />on the target hardware if you have enough RAM. It may be worth providing ext <br />ra RAM on some of your development boards to allow for this. <br />GDB on BDM <br />See "Using GDB for Remote Debugging: BDM Support" in the CrossGCC FAQ at: ht <br />tp://www.objsw.com/CrossGCC/FAQ-7.html <br />BDM debugging under GDB is not supported by all BDM hardware vendors. See th <br />e thread: <a href="http://www.oarcorp.com/rtems/freesupport/rtemslistArchive/1999/jul">http://www.oarcorp.com/rtems/freesupport/rtemslistArchive/1999/jul</a> <br />y/msg00057.html <br />To support BDM debugging under gdb requires the appropriate remote-* device <br />in GDB, and possibly a kernel driver. If you are cross-developing, you must <br />configure gdb as follows to include the appropriate devices: <br /> % configure --target=powerpc-linux <br />The following systems currently support BDM debugging on gdb: <br />BDM4GDB <br /><a href="http://bdm4gdb.sourceforge.net/">http://bdm4gdb.sourceforge.net/</a> <br />An open user-supported project to build your own PowerPC BDM interface at ex <br />tremely low cost. Supports extensible Flash programming and implements softw <br />are-tablewalk so you have MMU support; you can use GDB to debug kernel code <br />(single stepping, breakpoints, etc.) and/or inspect kernel data. <br />If you don't want to build it yourself, the adapter is available at cost fro <br />m Denx, subject to availability. <br />MPCBDM <br /><a href="http://www.vas-gmbh.de/software/mpcbdm/">http://www.vas-gmbh.de/software/mpcbdm/</a> <br />The precursor to the BDM4GDB project, courtesy of Frank Przybylski. <br />PPCBDM <br /><a href="http://cyclone.parad.ru/ppcbdm/">http://cyclone.parad.ru/ppcbdm/</a> <br />The ultra low hardware cost precursor to MPCBDM and BDM4GDB, courtesy of Ser <br />gey Drazhnikov. <br />Abatron <br /><a href="http://www.abatron.ch/BDI/bdiGDB.html">http://www.abatron.ch/BDI/bdiGDB.html</a> <br />Has an ideal BDM/JTAG emulation solution for Linux hosting, with Linux MMU s <br />upport specifically in mind. It is an Ethernet-based unit which has a telnet <br /> interface with which one can program various popular flash parts. This is i <br />deal for Linux since one can build a kernel and expect script the programmin <br />g process automagically. <br />Their external box implements the standard GDB remote protocol allowing you <br />to host debugging on any platform that can host GDB. <br />Huntsville Microsystems <br /><a href="http://www.hmi.com/bmd.htm">http://www.hmi.com/bmd.htm</a> <br />Patches to add support to gdb are available in: <a href="ftp://ftp.hmi.com/pub/gdb/">ftp://ftp.hmi.com/pub/gdb/</a> <br />Macraigor Systems <br /><a href="http://www.macraigor.com/">http://www.macraigor.com/</a> <br />Currently only support Windoze platform, but say Linux support for the Kestr <br />el device (but not the Wiggler, Raven, etc) should be available sometime in <br />September 2000. <br />OCD Commander is a free assembly level debugger for Windows, which may work <br />under VMWare. I couldn't get it to work with the Raven/Blackbird interface o <br />n the Embedded Planet CLLF under Windows; it wouldn't single step correctly. <br /> <br />Beware that the 1999 version of OCD Commander silently truncates S-records l <br />onger than 20 bytes during download, so you'll need to patch objcopy or writ <br />
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -