On the panda jungle that I received, when trying to flash it, I was getting:
./flash.py
...
Traceback (most recent call last):
File "/home/gutek/openpilot/panda/board/jungle/./flash.py", line 16, in <module>
with PandaJungle(serial=s) as p:
^^^^^^^^^^^^^^^^^^^^^
File "/home/gutek/openpilot/panda/python/__init__.py", line 244, in __init__
self.connect(claim)
File "/home/gutek/openpilot/panda/python/__init__.py", line 294, in connect
self._mcu_type = self.get_mcu_type()
^^^^^^^^^^^^^^^^^^^
File "/home/gutek/openpilot/panda/board/jungle/__init__.py", line 99, in get_mcu_type
raise ValueError(f"unknown HW type: {hw_type}")
ValueError: unknown HW type: bytearray(b'')
My solution is to assume that it's McuType.F4if hw_type == b'' or self._assume_f4_mcu.
Just setting if hw_type == b'' doesn't work since immediately after it has hw_type = b'\xff\x00\xc1\x3e\xde\xad\xd0\x0d\x00\x00\x00\x00' which is (already) detected by self._assume_f4_mcu (if checked).
On the panda jungle that I received, when trying to flash it, I was getting:
My solution is to assume that it's McuType.F4
if hw_type == b'' or self._assume_f4_mcu
.Just setting
if hw_type == b''
doesn't work since immediately after it hashw_type = b'\xff\x00\xc1\x3e\xde\xad\xd0\x0d\x00\x00\x00\x00'
which is (already) detected byself._assume_f4_mcu
(if checked).So, with this change, it works succesfully:
Not sure it's totally correct, but I can change it according to feedback. This will help other people hitting this problem.