From b8c4fbb44ff346dec3632c9d19fe0860ce84fe6b Mon Sep 17 00:00:00 2001 From: Comma Device Date: Fri, 8 Nov 2024 00:51:12 +0000 Subject: [PATCH] spi: add helper for getting bootloader ID --- python/spi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/spi.py b/python/spi.py index a6832beaed..b6460b0b5b 100644 --- a/python/spi.py +++ b/python/spi.py @@ -397,6 +397,9 @@ def read(self, address: int, length: int): data = [struct.pack('>I', address), struct.pack('B', length - 1)] return self._cmd(0x11, data=data, read_bytes=length) + def get_bootloader_id(self) -> int: + return self.read(0x1FF1E7FE, 1) + def get_chip_id(self) -> int: r = self._cmd(0x02, read_bytes=3) assert r[0] == 1 # response length - 1