I’m having a hard time with the clock glitching labs (Fault101 1_1 - 1_3) on the CW Husky + CW312 SAM4S:
In 1_1 I was getting only very few hits scanning the whole width and offset range (0 - scope.glitch.phase_shift_steps) with a global step of 100. Not enough to identify ranges to use in the later notebooks. Instead I tried scanning the entire range over night using a global step of 10 and also stepping repeat from 0 - 10 just in case that made a difference:
Using the width and offset ranges ranges found this way in lab 1_2 and 1_3 doesn’t seem to work very well. I was able to get the occasional glitch in 1_2 scanning ext_offset from 0 to 100 but they were very few (<10) and not easily repeatable. I’ve had not success in 1_3 so far.
Running the SOLN notebooks for 1_2 and 1_3 didn’t lead to any hits.
Is the very narrow band of successful glitch parameters expected or am I missing something? Any tips to improving my results in 1_2 or getting any in 1_3?
Glitching is not OS-dependent in any way; the only variable I can think of here is that the ChipWhisperer repositories are not at the same place (on the same commit) on the two machines.
I thought of that, that’s why I tried copying the chipwhisperer folder from the windows machine. I even installed the same python version (3.10.8) just in case.
When you say that you’ve copied the folder-- are you sure that what you’ve copied is what’s being used? You can run this to know where Python is importing from:
import chipwhisperer as cw
print(cw.__file__)
You can also just compare the notebooks themselves. For example Fault 1.1 has add several Husky-specific updates over the past couple of years to work better for Husky:
It’s a difference in the .hex files, if I copy the .hex file from the Windows machine and program that everything works. I just thought it had to do with the debug logging because I skipped the programming step when I enabled that and the target still had the version from the windows machine on there …
Looks like the .hex file generated on Linux behaves very differently from the one built on Windows.
Not sure if its the reason but the Windows installer includes gcc 10.2.1 and on Linux I have 13.2.1.
Good job figuring out the root cause!
Yeah different compiler versions will produce different output. In Fault 1.1 we’re glitching a for loop and that should be pretty robust against what the compiler decides to do; however in 1.2 and 1.3, we need to glitch a specific instruction, and so our suggested glitch settings can end up being way off.