2008年3月7日 星期五

Trace32 Installation & Using - 080710

Note:

  • Trace32 要先(於target)開 後(於target)關
  • on Ubuntu, refer to Trace32 在 Ubuntu 上執行的問題 there is no hotplug package available and t32usbchecker always report no debuger found.
  • on Debian(icewm/xfce4)/Ubuntu8.04, after running t32(t32marm), the console shows:
    Warning: String to TranslationTable conversion encountered errors
    Warning: translation table syntax error: Unknown keysym name: osfPrimaryPaste
    Warning: ... found while parsing ':m osfPrimaryPaste:cut-primary()'
    Warning: String to TranslationTable conversion encountered errors
    (................same message repeat a couple of times................)
    all text field can't input text, click on any drop down list would halt all window action, until you kill the t32(t32marm) in other console.
    Solution
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=1196039
    Warning: translation table syntax error: Unknown keysym name: osfActivate

    The problem is actually that the display-machine (5.3) doesn't have the
    XKeysymDB file that defines the special Motif virtual keysyms (osf*).
    This is NOT a java/AWT bug.

    You need to get a /usr/openwin/lib/XKeysymDB file installed on the
    display system that defines these keysyms (not sure which Solaris release
    this file shipped wi).
    http://linux.chinaunix.net/bbs/viewthread.php?tid=898502
    一个十分棘手的问题,请兄弟们给予指点

    export XKEYSYMDB=/usr/share/X11/XKeysymDB
    By my collegue, Scott Shu,
    # mkdir -p /usr/X11R6/lib/X11
    # cd /usr/X11R6/lib/X11
    # ln -s /usr/share/X11/XKeysymDB
  • Also by Scott Shu,
    # t32marm
    FATAL ERROR from X-windows: font not found: t32-lsys-16
    CONFIG: config.t32
    Program stops with message 'font xxxx not found'
    Do fonts appear in the 'xlsfonts' command?
    Can one font (e.g. t32-lsys-16) be displayed by 'xfd -fn t32-lsys-16'?

    Install fonts (options)
    # yum install xorg-x11-fonts-75dpi
    # yum install xorg-x11-fonts-ISO8859-1-75dpi
    # cd /opt/t32/fonts
    # mkfontdir .
    # xset fp+ /opt/t32/fonts
    # xset fp rehash

Installing Trace32
  1. mkdir /home/t32/bin -p
    mount /dev/cdrom /media/cdrom
    cp -r /mnt/cdrom/files/* /home/t32
    cp -r /mnt/cdrom/bin/pc_linux /home/t32/bin;
    chmod -R u+w *
  2. mv /home/t32/bin/pc_linux/config.t32 /home/t32/
    or run t32 by
    t32marm -c/home/t32/bin/pc_linux/config.t32
  3. converts all filenames to lower case and files into UNIX format
    bin/pc_linux/filecvt .
  4. Add the following script at /home/t32
    #!/bin/sh

    export T32SYS=/home/t32
    export T32TMP=/tmp
    export T32ID=T32

    cd /home/t32/fonts
    mkfontdir .
    xset +fp /home/t32/fonts
    xset fp rehash

    cd /home/t32
    ./bin/pc_linux/t32marm

  5. vi config.t32, uncomment the following lines:
    PBI=
    USB
  6. if Ubuntu is used, refer to Trace32 在 Ubuntu 上執行的問題
    else {
    package hotplug required

    grep -iq trace32 /etc/hotplug/usb.usermap || cat /home/t32/bin/pc_linux/usb.usermap.trace32 >>/etc/hotplug/usb.usermap
    install -m 0755 trace32 /etc/hotplug/usb/
    }
  7. use t32usbchecker to verify proper USB operation



Using Trace32
  1. add debug info to image, rebuild the kernel
    Edit arch/arm/Makefile
    CFLAG+=-gdwarf-2
  2. Runing Trace32
    1. [CPU] -> [System Settings] CPU => FA526
    2. [Break]->[OnChip Trigger] (TrOnChip) turn off DABORT, PABORT
  3. Add breakpoint
    1. Get the address of the first breakpoint by:
      grep start_kernel System.map
    2. [Break] -> [Set...] -> [fill address 0xC0XXXXXX] -> [implementation: Onchip] -> [Set] -> [OK]
To load kernel image
  1. Let device boot as normal (load from flash, or tftp). CPU would be trapped when the breakpoint is reached.
  2. Use the Load function
    1. [File] -> [Load: vmlinux]
    2. [Run] -> [Go (F7)]
? How to debug modules?

1 則留言:

सुरेश शुक्ला 提到...

I didn't know that I have to do it every time. Now I use your script.

It solved my font detection problem.
Thanks a lot,
Suresh