diff options
| author | J08nY | 2023-05-16 13:17:23 +0200 |
|---|---|---|
| committer | J08nY | 2023-05-16 13:17:23 +0200 |
| commit | 56671b651a426dc97843cbf7d2cb04d148a11fd6 (patch) | |
| tree | c856ed23a0ff01678b2090af51d53b35e6a2d944 | |
| parent | ac734c46f376924423a55bd3ee34f9abbb184930 (diff) | |
| download | pyecsca-56671b651a426dc97843cbf7d2cb04d148a11fd6.tar.gz pyecsca-56671b651a426dc97843cbf7d2cb04d148a11fd6.tar.zst pyecsca-56671b651a426dc97843cbf7d2cb04d148a11fd6.zip | |
Use "noflush" with ChipWhisperer SimpleSerial.
| -rw-r--r-- | pyecsca/sca/target/chipwhisperer.py | 4 | ||||
| -rw-r--r-- | pyecsca/sca/target/simpleserial.py | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/pyecsca/sca/target/chipwhisperer.py b/pyecsca/sca/target/chipwhisperer.py index 49daef3..a479734 100644 --- a/pyecsca/sca/target/chipwhisperer.py +++ b/pyecsca/sca/target/chipwhisperer.py @@ -18,7 +18,7 @@ from .simpleserial import SimpleSerialTarget @public class ChipWhispererTarget(Flashable, SimpleSerialTarget): # pragma: no cover - """ChipWhisperer-based target, using the SimpleSerial protocol and communicating using ChipWhisperer-Lite/Pro.""" + """ChipWhisperer-based target, using the SimpleSerial-ish protocol and communicating using ChipWhisperer-Lite/Pro.""" def __init__( self, target: SimpleSerial, scope: ScopeTypes, programmer, **kwargs @@ -29,8 +29,8 @@ class ChipWhispererTarget(Flashable, SimpleSerialTarget): # pragma: no cover self.programmer = programmer def connect(self): - self.target.con(self.scope) self.target.baud = 115200 + self.target.con(self.scope, noflush=True) sleep(0.5) def flash(self, fw_path: str) -> bool: diff --git a/pyecsca/sca/target/simpleserial.py b/pyecsca/sca/target/simpleserial.py index aeb5c5f..edc543e 100644 --- a/pyecsca/sca/target/simpleserial.py +++ b/pyecsca/sca/target/simpleserial.py @@ -37,7 +37,7 @@ class SimpleSerialMessage: @public class SimpleSerialTarget(SerialTarget, ABC): - """A SimpleSerial target, sends and receives SimpleSerial messages over a serial link.""" + """A SimpleSerial-ish target, sends and receives SimpleSerial messages over a serial link.""" def recv_msgs(self, timeout: int) -> Mapping[str, SimpleSerialMessage]: """ @@ -48,6 +48,7 @@ class SimpleSerialTarget(SerialTarget, ABC): """ start = time_ns() // 1000000 buffer = bytes() + # Expect "z00" confirmation response, as in SimpleSerial 1. while not buffer.endswith(b"z00\n"): wait = timeout - ((time_ns() // 1000000) - start) if wait <= 0: |
