Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write flash - add dynamic timeout #57

Closed
wants to merge 1 commit into from

Conversation

r-zlotorzynski
Copy link

Fixes a highly compressed file write exception.
Longer time is required with high compression ratio.

…compression ratio)

Fixes a highly compressed file write exception
@igrr
Copy link
Member

igrr commented Jan 12, 2023

Thank you for the PR @r-zlotorzynski!

There is already a commented-out code block related to this a few lines below:

esptool-js/src/esploader.ts

Lines 948 to 957 in ce8f8da

/*
let block_uncompressed = pako.inflate(block).length;
//let len_uncompressed = block_uncompressed.length;
bytes_written += block_uncompressed;
if (this.timeout_per_mb(this.ERASE_WRITE_TIMEOUT_PER_MB, block_uncompressed) > 3000) {
block_timeout = this.timeout_per_mb(this.ERASE_WRITE_TIMEOUT_PER_MB, block_uncompressed);
} else {
block_timeout = 3000;
}*/ // XXX: Partial block inflate seems to be unsupported in Pako. Hardcoding timeout
const block_timeout = 5000;

I would prefer to solve the problem with that commented out block, if possible. If not possible, we can have an alternative solution, but then the original code block should be removed.

@igrr
Copy link
Member

igrr commented Jan 25, 2023

I've implemented the alternative approach in #83.

@igrr
Copy link
Member

igrr commented Feb 10, 2023

Solved by #83

@igrr igrr closed this Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants