richliu's blog

Linux, 工作, 生活.

richliu's blog header image 2

Trace32 在 Ubuntu 上執行的問題

四月 7th, 2008 · No Comments

Trace32 在 ubuntu 上會抓不到 USB device, 在 Gentoo 上並沒有這樣的問題.
這是因為 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

將最後四行的 『#』 unmark 掉.

然後建立 system group 給 usb 的使用者
sudo addgroup –system usbusers
# Output GID 128

# 加入 USER 到 usbusers 群組.
sudo adduser $USER usbusers

# 修改 /etc/fstab:
sudo vim /etc/fstab

# 加上這一行.
# 128 是』usbusers』 的 GID
none /proc/bus/usb usbfs devgid=128,devmode=664 0 0

重開機之後, 執行 t32usbchecker , 大功告成

# ./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.

其他如果有需要用到 /proc/bus/usb 的程式也可以用這種解法, 例如 VirtualBox

Ref.
Bug #156085 in kvm (Ubuntu Gutsy) Could not open /proc/bus/usb/devices

Tags: , ,

Related posts

Tags: Embedded · Hardware · UNIX

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment