Updating CW1200

Hi!

I tried to update the firmware for cw1200 and got the following error:

cw.program_sam_firmware(hardware_type=‘cw1200’)
Found /dev/ttyACM0
Loading cw1200 firmware…
Opened!
Connecting…
Connected!
Erasing…
Erased!
Programming file CW1200_SAM3UFW.bin…
Programmed!
Verifying…
(ChipWhisperer Target WARNING|File bootloader_sam3u.py:507) Verify failed at 0 (got bytearray(b’\xd0’) expected b’\xd00\x08 U\xaa\x08\x00\xf1\xb1\x08\x00\x01\x07\x08\x00\x15\x07\x08\x00)\x07\x08\x00=\x07\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\x00\x00\x00\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xed\x94\x08\x00\xfd\x94\x08\x00\r\x95\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xc54\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1#\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xf1\xb1\x08\x00\xad\x98\x08\x00\xf1\xb1\x08\x00\x10\xb5\x05L#x3\xb9\x04K\x13\xb1\x04H\xaf\xf3\x00\x80\x01##p\x10\xbdP\x16\x00 \x00\x00\x00\x00\xbca\t\x00\x08\xb5\x03K\x1b\xb1\x03I\x03H\xaf\xf3\x00\x80\x08\xbd\x00\x00\x00\x00T\x16\x00 \xbca\t\x00\x04K\x05J’)
Verify FAILED!

Thanks and best regards!

Hi,

I don’t think we’ve seen that error before. It seems like the first read is returning fewer bytes than expected. Looking at the bootloader code, I can see that, due to a SAM3U bug, this is done by first doing a read of 1 byte, then doing a read of 255 bytes. I’m guessing that this first read is working, but the subsequent one fails for some reason.

Can you try changing this line to timeout=30: chipwhisperer/software/chipwhisperer/hardware/naeusb/bootloader_sam3u.py at develop · newaetech/chipwhisperer · GitHub. This should either fix the issue, or block for 30 seconds (presumably the read won’t happen at all).

Alex

I changed the timeout and got the same output. Any other ideas? :wink:

I’m not too sure then. This might be related to other serial issues that we’ve seen on Linux - some people will have the serial port open call hang instead. If you do have another PC lying around, you could try that. You might also want to try using a different USB port/cable.

You could also try commenting out lines 409-412 here: chipwhisperer/software/chipwhisperer/hardware/naeusb/bootloader_sam3u.py at develop · newaetech/chipwhisperer · GitHub. I forgot to mention this earlier, but if you’re running this through a Jupyter Notebook, you’ll need to restart the notebook for your changes to take effect.

Unfortunately, this is a pretty tough issue for us to debug, as the code being used isn’t ours - the bootloader was written by Atmel and all the serial stuff is handled by Linux. I also haven’t been able to replicate the issue.

Alex

Thank you, the problem was solved by using another PC. In addition, previously a VM on VirtualBox was used, and now I used a baremetal installation. It was probably a latency issue. Regards!