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