3

I have Arduino Due on SAM3x8e. I'm on Ubuntu 14.04. Before today I uploaded firmware via terminal using those commands:

$ 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

It was good, but now it stopped working. Bossac just hangs up '-d' displays nothing. That is all.

I downloaded arduino IDE 1.6.5, but this doesn't matter. In ide's console I get

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

It sticks, no leds blinking on Arduino board. It seems it actually hangs up, due to it loads 99% of CPU... May be Ubuntu update caused this issue...?

dmesg

[ 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

syslog

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

lsusb

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

Any help would be really appreciated.

Update

strace gives this.

execve("/home/q/apps/devel/arduino/arduino-1.5.7/hardware/tools/bossac", ["/home/q/apps/devel/arduino/ardui"..., "--port=ttyACM0", "-U", "false", "-e", "-w", "-v", "-b", "-d", "/home/q/work/gamekeeper/jackpot-"..., "-R"], [/* 78 vars */]) = 0
brk(0)                                  = 0x22a5000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f468e385000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=169535, ...}) = 0
mmap(NULL, 169535, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f468e35b000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 \266\5\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=979056, ...}) = 0
mmap(NULL, 3159040, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f468de61000
mprotect(0x7f468df47000, 2093056, PROT_NONE) = 0
mmap(0x7f468e146000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe5000) = 0x7f468e146000
mmap(0x7f468e150000, 82944, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f468e150000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260*\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=90080, ...}) = 0
mmap(NULL, 2185952, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f468dc4b000
mprotect(0x7f468dc61000, 2093056, PROT_NONE) = 0
mmap(0x7f468de60000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7f468de60000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\37\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1840928, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f468e35a000
mmap(NULL, 3949248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f468d886000
mprotect(0x7f468da41000, 2093056, PROT_NONE) = 0
mmap(0x7f468dc40000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ba000) = 0x7f468dc40000
mmap(0x7f468dc46000, 17088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f468dc46000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20V\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=1071552, ...}) = 0
mmap(NULL, 3166568, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f468d580000
mprotect(0x7f468d685000, 2093056, PROT_NONE) = 0
mmap(0x7f468d884000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x104000) = 0x7f468d884000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f468e359000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f468e357000
arch_prctl(ARCH_SET_FS, 0x7f468e357780) = 0
mprotect(0x7f468dc40000, 16384, PROT_READ) = 0
mprotect(0x7f468d884000, 4096, PROT_READ) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f468e356000
mprotect(0x7f468e146000, 32768, PROT_READ) = 0
mprotect(0x7f468e387000, 4096, PROT_READ) = 0
munmap(0x7f468e35b000, 169535)          = 0
brk(0)                                  = 0x22a5000
brk(0x22c6000)                          = 0x22c6000
openat(AT_FDCWD, "/dev", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
open("/dev/ttyACM0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 4
ioctl(4, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B9600 opost isig icanon echo ...}) = 0
ioctl(4, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B9600 opost isig icanon echo ...}) = 0
ioctl(4, SNDCTL_TMR_START or SNDRV_TIMER_IOCTL_TREAD or TCSETS, {B115200 -opost -isig -icanon -echo ...}) = 0
ioctl(4, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B115200 -opost -isig -icanon -echo ...}) = 0
nanosleep({0, 500000000}, NULL)         = 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, 99996})
read(4, "", 1024)                       = 0
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99997})
read(4, "", 1024)                       = 0
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99997})
read(4, "", 1024)                       = 0
select(5, [4], NULL, NULL, {0, 100000}) = 1 (in [4], left {0, 99997})
read(4, "", 1024)                       = 0

It indefinitely polls the descriptor. select = 1 means there is a data, but read returns 0. It seems like something on lower level is broken... may be because of system update (

4xy
  • 151
  • 5
  • You could run `bossac` under `strace` and possibly see what it is doing when it hangs, but be prepared for a *flood* of data. Are you able to either try that board on another computer, or try another similar board on this computer? – Chris Stratton Oct 04 '15 at 19:42
  • Which port are you using - the programming port or the native port? – Majenko Oct 04 '15 at 21:01
  • @Chris Stratton I tried another board with the same result ( – 4xy Oct 04 '15 at 21:01
  • @Majenko Same result on both ports. – 4xy Oct 04 '15 at 21:04
  • Have you tried erasing the board? – Majenko Oct 04 '15 at 21:10
  • How exactly? if bossac -e, yes – 4xy Oct 04 '15 at 21:13
  • 1
    From the man page for select() *readfds will be watched to see if characters become available for reading (more precisely, to see if a read will not block; in particu‐ lar, a file descriptor is also ready on end-of-file)* - probably the case since after the first call it starts returning effectively immediately with the timeout unused. You might see if anything is odd in the serial port settings, or use `lsof` to see if anything else has the port open. Trying on another machine (or live USB boot?) would be good too. – Chris Stratton Oct 04 '15 at 22:52
  • @Majenko I havn't seen 'erase' button before), I tried, unfortunately, it doesn't help – 4xy Oct 05 '15 at 19:42
  • Hi Chris, I updated strace log, now it's from begining. `lsof` shows only bossac as port user. Under Ubuntu Live USB bossac returns "No device found". On another windows machine it works – 4xy Oct 05 '15 at 20:35
  • Kernel update resolves the issue. http://askubuntu.com/questions/681555/ubuntu-14-04-arduino-due-upload-firmware-issue – 4xy Feb 17 '16 at 13:59

0 Answers0