tuya-cloudcutter / bk7231tools

This is a collection of tools to interact with and analyze artifacts for BK7231 MCUs
MIT License
38 stars 6 forks source link

Retry flash reading in case of errors #17

Closed no2chem closed 1 year ago

no2chem commented 1 year ago

This PR adds a feature allowing the read to be automatically retried if failed.

Useful for serial connections with issues, although I suspect that the underlying serial code gives up too quickly if the requested bytes aren't in the buffer by a certain time period.

kuba2k2 commented 1 year ago

I think you've lost a yield call there, so the data will not be saved to file. Also, wouldn't it be good to count the retries and give up after like 20?

no2chem commented 1 year ago

@kuba2k2 Thanks for catching that, was a copy and paste error into the branch I pushed. Fixed, and added the retry as well.