remove empty byte truncation from stlink_fread #371
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm trying to backup the flash memory on an EMW3165 with an eBay ST-Link v2 using the following command:
I expect the output to be 0x80000 bytes in size but I get something quite shorter. Appending the length to the command line also produces the same short output. Looking at the code, I see that the number of FF's or 00's is counted on each iteration of the read, but the file is truncated after all of the reads are done.
I think the writes should be shortened inside the loop, but it looks like honouring
sl->q_len
is the way to go.This patch removes the erased byte counter, bumps up the read size to min(0x1800, flash page size) similar to the verify flash data function.