mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-09 03:45:25 +08:00
Compare commits
4 Commits
feat/relc
...
fix_rivian
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
813ef1ee65 | ||
|
|
3749b49186 | ||
|
|
25b6f84bb0 | ||
|
|
73092daefc |
@@ -134,6 +134,9 @@ def main() -> None:
|
||||
|
||||
cloudlog.info(f"{len(panda_serials)} panda(s) found, connecting - {panda_serials}")
|
||||
|
||||
# custom flasher for xnor's Rivian Longitudinal Upgrade Kit
|
||||
flash_rivian_long(panda_serials)
|
||||
|
||||
# skip flashing and health check if no supported panda is detected
|
||||
if not check_panda_support(panda_serials):
|
||||
continue
|
||||
@@ -142,9 +145,6 @@ def main() -> None:
|
||||
panda_serial = panda_serials[0]
|
||||
panda = flash_panda(panda_serial)
|
||||
|
||||
# flash Rivian longitudinal upgrade panda
|
||||
flash_rivian_long(panda)
|
||||
|
||||
# Ensure internal panda is present if expected
|
||||
if HARDWARE.has_internal_panda() and not panda.is_internal():
|
||||
cloudlog.error("Internal panda is missing, trying again")
|
||||
|
||||
@@ -74,7 +74,7 @@ def _flash_panda(panda: Panda) -> None:
|
||||
panda.reconnect()
|
||||
|
||||
|
||||
def flash_rivian_long(panda: Panda) -> None:
|
||||
def flash_rivian_long(panda_serials: list[str]) -> None:
|
||||
if not os.path.isfile(FW_PATH):
|
||||
cloudlog.error(f"Rivian longitudinal upgrade firmware not found at {FW_PATH}")
|
||||
return
|
||||
@@ -83,13 +83,19 @@ def flash_rivian_long(panda: Panda) -> None:
|
||||
cloudlog.info("Not a Rivian, skipping longitudinal upgrade...")
|
||||
return
|
||||
|
||||
# only flash external black pandas (HW_TYPE_BLACK = 0x03)
|
||||
if panda.get_type() == b'\x03' and not panda.is_internal():
|
||||
try:
|
||||
_flash_panda(panda)
|
||||
except Exception:
|
||||
cloudlog.exception(f"Failed to flash F4 panda {panda.get_usb_serial()}")
|
||||
for serial in panda_serials:
|
||||
panda = Panda(serial)
|
||||
# only flash external black pandas (HW_TYPE_BLACK = 0x03)
|
||||
if panda.get_type() == b'\x03' and not panda.is_internal():
|
||||
try:
|
||||
_flash_panda(panda)
|
||||
cloudlog.info(f"Successfully flashed xnor's Rivian Longitudinal Upgrade Kit: {serial}")
|
||||
except Exception:
|
||||
cloudlog.exception(f"Failed to flash xnor's Rivian Longitudinal Upgrade Kit: {serial}")
|
||||
panda.close()
|
||||
|
||||
return
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
flash_rivian_long(Panda())
|
||||
flash_rivian_long(Panda.list())
|
||||
|
||||
Reference in New Issue
Block a user