summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortexane <texane@gmail.com>2014-01-31 22:35:47 -0800
committertexane <texane@gmail.com>2014-01-31 22:35:47 -0800
commitc84d8faf38e1d2069e84e0e86fe8ad3f054d36fd (patch)
treebce4d1620b1975ec6a80dd8ac9ede27ae2fcfbac
parentbc49ed608e0fdfde92dbfd0b462456c8269f2faa (diff)
parent5dcd45d8a48aaead2a2d1d1b9c36ab14f507628b (diff)
Merge pull request #207 from jimparis/masterv1.0.01.0.0
When ignoring the end of a file, make sure we don't ignore partial words.
-rw-r--r--src/stlink-common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/stlink-common.c b/src/stlink-common.c
index b7645fe..b942dea 100644
--- a/src/stlink-common.c
+++ b/src/stlink-common.c
@@ -1752,8 +1752,10 @@ int stlink_fwrite_flash(stlink_t *sl, const char* path, stm32_addr_t addr) {
else
num_empty = 0;
}
+ /* Round down to words */
+ num_empty -= (num_empty & 3);
if(num_empty != 0) {
- ILOG("Ignoring %d bytes of Zeros at end of file\n",num_empty);
+ ILOG("Ignoring %d bytes of 0x%02x at end of file\n", num_empty, erased_pattern);
mf.len -= num_empty;
}
err = stlink_write_flash(sl, addr, mf.base, mf.len);