Ah sorry, I didn’t realize that the Nano was shown there. The Nano can technically perform the lab, but I highly recommend the Lite because the python API for the Nano is pretty different, meaning you’ll have to make some changes to the setup to get this to work. The glitch is also pretty precise and the Lite can insert much more accurate glitches, in both time and width, so it should make the glitch much more reliable once you get it.
The red LED just lets you know that the ADC on the CW-Lite is unlocked. We’re not using the ADC, so that’s fine here.
The fact that this is working so intermittently kind of makes me think this is a bad connection somewhere, but I could be wrong. Do you mind taking some pictures of your setup so I can see if anything is out of the ordinary?
Also, do you think you can run 'print(scope) just before the block where you try glitching, so I can see if anything is weird in the scope setup?
One thing you can try to debug the glitch itself is to run scope.glitch.manual_trigger() once everything is setup, which should insert a glitch without having to trigger it via the nRST pin.
Since you thought it might be a loose connection I changed the probes. The probes I used have 0.3mm pin spring. These new ones are a little heavier duty and the probes they have a little more weight too.
If you change your oscilloscope to trigger on the power trace instead of on the reset pin, do you see a glitch? What about if you try running through with a freq_multiplier of 0.5?
After running the setup portions of the lab I ran this
nxpdev = CWDevice(scope, target, print_debug=True)
#Need to enter ISP mode before initializing programmer object
nxpdev.isp_mode()
nxpp = nxpprog.NXP_Programmer("lpc1114", nxpdev, 12000)
#Examples of stuff you can do:
print("Reading Serial number...")
print(nxpp.get_serial_number())
print("Reading bytes")
print(nxpp.read_block(0, 4))
and this is what I saw
Write: ?
Read:
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-5-8645dc98de0d> in <module>
3 #Need to enter ISP mode before initializing programmer object
4 nxpdev.isp_mode()
----> 5 nxpp = nxpprog.NXP_Programmer("lpc1114", nxpdev, 12000)
6
7 #Examples of stuff you can do:
~/work/projects/chipwhisperer/jupyter/courses/faultapp1/external/nxpprog.py in __init__(self, cpu, device, osc_freq, verify)
520 self.cpu = cpu
521
--> 522 self.connection_init(osc_freq)
523
524 self.banks = self.get_cpu_parm("flash_bank_addr", 0)
~/work/projects/chipwhisperer/jupyter/courses/faultapp1/external/nxpprog.py in connection_init(self, osc_freq)
530
531 def connection_init(self, osc_freq):
--> 532 self.sync(osc_freq)
533
534 if self.cpu == "autodetect":
~/work/projects/chipwhisperer/jupyter/courses/faultapp1/external/nxpprog.py in sync(self, osc)
627 s = self.dev_readline()
628 if not s:
--> 629 panic("Sync timeout")
630 if s != self.sync_str:
631 panic("No sync string")
~/work/projects/chipwhisperer/jupyter/courses/faultapp1/external/nxpprog.py in panic(str)
394
395 def panic(str):
--> 396 raise IOError(str)
397
398
OSError: Sync timeout
Ok so I fixed that issue. I closely examined the board and I had a piece of loose solder bridging the center post and the shield on the SMA connector that I attached to the LPC1114 dev board. I had taken a measurement across those pins earlier today.
@Alex_Dewar sorry about the few posts above. I still have one issue. I’m not seeing the glitch.
Try uncommenting scope.capture(). I think if you don’t run that, the scope won’t rearm properly and therefore the glitch won’t fire after the first time
I built a new board. I paid close attention to the areas I had issues with. I put some heat shrink around the sma V+ post connection, so there would be no bridging there, and I made much better solder joints for the cable that got soldered on the pads going to the sma. The solder connections for the 10 ohm resistor are also a bit cleaner.
I just ran through the entire cycle with the multiplier = 2. Still no glitch occurring.
I monitored the reset in Red and the voltage across the 10 ohm res in blue. I set the blue channel to AC coupled in the OScope. I thought it would be more obvious that way.out
I would have thought I would see the blue dip to the on the bottom very noticably.
I also added a T connector to the sma and connected both glitch and measure to the T along with uncommenting the
scope.capture()
as you mentioned.
I also ran it using a multiplier of 0.5 and 1. Neither produced anything.
I’m not too sure why it isn’t working then. Do you have a CW308 based target to try voltage glitching on, just to rule out a hardware problem? You could try running through one of the fault101 voltage glitching labs.
Update: I found that by taking a measurement on either side of the resistor, often interfered with the nxpprog from communicating with the device. I tried to run the block ofcode thathas
It would fail if I messured. If however I removed the probes it would work. Then I moved the ground of the probe to the GND pins on the board and placed the red probe on the one side of the resistor I was able to get the reading I as looking for and nxpprog worked.
With this I was able to also run the DPA steps, which I missed before because they never worked with my setup.
With this configuration I was able to perform the attack using the code provided.
Good to hear you got that figured out! Not sure what your measurement system looks like, but if that negative lead went to the ground lead of a scope, I can see how that might cause issues - they’re typically hooked up to earth ground, not isolated like on a multimeter.