我在 SAM3x8e 上安装了 Arduino Due。我使用的是 Ubuntu 14.04。今天之前,我使用以下命令通过终端上传了固件:
$ stty -F /dev/ttyACM0 speed 1200 cs8 -cstopb -parenb
$ /home/q/apps/devel/arduino/arduino-1.5.7/hardware/tools/bossac --port=ttyACM0 -U false -e -w -v -b /home/q/work/gk/j-v2/embedded/smib/Release/smib.bin -R
本来很好,但现在它停止工作了。Bossac 只是挂断了 '-d',什么也不显示。就是这样。
我下载了 arduino IDE 1.6.5,但这没关系。在 ide 的控制台中,我得到了
Sketch uses 11,000 bytes (2%) of program storage space. Maximum is 524,288 bytes.
Forcing reset using 1200bps open/close on port /dev/ttyACM0
/home/q/.arduino15/packages/arduino/tools/bossac/1.3a-arduino/bossac -i -d --port=ttyACM0 -U false -e -w -v -b /tmp/build238086227206829290.tmp/AnalogReadSerial.cpp.bin -R
它卡住了,Arduino 板上没有 LED 闪烁。它似乎真的挂断了,因为它占用了 99% 的 CPU...可能是 Ubuntu 更新导致了这个问题...?
消息
[ 5168.658692] usb 3-3: new full-speed USB device number 7 using xhci_hcd
[ 5168.676969] usb 3-3: New USB device found, idVendor=2341, idProduct=003d
[ 5168.676979] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[ 5168.676985] usb 3-3: Product: Arduino Due Prog. Port
[ 5168.676989] usb 3-3: Manufacturer: Arduino (www.arduino.cc)
[ 5168.676994] usb 3-3: SerialNumber: 75438313633351A07051
[ 5168.677225] usb 3-3: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[ 5168.677652] cdc_acm 3-3:1.0: ttyACM0: USB ACM device
系统日志
Oct 4 21:49:01 4xybook kernel: [ 5356.553290] usb 3-3: new full-speed USB device number 8 using xhci_hcd
Oct 4 21:49:01 4xybook kernel: [ 5356.571623] usb 3-3: New USB device found, idVendor=2341, idProduct=003d
Oct 4 21:49:01 4xybook kernel: [ 5356.571635] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=220
Oct 4 21:49:01 4xybook kernel: [ 5356.571643] usb 3-3: Product: Arduino Due Prog. Port
Oct 4 21:49:01 4xybook kernel: [ 5356.571649] usb 3-3: Manufacturer: Arduino (www.arduino.cc)
Oct 4 21:49:01 4xybook kernel: [ 5356.571655] usb 3-3: SerialNumber: 75438313633351A07051
Oct 4 21:49:01 4xybook kernel: [ 5356.571923] usb 3-3: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
Oct 4 21:49:01 4xybook kernel: [ 5356.572506] cdc_acm 3-3:1.0: ttyACM0: USB ACM device
Oct 4 21:49:01 4xybook mtp-probe: checking bus 3, device 8: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3"
Oct 4 21:49:01 4xybook mtp-probe: bus: 3, device: 8 was not an MTP device
系统盘
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 8087:07da Intel Corp.
Bus 001 Device 003: ID 064e:c336 Suyin Corp.
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 152d:0567 JMicron Technology Corp. / JMicron USA Technology Corp.
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 008: ID 2341:003d Arduino SA
Bus 003 Device 002: ID 1a2c:0e24 China Resource Semico Co., Ltd
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
strace 给出了这个。
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99988})
read(4, "", 1024) = 0
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99992})
read(4, "", 1024) = 0
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99994})
read(4, "", 1024) = 0
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99994})
read(4, "", 1024) = 0
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99995})
read(4, "", 1024) = 0
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99994})
read(4, "", 1024) = 0
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99994})
read(4, "", 1024) = 0
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99995})
read(4, "", 1024) = 0
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99995})
read(4, "", 1024) = 0
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99996})
read(4, "", 1024) = 0
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99995})
read(4, "", 1024) = 0
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99995})
read(4, "", 1024) = 0
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99995})
它无限期地轮询描述符。select = 1 表示有数据,但 read 返回 0。似乎底层的某些东西坏了……可能是因为系统更新(
任何帮助将非常感激。
答案1
将内核从 3.13.0-66-generic 升级到 3.13.0-67-generic 似乎可以解决问题。