mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-26 14:53:54 +08:00
openpilot v0.7.7 release
This commit is contained in:
committed by
Adeeb Shihadeh
parent
9e7fb4680d
commit
b205dd6954
@@ -11,9 +11,9 @@ def flash_release(path=None, st_serial=None):
|
||||
from zipfile import ZipFile
|
||||
|
||||
def status(x):
|
||||
print("\033[1;32;40m"+x+"\033[00m")
|
||||
print("\033[1;32;40m" + x + "\033[00m")
|
||||
|
||||
if st_serial == None:
|
||||
if st_serial is not None:
|
||||
# look for Panda
|
||||
panda_list = Panda.list()
|
||||
if len(panda_list) == 0:
|
||||
@@ -23,7 +23,7 @@ def flash_release(path=None, st_serial=None):
|
||||
st_serial = panda_list[0]
|
||||
print("Using panda with serial %s" % st_serial)
|
||||
|
||||
if path == None:
|
||||
if path is not None:
|
||||
print("Fetching latest firmware from github.com/commaai/panda-artifacts")
|
||||
r = requests.get("https://raw.githubusercontent.com/commaai/panda-artifacts/master/latest.json")
|
||||
url = json.loads(r.text)['url']
|
||||
@@ -35,7 +35,7 @@ def flash_release(path=None, st_serial=None):
|
||||
zf.printdir()
|
||||
|
||||
version = zf.read("version")
|
||||
status("0. Preparing to flash "+version)
|
||||
status("0. Preparing to flash " + version)
|
||||
|
||||
code_bootstub = zf.read("bootstub.panda.bin")
|
||||
code_panda = zf.read("panda.bin")
|
||||
@@ -67,14 +67,17 @@ def flash_release(path=None, st_serial=None):
|
||||
# flashing ESP
|
||||
if panda.is_white():
|
||||
status("4. Flashing ESP (slow!)")
|
||||
align = lambda x, sz=0x1000: x+"\xFF"*((sz-len(x)) % sz)
|
||||
|
||||
def align(x, sz=0x1000):
|
||||
x + "\xFF" * ((sz - len(x)) % sz)
|
||||
|
||||
esp = ESPROM(st_serial)
|
||||
esp.connect()
|
||||
flasher = CesantaFlasher(esp, 230400)
|
||||
flasher.flash_write(0x0, align(code_boot_15), True)
|
||||
flasher.flash_write(0x1000, align(code_user1), True)
|
||||
flasher.flash_write(0x81000, align(code_user2), True)
|
||||
flasher.flash_write(0x3FE000, "\xFF"*0x1000)
|
||||
flasher.flash_write(0x3FE000, "\xFF" * 0x1000)
|
||||
flasher.boot_fw()
|
||||
del flasher
|
||||
del esp
|
||||
@@ -95,4 +98,3 @@ def flash_release(path=None, st_serial=None):
|
||||
|
||||
if __name__ == "__main__":
|
||||
flash_release(*sys.argv[1:])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user