Bricked Ballisticgel microcontroller CW521

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:


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 Your firmware is outdated - latest is 2.0. Suggested to update firmware, as you may experience errors 

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 ?


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.


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 ?

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.


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


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.