Tsunami
donbindner
—
2015-08-27T13:37:39Z —
#1
I am pulling my hair out on this Tsunami. I think I'm having an issue with the bootloader, and I wonder if an alternate bootloader might be available or help.
I'm running Ubuntu trusty.
$ uname -a
Linux anna 3.13.0-62-generic #102-Ubuntu SMP Tue Aug 11 14:28:35 UTC 2015 i686 i686 i686 GNU/Linux
The initial self-test ran on my board, and I could view the results from the Serial Monitor or minicom, but I couldn't program my Tsunami over USB. I eventually pulled the Tsunami board from the enclosure and used the SPI header to reload the bootloader. After that, I loaded the 400Hz sketch using the Arduino environment, and it put out a beautiful sine wave.
But again I found that I could no longer program sketches to the board. It seems I only get to use the bootloader one time, and after that it won't work again. I've saved the dmesg output from a successful iteration and the subsequent failure, as well as the verbose output from the Arduino environment.
First I loaded the bootloader using my ft232r ISP. I didn't change any of the fuse settings, because they should be fine from the original programming.
BOOTLOADER=~dbindner/.arduino15/packages/arachnidlabs/hardware/avr/1.0.0/bootloaders/caterina/Caterina-tsunami.hex
avrdude -p atmega32u4 -c arduino-ft232r -F -e
avrdude -p atmega32u4 -c arduino-ft232r -F -D -U flash:w:$BOOTLOADER
When I plug in the board with just the Bootloader and no program, these kernel messages are generated.
[43677.570498] usb 3-2: new full-speed USB device number 88 using xhci_hcd
[43677.588560] usb 3-2: New USB device found, idVendor=1209, idProduct=1ab6
[43677.588572] usb 3-2: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[43677.588579] usb 3-2: Product: Tsunami Bootloader
[43677.588584] usb 3-2: Manufacturer: Arachnid Labs
[43677.588879] usb 3-2: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[43677.589320] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
When I program the first sketch, it goes like this:
Sketch uses 6,298 bytes (21%) of program storage space. Maximum is 28,672 bytes.
Global variables use 183 bytes of dynamic memory.
Forcing reset using 1200bps open/close on port /dev/ttyACM0
PORTS {/dev/ttyACM0, } / {/dev/ttyACM0, } => {}
PORTS {/dev/ttyACM0, } / {/dev/ttyACM0, } => {}
Uploading using selected port: /dev/ttyACM0
/usr/local/arduino-1.6.5/hardware/tools/avr/bin/avrdude -C/usr/local/arduino-1.6.5/hardware/tools/avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D -Uflash:w:/tmp/build7128843324605344606.tmp/_440hz.cpp.hex:i
avrdude: Version 6.1, compiled on Aug 26 2015 at 22:30:10
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/usr/local/arduino-1.6.5/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/home/dbindner/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM0
Using Programmer : avr109
Overriding Baud Rate : 57600
AVR Part : ATmega32U4
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 9000 9000 0x00 0x00
flash 65 6 128 0 yes 32768 128 256 4500 4500 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : butterfly
Description : Atmel AppNote AVR109 Boot Loader
Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.
Programmer supports the following devices:
Device code: 0x44
avrdude: devcode selected: 0x44
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9587
avrdude: reading input file "/tmp/build7128843324605344606.tmp/_440hz.cpp.hex"
avrdude: writing flash (6298 bytes):
Writing | ################################################## | 100% 0.48s
avrdude: 6298 bytes of flash written
avrdude: verifying flash memory against /tmp/build7128843324605344606.tmp/_440hz.cpp.hex:
avrdude: load data flash data from input file /tmp/build7128843324605344606.tmp/_440hz.cpp.hex:
avrdude: input file /tmp/build7128843324605344606.tmp/_440hz.cpp.hex contains 6298 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.05s
avrdude: verifying ...
avrdude: 6298 bytes of flash verified
avrdude done. Thank you.
If I unplug the Tsunami and plug it in again, I notice that the second time there is a new kernel message about an HID device and something about being not a modem. I don't know if this has anything to do with my problem.
[43836.465383] usb 3-2: new full-speed USB device number 90 using xhci_hcd
[43836.484996] usb 3-2: New USB device found, idVendor=1209, idProduct=1ab5
[43836.485008] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[43836.485014] usb 3-2: Product: Tsunami
[43836.485019] usb 3-2: Manufacturer: Arachnid Labs
[43836.485852] cdc_acm 3-2:1.0: This device cannot do calls on its own. It is not a modem.
[43836.485906] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
[43836.488968] input: Arachnid Labs Tsunami as /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.2/input/input71
[43836.489482] hid-generic 0003:1209:1AB5.0041: input,hidraw0: USB HID v1.01 Mouse [Arachnid Labs Tsunami] on usb-0000:00:14.0-2/input2
Now it can't be programmed via USB. I won't be able to program it again until I reflash the bootloader. Always "device or resource busy."
Sketch uses 6,298 bytes (21%) of program storage space. Maximum is 28,672 bytes.
Global variables use 183 bytes of dynamic memory.
Forcing reset using 1200bps open/close on port /dev/ttyACM0
PORTS {/dev/ttyACM0, } / {} => {}
PORTS {} / {/dev/ttyACM0, } => {/dev/ttyACM0, }
Found upload port: /dev/ttyACM0
/usr/local/arduino-1.6.5/hardware/tools/avr/bin/avrdude -C/usr/local/arduino-1.6.5/hardware/tools/avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D -Uflash:w:/tmp/build7128843324605344606.tmp/_440hz.cpp.hex:i
avrdude: Version 6.1, compiled on Aug 26 2015 at 22:30:10
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/usr/local/arduino-1.6.5/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/home/dbindner/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM0
Using Programmer : avr109
Overriding Baud Rate : 57600
avrdude: ser_open(): can't open device "/dev/ttyACM0": Device or resource busy
avrdude done. Thank you.
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
I tried it as root, after unplugging and reinserting the USB. It doesn't give resource busy, but it still fails in this way:
Sketch uses 6,298 bytes (21%) of program storage space. Maximum is 28,672 bytes.
Global variables use 183 bytes of dynamic memory.
Forcing reset using 1200bps open/close on port /dev/ttyACM0
PORTS {/dev/ttyACM0, } / {} => {}
PORTS {} / {/dev/ttyACM0, } => {/dev/ttyACM0, }
Found upload port: /dev/ttyACM0
/usr/local/arduino-1.6.5/hardware/tools/avr/bin/avrdude -C/usr/local/arduino-1.6.5/hardware/tools/avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D -Uflash:w:/tmp/build4777046166339696157.tmp/_440hz.cpp.hex:i
avrdude: Version 6.1, compiled on Aug 26 2015 at 22:30:10
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/usr/local/arduino-1.6.5/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/home/dbindner/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM0
Using Programmer : avr109
Overriding Baud Rate : 57600
AVR Part : ATmega32U4
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 9000 9000 0x00 0x00
flash 65 6 128 0 yes 32768 128 256 4500 4500 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : butterfly
Description : Atmel AppNote AVR109 Boot Loader
Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=13 bytes.
Programmer supports the following devices:
Device code: 0x44
Device code: 0x0d
I'm not sure what other information I might provide.
donbindner
—
2015-08-29T05:17:21Z —
#2
I still haven't solved this, but I think the underlying cause is that my Dell XPS laptop has USB 3.0 ports. I've had glitches in the past with select devices not working with them and have always suspected driver support (under Linux).
I'll have to try the Tsunami on another physical computer I guess. And I'll have to play around with different kernels on my XPS. Maybe a 2.0 hub can help. Some other poeple have had luck with that sometimes.
I'm not particularly optimistic, except that I bet I can use my Tsunami with other computers once I try that. I really hate USB 3.0. It hasn't brought me anything worthwhile.
nickjohnson
—
2015-08-29T13:31:25Z —
#3
Hi Don,
Sorry you're running into trouble.
After flashing the bootloader and programming it once, what happens if you press the reset button on the Tsunami? If the bootloader is still intact, it should go into bootloader mode, and the onboard LED should 'breathe' for 8 seconds. If it does, you may be able to program it during that interval.
-Nick
donbindner
—
2015-08-29T18:37:48Z —
#4
I did of course try the reset button right away, since I've had to program other devices that way. But for this it doesn't work. I get the same kinds of errors and timeouts that I do other ways.
I did try my Tsunami this morning on an old Dell Inspiron 6000 laptop running:
$ uname -a
Linux kd0pgm 3.2.0-4-686-pae #1 SMP Debian 3.2.65-1+deb7u2 i686 GNU/Linux
On that old laptop everything is slow, but except for one glitch I can program the Tsunami pretty much as many times as I want. So I'd say the Inspiron 6000 is about 95% reliable. The XPS is about 1% reliable.
I haven't tried new/old kernels yet on my XPS but I suppose that is the next step. And a hub. I have try a hub.
donbindner
—
2015-08-31T02:30:29Z —
#5
Somewhere I found a suggestion that a BIOS update, and an update is available. Dell has made it absolutely impossible to get this BIOS update installed under Linux. I can't count the hours I've worked on trying to do it.
So, I don't know if I have a fix. I do know that I'm probably never buying another Dell.
donbindner
—
2015-08-31T05:26:13Z —
#6
My friends helped walk me through the Dell BIOS update. That wasn't it. I did get the BIOS updated.
I also got upgraded from a Linux 3.13.0 kernel to a Linux 3.19.0 kernel. That didn't fix it.
Somehow, tonight, I came across a thread where it was suggested that modemmanager might be grabbing the /dev/ttyACM0 device and causing contention.
So I uninstalled modemmanager (don't know why I had it at all) and suddenly, my Tsunami is talking to my computer.
I'll have to test it more carefully tomorrow, but it's working like it hasn't worked yet, so I think there's good reason to be optimistic.
nickjohnson
—
2015-08-31T10:15:09Z —
#7
Thanks for keeping us up to date on your debugging, and sorry for all the trouble. Looks like that's something we should add to the FAQ, once there is one.
donbindner
—
2015-08-31T12:19:43Z —
#8
I feel confident that this fixed my issues. I've played around with it again some this morning, and also with an Arduino Uno board that wasn't completely reliable. Both work perfectly now.
I realize now that my first hint of a problem was with the Tsunami Self Test. It would often cycle through the test over and over as if I were hitting enter, even when I didn't. I suppose that also was because of the interaction with modemmanager.
I put the selftest back on this morning, and there was no cycling. Everything now behaves as it should.