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

remove empty byte truncation from stlink_fread #371

Merged
merged 1 commit into from
Feb 19, 2016

Conversation

gtalusan
Copy link
Contributor

I'm trying to backup the flash memory on an EMW3165 with an eBay ST-Link v2 using the following command:

st-flash read out.bin 0x8000000

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.

@gtalusan
Copy link
Contributor Author

Also wonder if #308 is related.

texane added a commit that referenced this pull request Feb 19, 2016
remove empty byte truncation from stlink_fread
@texane texane merged commit 9f0adec into stlink-org:master Feb 19, 2016
@Nightwalker-87 Nightwalker-87 added this to the v1.2.0 and older milestone Feb 26, 2020
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants