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

use logger info for flashing #2058

Merged
merged 1 commit into from
Oct 3, 2024
Merged
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
10 changes: 5 additions & 5 deletions python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,30 +515,30 @@ def flash_static(handle, code, mcu_type):
assert last_sector < 7, "Binary too large! Risk of overwriting provisioning chunk."

# unlock flash
logger.warning("flash: unlocking")
logger.info("flash: unlocking")
handle.controlWrite(Panda.REQUEST_IN, 0xb1, 0, 0, b'')

# erase sectors
logger.warning(f"flash: erasing sectors 1 - {last_sector}")
logger.info(f"flash: erasing sectors 1 - {last_sector}")
for i in range(1, last_sector + 1):
handle.controlWrite(Panda.REQUEST_IN, 0xb2, i, 0, b'')

# flash over EP2
STEP = 0x10
logger.warning("flash: flashing")
logger.info("flash: flashing")
for i in range(0, len(code), STEP):
handle.bulkWrite(2, code[i:i + STEP])

# reset
logger.warning("flash: resetting")
logger.info("flash: resetting")
try:
handle.controlWrite(Panda.REQUEST_IN, 0xd8, 0, 0, b'', expect_disconnect=True)
except Exception:
pass

def flash(self, fn=None, code=None, reconnect=True):
if self.up_to_date(fn=fn):
logger.debug("flash: already up to date")
logger.info("flash: already up to date")
return

if not fn:
Expand Down
Loading