Hello everyone,
I’m having a problem programming my CW308T-FE310.
According to this site : CW308T-FE310 - NewAE Hardware Product Documentation
, I should be using the following command :
chipwhisperer/openocd/run_openocd.sh -p /path/to/fw.elf husky jtag -- -f "fe310.cfg"
Which I did and got the following error :
bash: ligne 1: -s : commande introuvable
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/alkafa/chipwhisperer/software/chipwhisperer/__init__.py", line 387, in scope
rtn.con(**kwargs)
File "/home/alkafa/chipwhisperer/software/chipwhisperer/capture/scopes/OpenADC.py", line 625, in con
self.scopetype.con(sn, idProduct, bitstream, force, prog_speed, **kwargs)
File "/home/alkafa/chipwhisperer/software/chipwhisperer/capture/scopes/openadc_interface/naeusbchip.py", line 64, in con
found_id = self.ser.con(idProduct=nae_products, serial_number=sn, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alkafa/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py", line 696, in con
self.usbtx.open(idProduct=idProduct, serial_number=serial_number, connect_to_first=True, hw_location=hw_location)
File "/home/alkafa/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py", line 392, in open
self.handle.claimInterface(0)
File "/home/alkafa/.pyenv/versions/cw/lib/python3.11/site-packages/usb1/__init__.py", line 1146, in claimInterface
mayRaiseUSBError(
File "/home/alkafa/.pyenv/versions/cw/lib/python3.11/site-packages/usb1/__init__.py", line 127, in mayRaiseUSBError
__raiseUSBError(value)
File "/home/alkafa/.pyenv/versions/cw/lib/python3.11/site-packages/usb1/__init__.py", line 119, in raiseUSBError
raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
usb1.USBErrorBusy: LIBUSB_ERROR_BUSY [-6]
Now, error -6 in libusb1 means that the device is busy.
To fix this, I tried editing the naeusb.py file that calls the self.handle.claimInterface(0)
that provokes the error by adding self.handle.claimInterface(0)
just before, this soultion was suggested in here :
Unfortunately, this just made the error become :
bash: ligne 1: -s : commande introuvable
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/alkafa/chipwhisperer/software/chipwhisperer/__init__.py", line 387, in scope
rtn.con(**kwargs)
File "/home/alkafa/chipwhisperer/software/chipwhisperer/capture/scopes/OpenADC.py", line 625, in con
self.scopetype.con(sn, idProduct, bitstream, force, prog_speed, **kwargs)
File "/home/alkafa/chipwhisperer/software/chipwhisperer/capture/scopes/openadc_interface/naeusbchip.py", line 64, in con
found_id = self.ser.con(idProduct=nae_products, serial_number=sn, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alkafa/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py", line 696, in con
self.usbtx.open(idProduct=idProduct, serial_number=serial_number, connect_to_first=True, hw_location=hw_location)
File "/home/alkafa/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py", line 391, in open
self.handle.releaseInterface(0)
File "/home/alkafa/.pyenv/versions/cw/lib/python3.11/site-packages/usb1/__init__.py", line 1155, in releaseInterface
mayRaiseUSBError(
File "/home/alkafa/.pyenv/versions/cw/lib/python3.11/site-packages/usb1/__init__.py", line 127, in mayRaiseUSBError
__raiseUSBError(value)
File "/home/alkafa/.pyenv/versions/cw/lib/python3.11/site-packages/usb1/__init__.py", line 119, in raiseUSBError
raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
usb1.USBErrorNotFound: LIBUSB_ERROR_NOT_FOUND [-5]
Error -5 means that the entity was not found.
I really don’t know what to do at this point, the device is well connected, I ran the setup_generic script and got the message that says that the CW is found.
Also, I got really curious and checked the code of init.py in which the function self.handle.claimInterface(0)
is defined and found the following :
def claimInterface(self, interface):
"""
Claim (= get exclusive access to) given interface number. Required to
receive/send data.
Can be used as a context manager:
with handle.claimInterface(0):
# do stuff
# handle.releaseInterface(0) gets automatically called
"""
mayRaiseUSBError(
libusb1.libusb_claim_interface(self.__handle, interface),
)
return _ReleaseInterface(self, interface)
And code for mayRaiseError
is :
def mayRaiseUSBError(
value,
# Avoid globals lookup on call to work during interpreter shutdown.
__raiseUSBError=raiseUSBError,
):
if value < 0:
__raiseUSBError(value)
return value
It seems to me that calling claimInterface(0)
sends 0 to mayRaiseUSBError
in which we compare it to 0. In Pyhton 0<0 is returns False, therefore __raiseUSBError(value)
shouldn’t be executed, yet it is executed (as it seems)
Any ideas ?
Thanks in advance,