I followed the instructions here to update the CW’s firmware:
However, the process totally stuck at here for around 10 minutes:
Loading cwlite firmware…
Shall I wait for a longer time? I am very confused.
It should run in seconds, not minutes. You likely have the wrong device path.
Run the script in the top answer here to find the correct device path:
I am sure that ‘dev/tty.usbmodem14202’ is the correct one since it only appears when I plugin the device. my OS is OSX.
Here is where the code stuck:
File “update_firmware.py”, line 5, in
File “/Users/yudelin/.conda/envs/chipwhisperer/lib/python3.8/site-packages/chipwhisperer/capture/scopes/cwhardware/ChipWhispererSAM3Update.py”, line 268, in program
File “/Users/yudelin/.conda/envs/chipwhisperer/lib/python3.8/site-packages/chipwhisperer/hardware/naeusb/bootloader_sam3u.py”, line 68, in con
res = ser.read(2)
File “/Users/yudelin/.conda/envs/chipwhisperer/lib/python3.8/site-packages/serial/serialposix.py”, line 565, in read
ready, _, _ = select.select([self.fd, self.pipe_abort_read_r], , , timeout.time_left())
This is a bit of a known issue, but, unfortunately I’m not sure what the cause/fix is. From what I’ve seen, this appears to only happen on some computers running Unix OSs. If you’re got another computer around, I’d recommend trying the firmware upgrade on that. You could also try programming with Bossa (BOSSA | shumatech.com) to rule out any issues with Python. You can find the binary for the Lite at
chipwhisperer/hardware/capture/chipwhisperer-lite/sam3u_fw/SAM3U_VendorExample/Debug/SAM3U_CW1173.hex. Make sure you have erase all and boot to flash enabled.
thanks for the suggestion. I try Bossa in windows to do the update; however, the device is still not able to be connected. Now, I don’t know what’s happening.
[Update #1] I tried to use the latest CW 5.6.1 installer in windows to update the firmware. When I call ‘scope.upgrade_firmware()’, I got an error:
SerialException: could not open port ‘’: FileNotFoundError(2, ‘The system cannot find the path specified.’, None, 3)
[Update #2] After I used cw.program_sam_firmware(hardware_type=‘cwlite’) on Windows 10, the error message was gone. Then scope.upgrade_firmware() works. However, the updated CW-Lite did not work properly in the first example, “1 - Connecting to Hardware”. When I wrote the message and want to read the message through “simpleserial_read” api, an warning occured: ChipWhisperer Target: Unexpected start to command.
[Update #3] I reconnected to the updated board to my OSX. There was another error triggered after cw.scope is call: “OSError: [Errno FPGA Done pin failed to go high, bad bitstream?] <zipfile.ZipExtFile [closed]>”. This error did not happen on Windows 10.
After several attempts last week, I figured out why the bug come out. It turns out that OSX can update the firmware correctly. Here is the process I solved the issue:
- Install the latest ChipWhisperer library (5.6.1)
- Erase the firmware by shortening the JP2 pins and unplug the board.
- Replug the board.
- Open a python interactive session and flash firmware by following command:
- Call cw.scope. If you see the meta information of the scope, the firmware is updated correctly.
Note #1: The reason that OSX stucks is because the firmware of the board is not completely erased. Therefore, the OSX is hooked in the serial port. Shortening the JP2 pins is the most direct way to accomplish this. Unfortunately, the old firmware update method doesn’t work for me.
Note #2: If you have a debugger attached to the board, please remove it before update.
Note #3: Corrupted cables between the debugger and CW-Lite will cause error “Errno FPGA Done pin failed to go high, bad bitstream”. Please make sure the cables are in good status.
Hope this can help anyone who encounters the similar issue. And again, many thanks to @Alex_Dewar and @jpthibault . Grateful for your responses and help!