Failed to update ChipWhisperer firmware, stuck on bootloader

I was following the directions posted here: app.assembla.com/spaces/chipwhi … re_(CW1173

I am trying to use the ChipWhiserer Lite board with the latest code from git, and it said the firmware was out of date. So I downloaded and installed BOSSA.

On both Linux and Windows, BOSSA won’t connect to the device, and auto-scan fails. I tried both as a regular user and Administrator/root. On the Windows Device Manager, I would see that BOSSA installed a port as COM4, but it would not connect to it. I don’t know how to proceed. It seems BOSSA only expects a serial connection, but CWLite is USB.

NewAE’s verison of BOSSA from github.com/newaetech/bossa isn’t able to find the CWLite board either.

I made a /dev/ttyUSB0 symbolic link which points to the correct USB ID, which I found with udev. I added a rule in udev so that a symlink is created in /dev/ for the device. My CWLite udev rules:

SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="6124", MODE="0664", GROUP="plugdev", SYMLINK+="CWLiteBoot" SUBSYSTEM=="usb", ATTRS{idVendor}=="2b3e", ATTRS{idProduct}=="ace2", MODE="0664", GROUP="plugdev", SYMLINK+="CWLite"

So on my system, /dev/CWLiteBoot and /dev/ttyUSB0 point to /dev/bus/usb/003/009. Kernel is 4.4.0 on Ubuntu 16.04 64-bit.

Try to follow the instructions in the new wiki:
wiki.newae.com/Main_Page

Older instructions: newae.com/sidechannel/cwdocs/na … with-bossa
and newer instructions: wiki.newae.com/Manual_SAM3U_Firmware_Update
both say the same thing, and instruct the reader to use BOSSA. Sorry to say, BOSSA doesn’t work as it should. I’ll try on a Mac, maybe OS X will be better.

Windows 7 wouldn’t see the device on COM4, I described my Linux problems above, and Windows 10 wouldn’t let the installer complete (probably because the driver isn’t signed).

Update: I found the Atmel utility for flashing their chips. It does find the board at /dev/ttyACM0, and identifies it as at91cap9-dk_mem18. Is that correct? Atmel utility: atmel.com/tools/atmelsam-bai … ammer.aspx

Hi Richard555,

Sorry for the problems - things “should just work”. Can you confirm the erase worked correctly? Basically you see the two LEDs are dimmly lit?

If so it should enumerate as the USB-Serial adapter. BOSSA expects a serial connection, as it assumes any of the USB devices are enumerating and installing the serial driver. Can you post the dmesg output when you plug it in? It’s possible on Linux it’s loading an incorrect module for some reason.

-Colin

The lights are dimly lit blue and red, as described.

$ lsusb:

Bus 003 Device 009: ID 03eb:6124 Atmel Corp. at91sam SAMBA bootloader

$ dmesg | grep USB

... [ 5919.634843] usb 3-11: new high-speed USB device number 7 using xhci_hcd [ 5919.763406] usb 3-11: New USB device found, idVendor=2b3e, idProduct=ace2 [ 5919.763412] usb 3-11: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 5943.180212] usb 3-8: USB disconnect, device number 3 [ 6027.472533] usb 3-11: USB disconnect, device number 7 [ 6030.906286] usb 3-11: new high-speed USB device number 8 using xhci_hcd [ 6031.034542] usb 3-11: New USB device found, idVendor=03eb, idProduct=6124 [ 6031.034548] usb 3-11: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 6031.586073] cdc_acm 3-11:1.0: ttyACM0: USB ACM device [ 6031.586344] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters [ 6151.763243] usb 3-11: USB disconnect, device number 8 [ 6351.432776] usb 3-11: new high-speed USB device number 9 using xhci_hcd [ 6351.561013] usb 3-11: New USB device found, idVendor=03eb, idProduct=6124 [ 6351.561019] usb 3-11: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 6351.561529] cdc_acm 3-11:1.0: ttyACM0: USB ACM device ...

$ ls -lah /dev/ttyACM0

crw-rw---- 1 root dialout 166, 0 Jan 10 21:46 /dev/ttyACM0

I found a forum thread talking about an issue with the cdc-acm kernel module. This module is for USB modems, yet the kernel uses it for the Atmel boards, including the ChipWhisperer Lite in bootloader mode. I followed the instructions at avrfreaks.net/comment/735171#comment-735171.

I blacklisted cdc_acm, rebooted. Now, dmesg reports:[ 187.725394] usb 3-11: new high-speed USB device number 4 using xhci_hcd [ 187.853627] usb 3-11: New USB device found, idVendor=03eb, idProduct=6124 [ 187.853633] usb 3-11: New USB device strings: Mfr=0, Product=0, SerialNumber=0

Bossa didn’t see the tty, and there isn’t a ttyACM0 anymore. I made a symlink /dev/ttyUSB0 to /dev/CWLite, which it a symlink to /dev/bus/usb/003/004 and is created by my udev rule above.

Still Bossa is not able to connect to the board, even when run as root.

I did part two of the instructions,$ sudo rm /dev/ttyUSB0 # remove old symlink from above $ lsusb | grep Atmel Bus 003 Device 006: ID 03eb:6124 Atmel Corp. at91sam SAMBA bootloade $ sudo modprobe usbserial vendor=0x03eb product=0x6124 and now dmesg reports:[ 626.999460] usbserial_generic 3-11:1.0: Generic device with no bulk out, not allowed. [ 626.999470] usbserial_generic: probe of 3-11:1.0 failed with error -5 [ 626.999537] usbserial_generic 3-11:1.1: The "generic" usb-serial driver is only for testing and one-off prototypes. [ 626.999540] usbserial_generic 3-11:1.1: Tell linux-usb@vger.kernel.org to add your device to a proper driver. [ 626.999542] usbserial_generic 3-11:1.1: generic converter detected [ 626.999700] usb 3-11: generic converter now attached to ttyUSB0
Now, Bossa takes a lot longer to report that it cannot connect to /dev/ttyUSB0, whereas it would error out immediately. So…progress?

Hello,

Hmm… I have used the cdc-acm before I thought, maybe there was some issue I wasn’t aware of. On Windows does this thing not work either? What’s easiest for you to quickly get back working again?

On the Linux side - what distro are you using (+kernel)? I can try setting up a quick VMWare here to see if I can recreate the cdc-acm error.

Can you try connecting using a terminal emulator (screen etc) to see if you can open a connection? As from BOSSA I guess it could either be (a) a protocol issue or (b) just can’t open the port at all.

FWIW: ChipWhisperer ALSO contains it’s own implementation of the SAM-BA protocol. This is in the later versions, as it removed the requirement to use the BOSSA binary. This might be easier to debug since you can insert print statements right into the Python code, and I may have a better idea of any error messages compared to BOSSA.

Regards,

-Colin

On Linux, I’m using Ubuntu 16.04.1 LTS Kernel 4.4.0-59-generic.
I tried using cutecom/minicom, and wasn’t able to get any response from the board.

I tried on Windows 7 in a VM, and BOSSA wouldn’t connect. I’ll try a Windows 7 workstation next to see if that fixes anything.

I tried Atmel’s Samba app. It sees the device, but pressing “Connect” just makes the app freeze. strace shows it’s stuck on read().

Hi Richard555,

Ah, it’s possible there is something odd with the USB that is screwing up your VM? It “should” just work though.

Do you have a working CW Software install? As using the built-in might be easiest here (available under the “CW Firmware Preferences” --> “Open SAM3U Update Widget”, you must first select a “ChipWhisperer” as the scope type).

But if you’ve got access to a real Windows PC might be worth a shot too - just to confirm if the serial port enumerates OK! If the BOSSA driver isn’t there let me know, I thought I had a signed version elsewhere but I need to go back and check that documentation/link is updated…

-Colin

I was able to get BOSSA & Windows 7 to work! I didn’t use the ChipWhisperer software, since it wouldn’t connect.
I suspect that the VM didn’t work because of the same reason that BOSSA, Atmel Samba didn’t work- some Linux USB serial kernel problem.
I’m just happy to have my CWLite back!