Trace32-ICD是目前功能最強大的仿真器,支持各種CPU,包括ARM/X86等。Trace32是德國lauterbach公司的產品,功能強大,支持各種操作系統調試,如linux/vxworks/wince等,不過價格也比較高,要3-5萬RMB,現在也有些仿製的Trace(如Trace32-ICP),價格比較便宜,大概1萬多RMB。Trace32由於其功能強大,特別適合大型嵌入式軟件開發(包括操作系統的)。
Trace32仿真器包括硬件仿真器Trace32-ICD和調試軟件Trace32, 調試軟件Trace32可以支持多種操作系統,包括WINDOWS/LINUX/SOLARIS/HP-UX等。以前其在windows下用過Trace32,安裝和使用相對簡單; 最近因要在Linux(Ubuntu)下開發,需要在ubuntu下使用Trace32, 這裏把Linux下的Trace32安裝要點寫來,供參考:
1.首先要仔細看安裝盤下的readme.txt文件,裏面寫了在pc_linux下的安裝步驟,如下:
INSTALLATION ON PC_LINUX
Copy the /files directory structure from the CD to your disk.
The utility "filecvt" should be used to convert the files to unix format.
The host specific files can be found in the /bin/pc_linux directory.
1. mount /mnt/cdrom
2. mkdir /home/t32 (or similar)
mkdir /home/t32/bin
cd /home/t32
3. cp -r /mnt/cdrom/files/* .
cp -r /mnt/cdrom/bin/pc_linux ./bin
cp /mnt/cdrom/bin/pc_linux/config.t32 .
chmod -R u+w *
4. /home/t32/bin/pc_linux/filecvt /home/t32
5. Install the Acrobat Reader from http://www.adobe.com if it isn't already installed on the system
6. Set the environment variable "ACROBAT_PATH" to the Acrobat installation path
export ACROBAT_PATH=/opt/Acrobat5
7. Copy the Trace32 plugin to the plug_ins folder of Acrobat Reader
cp /mnt/cdrom/bin/pc_linux/trace32.api $ACROBAT_PATH/Reader/intellinux/plug_ins
8. Please refer the installation manual for
- TRACE32 font installation
- setting of TRACE32 environment variables
- modifying the TRACE32 configuration file config.t32
- usage of USB interface (hotplug interface)
The steps from point 8. about installing the fonts, setting environment variables, the
modification of file config.t32 and USB interface usage are necessary !!!
Please refer the installation guide in the manual for details.
2. 安裝好之後還需要安裝trace32的usb驅動,這樣才能在linux下識別Trace32-ICD,如下:
Trace32
在ubuntu
上會抓不到USB
device
,爲ubuntu
USB device
默認不會建立相容目錄/proc/bus/usb.
修改/etc/init.d/mountdevsubfs.sh
,
添加如下腳本:
#
#
Magic to make /proc/bus/usb work
#
mkdir -p
/dev/bus/usb/.usbfs
domount usbfs ""
/dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln
-s .usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb
/proc/bus/usb
然後建立system
group
給usb
的使用者
sudo
addgroup --system usbusers
# Output GID 123
//注:GID以實際輸出爲準
#
加入USER
到usbusers
羣組.
sudo adduser $USER usbusers
#
修改/etc/fstab:
sudo vim /etc/fstab
#
加上這一行.
# 123
是"usbusers"
的GID
none /proc/bus/usb usbfs devgid=123,devmode=664 0 0
重啓PC之後,
執行t32usbchecker
,
看是否能成功找到trace32
#
./t32usbchecker
Trace32 simple USB Checker
Checking
/proc/bus/usb/001/001 ... not useable
Checking
/proc/bus/usb/001/004 ... not useable
Checking
/proc/bus/usb/001/005 ... not useable
Checking
/proc/bus/usb/001/006 ... not useable
Checking
/proc/bus/usb/001/007 ... not useable
Checking
/proc/bus/usb/002/001 ... not useable
Checking
/proc/bus/usb/003/001 ... not useable
Checking
/proc/bus/usb/004/001 ... not useable
Checking
/proc/bus/usb/004/003 ... useable
Checking USB communication
with /proc/bus/usb/004/003 ...
Resetting Trace32...
USB
communication OK.
3.配置config.t32文件,該文件在安裝後的目錄下,trace32啓動時自動讀取該配置文件
詳細設置參考幫助文檔,這裏只是簡單說明一下類型配置:
PBI=
這裏的PBI是配置trace32仿真器類型的,包括SIM/USB/NET等,SIM表示純軟件仿真,不需要Trace32-ICD; USB表示使用USB接口的仿真器;
而NET表示使用網絡接口的仿真器。如:
PBI=
USB
4.啓動Trace32,先接好Trace32-ICD和JTAG
在安裝目錄下,如/opt/trace32/bin/pc_linux有各種CPU類型的可執行文件,根據不同的CPU類型來選擇對應的文件啓動,
如ARM仿真就選擇t32marm,如下:
$t32marm &
執行該命令後,程序會自動去讀取配置文件config.t32,也可以設置別的文件,如:
$t32marm -c configsim.t32