From f1b6cbd89f81f6bf8e71f8da7dfd3378cc5bd670 Mon Sep 17 00:00:00 2001 From: 15432 <15432@mail.ru> Date: Sun, 2 Mar 2025 01:49:42 +0300 Subject: [PATCH] Simple raw client as an example how to communicate with the picoflasher --- test_client.py | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 test_client.py diff --git a/test_client.py b/test_client.py new file mode 100644 index 0000000..ab7f68c --- /dev/null +++ b/test_client.py @@ -0,0 +1,82 @@ +import serial, struct, sys +import serial.tools.list_ports + +def get_version(com): + com.write(b"\x00" * 5) + reply = com.read(4) + return struct.unpack(" 2: + name = sys.argv[2] + open("dump.bin", "wb").write(rdata) + elif sys.argv[1] == "write" and len(sys.argv) > 2: + wdata = open(sys.argv[2], "rb").read() + write_flash_full(com, 0, wdata) + start_smc(com) + com.close()