After reseting the firmware the USB device is not found anymore

My ChipWhisperer-Lite stoped working so I tried to reset its firmware by shorting JP2 while the Lite was on. After shorting the pins, I unplugged and replugged the USB connector and now ,I can see D2 and D9 diodes lit dimly everytime I connect it to my PC.

However the USB is not recognized anymore. When I use the next commands:


import chipwhisperer as cw
scope = cw.scope()

I get the error:


OSError Traceback (most recent call last)
in
1 import chipwhisperer as cw
----> 2 scope = cw.scope()

c:\users\asizu\chipwh~1\git\home\portable\chipwhisperer\software\chipwhisperer_init_.py in scope(scope_type, sn)
226 from chipwhisperer.common.utils.util import get_cw_type
227 if scope_type is None:
–> 228 scope_type = get_cw_type(sn)
229 scope = scope_type()
230 try:

c:\users\asizu\chipwh~1\git\home\portable\chipwhisperer\software\chipwhisperer\common\utils\util.py in get_cw_type(sn)
501 name = “”
502 if len(possible_sn) == 0:
–> 503 raise OSError(“USB Device not found. Did you connect it first?”)
504
505 if (len(possible_sn) > 1):

OSError: USB Device not found. Did you connect it first?

How can I solve this? I tried to uninstall from the device manager and the right drivers for windows are installed also. I have no clue of what is happening.

Hi,

You’ll need to program new firmware onto your Lite before you can connect to it again.

Try the following code:

import chipwhisperer as cw
def program_sam_firmware(hardware_type=None):
    at91_ports = cw.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")

Alex

Hi, thanks for the answer. I tried to run your code, but I got the next error:

AttributeError Traceback (most recent call last)
in
12 prog.program(serial_port, hardware_type=hardware_type)
13
—> 14 program_sam_firmware(“cwlite”)

in program_sam_firmware(hardware_type)
1 import chipwhisperer as cw
2 def program_sam_firmware(hardware_type=None):
----> 3 at91_ports = cw.get_at91_ports()
4 if len(at91_ports) == 0:
5 raise OSError(“Could not find bootloader serial port, please see https://chipwhisperer.readthedocs.io/en/latest/firmware.html”)

AttributeError: module ‘chipwhisperer’ has no attribute ‘get_at91_ports’

Whoops, sorry, that function is on an upcoming update. Try this:

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")

It worked! Thank you so much really :slight_smile:

Happy to help :slight_smile:

Alex

hello, i used this code but it doesn’t work. Can you help me.
I always had these errors: raise OSError(“Could not find bootloader serial port, please see https://chipwhisperer.readthedocs.io/en/latest/firmware.html”)

What OS are you running? Are you running a VM?

Alex

hello
I use the debian OS. i’m installed the chipwhisperer in my debian machine.

What do your udev rules look like? Is there an entry for the atmel bootloader? This is present in the current 50-newae.rules, but wasn’t present in older versions.

Alex

I am getting the same error. My full error message is:
import chipwhisperer as cw
scope = cw.scope()

OSError Traceback (most recent call last)
Input In [1], in
1 import chipwhisperer as cw
----> 2 scope = cw.scope()

File e:\chipwhisperer\software\chipwhisperer_init_.py:335, in scope(scope_type, name, sn, idProduct, bitstream, force, prog_speed, **kwargs)
332 raise ValueError
334 if scope_type is None:
→ 335 scope_type = get_cw_type(**kwargs)
336 rtn : scopes.ScopeTypes = scope_type()
337 try:

File e:\chipwhisperer\software\chipwhisperer\common\utils\util.py:520, in get_cw_type(sn, idProduct, hw_location, **kwargs)
517 possible_ids = [0xace0, 0xace2, 0xace3, 0xace5]
519 cwusb = NAEUSB_Backend()
→ 520 device = cwusb.find(serial_number=sn, idProduct=possible_ids, hw_location=hw_location)
521 name = device.getProduct()
522 cwusb.usb_ctx.close()

File e:\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py:329, in NAEUSB_Backend.find(self, serial_number, idProduct, hw_location)
327 dev_list = self.get_possible_devices(idProduct, attempt_access=(not hw_location))
328 if len(dev_list) == 0:
→ 329 raise OSError(“Could not find ChipWhisperer. Is it connected?”)
331 # if more than one CW, we require a serial number
332 if hw_location:

OSError: Could not find ChipWhisperer. Is it connected?

When I try and run the following in python, I get the error:
import chipwhisperer as cw
cw.program_sam_firmware(hardware_type=‘cwlite’)

Traceback (most recent call last):
File “”, line 1, in
File “e:\chipwhisperer\software\chipwhisperer_init_.py”, line 96, in program_sam_firmware
raise OSError(“Could not find bootloader serial port, please see Updating Firmware — ChipWhisperer 5.6.1 documentation”)
OSError: Could not find bootloader serial port, please see Updating Firmware — ChipWhisperer 5.6.1 documentation

When I use your code (both versions) I get an invalid syntax error on the last line.

This is on native Win10.

My CW has the dim blue and red lights. This all occurred after I attempted to run:
import chipwhisperer as cw
scope = cw.scope()
scope.upgrade_firmware()

I have been unable to use any commands to flash new firmware on the device. When I use scope = cw.scope() it asks me if the chipwhisperer is plugged in now.

Any help would be greatly appreciated.

Hi,

If you open Device Manager, do you see a section called Ports (COM & LPT)? If so, do you see a device called AT91 USB to Serial Converter? It should look something like this:

image

Alex

I do not. There is nothing between my network adaptors and my Print Queuer.

Do you have your ChipWhisperer attached directly to the PC (i.e. through a USB hub or similar)? Also, if you’ve got another USB cable lying around, can you try switching the cables out?

Alex

Alex,

I have it connected directly to the PC using the USB cable. I have tried two cables now. When I plug it in my computer does not indicate that anything has been connected and the indicator lights stay dimly lit red and blue.

Do you remember how you deleted the firmware in the first place? Was it by trying to do scope.upgrade_firmware(), you did you short the erase pins on the device? If you haven’t shorted
the erase pins yet, try plugging in the ChipWhisperer and doing that, then unplugging+replugging.

Alex

It was by using scope.upgrade_firmware(). I will try the erase pins now. Do you have a proper page that lists the instructions for that? I have been clicking links for about 20 minutes now trying to find the instructions but I cannot seem to find them.

We’ve got CW1173 ChipWhisperer-Lite - NewAE Hardware Product Documentation. All you need to do is have those pins shorted when it’s plugged in, then do an unplug+replug.

Thank you. I also faced this issue. Now it has cleared.