Bricked Ballisticgel microcontroller CW521

Hello,
We just recieved the ChipShouter and we wanted to play around with the targets.
When running the code for the ballisticgel with python -m ballisticgel.ballisticgel, the output was Your firmware is outdated - latest is 2.0. Suggested to update firmware, as you may experience errors.

For this reason we tried to update the firmware following the guidance on github: GitHub - newaetech/ChipSHOUTER-ballisticgel: ChipSHOUTER Ballistic Gel

We did the following:

Output:

C:\Users\XXX\ChipSHOUTER-ballisticgel>python -m ballisticgel.ballisticgel                                  

<frozen runpy>:128: RuntimeWarning: 'ballisticgel.ballisticgel' found in sys.modules after import of package 'ballisticgel', but prior to execution of 'ballisticgel.ballisticgel'; this may result in unpredictable behaviour

CW521 Ballistic Gel Example Script
by NewAE Technology Inc 
This script will continue until you exit with Ctrl-C
(ChipWhisperer NAEUSB WARNING|File naeusb.py:511) Your firmware is outdated - latest is 2.0. Suggested to update firmware, as you may experience errors 
See https://chipwhisperer.readthedocs.io/en/latest/api.html#firmware-update 

Settings:                                                                                              Using slow (raw) mode  : False
Showing plot of results: False 
Results filename       : None 
Starting main loop now: 
LOOP START: Writing data to SRAM... 
Hit enter when glitch inserted       

Make the firmware:
- navigate into the cloned folder cd ChipSHOUTER-ballisticgel
- cd firmware/cw521
- git submodule update --init naeusb
- Open a git-bash terminal. cd ChipSHOUTER-ballisticgel/firmware/cw521and run `make

Flash the new firmware:

  • from ballisticgel import CW521
  • >>> cw521 = CW521()
  • >>> cw521.con() (Step very important, otherwise it will raise CW521 object has no attribute 'usb')
  • cw521.upgrade_firmware()

The upgrade failed with an error that said something like “file not found”.

Running python -m ballisticgel.ballisticgel does not detect the target anymore.

At some point the device started showing up differently in the device manager and the heartbeat stopped blinking. The device now shows up as USB Serial Device COM5 and deinstalling the driver per guidance does not do anything. We also tried Atmel studio 7 to program but the microcontroller does not seem to be supported.

How can we flash the target ?

Hi,

You should be able to see a COM port in Device Manager associated with the CW521. It
will probably be listed as AT91 Bootloader or similar. Note the COM port and run the following:

from ballisticgel import SAMFWLoader
prog = SAMFWLoader(scope=None)
prog.program("COMX", hardware_type='cw521')

Where “COMX” is the com port associated with the CW521.

Then unplug and replug the CW521.

Alex

Hello Alex,
Thanks a lot, the steps you described are working and the chip is online again.
Running python -m ballisticgel.ballisticgeldisplays again Invalid driver libusb0 detected.
To fix this I follow the guidance here: Windows Drivers — ChipWhisperer 5.7.0 documentation

When I run python -m ballisticgel.ballisticgel again, I am now in the same situation as before: Your firmware is outdated - latest is 2.0. Suggested to update firmware, as you may experience errors The link in the output is not working. Could you please provide guidance on how to update the firmware for this chip ?
Regards

Honestly, if you’re not running into any issue with the current firmware, I’d recommend just staying on the version that you’re on. Version matching between the actual firmware and the Python was done manually for the CW521, so there might be a mismatch there. I’ll look into it.

Alex

Hello! Thanks for your answer. We ran into a couple of problems actually, the ballisticgel.py base main code using

seed_test_setup()/
seed_test_compare()

wasn’t working at all when glitches were created on the SRAM.
The reason we found was that it called

    def usbdev(self):
        raise AttributeError("Do Not Call Me")

and then the program raises an error and quits as it is instructed to do so.
However raw_test_setup() and raw_test_compare() worked fine (although we had to correct some type errors) so we used this instead.

I don’t really know if this is due to a firmware issue or the code itself, but I am assuming the code was running fine for a previous release of the CW521?

Oh that’s a bug in the code, I’ll get that fixed up for you.

Traceback (most recent call last):
File “/home/aaf9407/.pyenv/versions/3.9.5/lib/python3.9/runpy.py”, line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/home/aaf9407/.pyenv/versions/3.9.5/lib/python3.9/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/home/aaf9407/chipwhisperer/ChipSHOUTER-ballisticgel/ballisticgel/ballisticgel.py”, line 373, in
results = cw521.seed_test_compare()
File “/home/aaf9407/chipwhisperer/ChipSHOUTER-ballisticgel/ballisticgel/ballisticgel.py”, line 204, in seed_test_compare
errorlist.extend(self.read_pattern_rng(i * self.block_size, self.block_size))
File “/home/aaf9407/chipwhisperer/ChipSHOUTER-ballisticgel/ballisticgel/ballisticgel.py”, line 153, in read_pattern_rng
return self.usb.usbdev().read(self.usb.rep, size, timeout=self.usb._timeout)
File “/home/aaf9407/chipwhisperer/ChipSHOUTER-ballisticgel/ballisticgel/naeusb.py”, line 518, in usbdev
raise AttributeError(“Do Not Call Me”)
AttributeError: Do Not Call Me

still same error with upgraded firmware

??
Any updates @Alex_Dewar