Hey @lamauny
I was trying to use ltchiptool to read the firmware of the LN882HKI chip and was getting constant read failures: E: TimeoutError: Timeout while linking, Caused by TimeoutError: No response or Invalid checksum almost immediately after firmware read started. Sometimes I was lucky and was able to reach 5% progress.
While troubleshooting it turned out that the python code reads the firmware in chunks only once. If the chunk checksum is invalid, the process fails. I think it is too optimistic to assume that firmware will be read with no error at the first attempt. Electrical link could be very unstable, in particular when you hack around some device with dupont cables, etc.
So I have made two changes which allowed me to finally read the firmware with no error:
- changed firmware reading baudrate. Originally it was set to 1000000, but I have got more/less stable reads only at 230400.
- added the retry logic to the chunk read operation. If the chunk checksum invalid the code reads it again after a small sleep.
I'm going to fork your repository and prepare a pull request with these two fixes. I didn't check the logic for other chips, but if they also read firmware just once it makes sense to add retry logic there as well.
Hey @lamauny
I was trying to use ltchiptool to read the firmware of the LN882HKI chip and was getting constant read failures:
E: TimeoutError: Timeout while linking,Caused by TimeoutError: No responseorInvalid checksumalmost immediately after firmware read started. Sometimes I was lucky and was able to reach 5% progress.While troubleshooting it turned out that the python code reads the firmware in chunks only once. If the chunk checksum is invalid, the process fails. I think it is too optimistic to assume that firmware will be read with no error at the first attempt. Electrical link could be very unstable, in particular when you hack around some device with dupont cables, etc.
So I have made two changes which allowed me to finally read the firmware with no error:
I'm going to fork your repository and prepare a pull request with these two fixes. I didn't check the logic for other chips, but if they also read firmware just once it makes sense to add retry logic there as well.