I am performing clock glitch attack on cw305. The bitstream uploaded is doing some DNN computation. Below is the code snippet i am running to inject glitch:
target.usb_clk_setenabled(1)
#Basic setup
scope.glitch.clk_src = "clkgen" # set glitch input clock
scope.glitch.output = "clock_xor" # glitch_out = clk ^ glitch
scope.glitch.trigger_src = "continuous" # glitch only after scope.arm() called
scope.glitch.width = -3
scope.glitch.offset = -27
scope.io.hs2 = "glitch" # output glitch_out on the clock line
scope.io.glitch_lp = False
print(scope.glitch)
def reboot_flush():
scope.io.nrst = False
time.sleep(0.05)
scope.io.nrst = "high_z"
time.sleep(0.05)
#Flush garbage too
target.flush()
for i in range(20):
ret = cw.capture_trace(scope, target, knownkey, knownkey)
if(ret):
print(ret.textout.hex())
else:
reboot_flush()
After some successful glitch, i see some errors like following:
(ChipWhisperer Scope WARNING|File __init__.py:500) Target did not finish operation
(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:642) Timeout in OpenADC capture(), no trigger seen! Trigger forced, data is invalid. Status: 07
(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:642) Timeout in OpenADC capture(), no trigger seen! Trigger forced, data is invalid. Status: 04
(ChipWhisperer Scope WARNING|File __init__.py:500) Target did not finish operation
(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:642) Timeout in OpenADC capture(), no trigger seen! Trigger forced, data is invalid. Status: 07
(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:642) Timeout in OpenADC capture(), no trigger seen! Trigger forced, data is invalid. Status: 04
(ChipWhisperer Scope WARNING|File __init__.py:500) Target did not finish operation
(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:642) Timeout in OpenADC capture(), no trigger seen! Trigger forced, data is invalid. Status: 07
(ChipWhisperer Scope WARNING|File _OpenADCInterface.py:642) Timeout in OpenADC capture(), no trigger seen! Trigger forced, data is invalid. Status: 04
(ChipWhisperer Scope WARNING|File __init__.py:500) Target did not finish operation
After that even I have to restart the FPGA, load bitstream again to work with it even if i change the scope to no glitch. How can I solve that?