Environment:
- I’m using MacOS 12.5.1 with chipwhisperer running on Virtualbox.
- Current chipwhisperer version: 5.5.0
I’m trying to update it to 5.6.1 or later version and at first, I followed the instruction in Scope API — ChipWhisperer 5.7.0 documentation.
Following code is run:
import chipwhisperer as cw
scope = cw.scope()
programmer = cw.SAMFWLoader(scope=scope)
programmer.auto_program()
The response:
Entering bootloader mode...
Please wait until the Chipwhisperer shows up as a serial port. Once it has, call the program(COMPORT, FWPATH) to program the Chipwhisperer
Default firmware can be found at chipwhisperer/hardware/capture/chipwhisperer-lite/sam3ufw/SAMBUVendorExample/Debug/SAM3U CW1173.bin
Detected com port /dev/ttyACM1
Loading cwlite firmware...
Opened!
Connecting...
---------------------------------------------------------------------------------------------
PermissionError Traceback (most recent call last)
...
SerialException: [Errno 13] could not open port /dev/ttyACMl: (Errno 13] Permission denied: '/dev/ttyACM1'
Then, I change the permission of the corresponding port by
%%bash
sudo chmod 666 /dev/ttyACM1
And do the auto_program again
programmer = cw.SAMFWLoader(scope=scope)
programmer.auto_program()
And I received “USBError: [Errno 19] No such device (it may have been disconnected)”. I think the reason was that CWLite has already entered bootloader mode. But I didn’t realize then and I try unplug and plug in again. After that, I can’t find the port address (/dev/ttyxxx) anymore and gets stuck in bootloader mode with CWLite having dim red and blue light now…
So far, I have tried:
1.
import chipwhisperer as cw
programmer = cw.SAMFWLoader (scope=None)
programmer.program("/dev/ttyACM1', hardware_type='cwlite')
And the response is as following:
Loading cwlite firmware...
Opened!
Connecting...
---------------------------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
...
SerialException: [Errno 2] could not open port /dev/ttyACM1: [Errno 2] No such file or directory: '/dev/ttyACM1 '
-
I have also checked CW1173 ChipWhisperer-Lite - NewAE Hardware Product Documentation, but the command “sudo modprobe usbserial vendor=0x3eb product=0x6124” is not available on MacOS terminal.
-
Try to restart the laptop, and see if the result of “ls /dev/tty*” is different before and after plug in CWLite. But the result is the same. (Seems like the CWLite wasn’t detected?) There also wasn’t “Atmel Corp. at91sam SAMBA bootloader [0110]” shown in VirtualBox > Devices > USB anymore (I’ve seen it in the beginning when dealing with Permission denied issue)
-
I have also tried the following code from https://forum.newae.com/t/after-reseting-the-firmware-the-usb-device-is-not-found-anymore/2599/6:
def get_at91_ports():
from serial.tools import list_ports
at91_ports = [port.device for port in list_ports.comports() if (port.vid, port.pid) == (0x03EB, 0x6124)]
return at91_ports
import chipwhisperer as cw
def program_sam_firmware(hardware_type=None):
at91_ports = get_at91_ports()
if len(at91_ports) == 0:
raise OSError("Could not find bootloader serial port, please see https://chipwhisperer.readthedocs.io/en/latest/firmware.html")
if len(at91_ports) > 1:
raise OSError("Found multiple bootloaders, please specify com port. See https://chipwhisperer.readthedocs.io/en/latest/firmware.html")
serial_port = at91_ports[0]
print("Found {}".format(serial_port))
prog = cw.SAMFWLoader(None)
prog.program(serial_port, hardware_type=hardware_type)
program_sam_firmware("cwlite")
And I got “OSError: Could not find bootloader serial port, please see Updating Firmware — ChipWhisperer 5.7.0 documentation”
Could anyone help or have any suggestion? I have no idea how to deal with this…