From 3be7b0b71210b0eb4cc427361cf1ae137cf2b67b Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Mon, 10 Feb 2025 19:12:22 +0100 Subject: [PATCH] tools: Add recovery partition key generator. Generates a binary that triggers flash recovery process when downloaded to special DFU partitions. Signed-off-by: iabdalkader --- tools/flash_recovery_key.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 tools/flash_recovery_key.py diff --git a/tools/flash_recovery_key.py b/tools/flash_recovery_key.py new file mode 100755 index 000000000..a73ff8f67 --- /dev/null +++ b/tools/flash_recovery_key.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 +# This file is part of the OpenMV project. +# +# Copyright (c) 2013-2024 Ibrahim Abdelkader +# Copyright (c) 2013-2024 Kwabena W. Agyeman +# +# This work is licensed under the MIT license, see the file LICENSE for details. +# +# Generates a binary that triggers flash recovery process when downloaded +# to special DFU partitions. +if __name__ == "__main__": + with open("key.bin", "wb") as f: + f.write(b'\x15\x9e}B\x96\x1aq\xebs\xa3&)+\x08\t\x0e' + bytearray(4080)) + print("Recovery key generated and saved.")