flashing speeeed (#2264)

* less sectors

* why are we taking baby steps

* revert

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
Adeeb Shihadeh
2025-08-31 16:47:03 -07:00
committed by GitHub
parent c1f0cfe223
commit 819fa5854e
3 changed files with 9 additions and 17 deletions

View File

@@ -431,7 +431,7 @@ class Panda:
handle.controlWrite(Panda.REQUEST_IN, 0xb2, i, 0, b'')
# flash over EP2
STEP = 0x10
STEP = 0x200
logger.info("flash: flashing")
for i in range(0, len(code), STEP):
handle.bulkWrite(2, code[i:i + STEP])

View File

@@ -116,10 +116,11 @@ class PandaDFU:
def program_bootstub(self, code_bootstub):
self._handle.clear_status()
# erase all sectors
for i in range(len(self._mcu_type.config.sector_sizes)):
# erase bootstub + app sectors
for i in (0, 1):
self._handle.erase_sector(i)
# write bootstub
self._handle.program(self._mcu_type.config.bootstub_address, code_bootstub)
def recover(self):