Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fi] Update OTBN Key Sideload handler #372

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions fault_injection/fi_otbn.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ def fi_parameter_sweep(cfg: dict, target: Target, fi_gear,
Returns:
device_id: The ID of the target device.
"""
# Setup key manager if needed by test.
ot_communication.init_keymgr(cfg["test"]["which_test"])
# Configure the OTBN FI code on the target.
device_id = ot_communication.init()
# Setup key manager if needed by test.
ot_communication.init_keymgr(cfg["test"]["which_test"])
# Store results in array for a quick access.
fi_results = []
# Start the parameter sweep.
Expand Down Expand Up @@ -132,10 +132,10 @@ def fi_parameter_sweep(cfg: dict, target: Target, fi_gear,
ot_communication = target.reset_target(com_reset = True)
# Re-establish UART connection.
ot_communication = OTFIOtbn(target)
# Setup key manager if needed by test.
ot_communication.init_keymgr(cfg["test"]["which_test"])
# Configure the OTBN FI code on the target.
ot_communication.init()
# Setup key manager if needed by test.
ot_communication.init_keymgr(cfg["test"]["which_test"])
# Reset FIGear if necessary.
fi_gear.reset()
else:
Expand Down
8 changes: 1 addition & 7 deletions target/communication/fi_otbn_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,7 @@ def init_keymgr(self, test: str) -> None:
# InitTrigger command.
time.sleep(0.01)
self.target.write(json.dumps("InitKeyMgr").encode("ascii"))
# As the init resets the chip, we need to call it again to complete
# the initialization of the key manager.
time.sleep(2)
self._ujson_otbn_fi_cmd()
time.sleep(0.01)
self.target.write(json.dumps("InitKeyMgr").encode("ascii"))
time.sleep(2)
time.sleep(0.5)

def init(self) -> None:
""" Initialize the OTBN FI code on the chip.
Expand Down
Loading