Feedback to course SCA101 / Lab 2-1B

You have defined a function:

def cap_pass_trace(pass_guess):
reset_target(scope)
num_char = target.in_waiting()
while num_char > 0:
target.read(num_char, 10)
time.sleep(0.01)
num_char = target.in_waiting()

scope.arm()
target.write(pass_guess)
ret = scope.capture()
if ret:
    print('Timeout happened during acquisition')

trace = scope.get_last_trace()
return trace

The second line says reset_target(scope) - what is it?
I commented it out, but there was no trigger pulse.
I looked at basic-passwdcheck.c
main() ends like this:

      } else {
          my_puts("Access granted, Welcome!\n");
          led_ok(1);
      }
      //All done;
      while(1);
}
return 1;

I commented out while(1), compiled, and got my trigger pulse.

Where/what is reset_target(scope)?
To me, it makes sense that the target asks for a password until the password is correct. Then it could do while (1) - or?

e

Hi,

reset_target() is defined here: https://github.com/newaetech/chipwhisperer-jupyter/blob/master/Setup_Scripts/Setup_Generic.ipynb. Basically it just sets the reset line low, then releases it.

You certainly could just ask for the password in a loop until you get it correct, but I don’t think it matters much either way.

Alex

In this case it does not matter. Loop or reset will work the same way.
This means I could reset an arduino board with reset_target() too.
Thanks

For completeness of this topic, it should be mentioned that when running in a loop a sleep(0.04) or larger is needed between calls to cap_pass_trace():

trace_a = cap_pass_trace(“h0o\n”)
time.sleep(0.1)
trace_b = cap_pass_trace(“h0p\n”)

That was a fun section to complete. I did it both ways, loop and reset.
Did a time.sleep(0.2) before every cap_pass_trace() - 0.1 was not enough

e

1 Like