]> git.gag.com Git - fw/stlink/commit
When ignoring the end of a file, make sure we don't ignore partial words.
authorJim Paris <jim@jtan.com>
Fri, 31 Jan 2014 21:26:35 +0000 (16:26 -0500)
committerJim Paris <jim@jtan.com>
Fri, 31 Jan 2014 21:26:35 +0000 (16:26 -0500)
commit5dcd45d8a48aaead2a2d1d1b9c36ab14f507628b
treebce4d1620b1975ec6a80dd8ac9ede27ae2fcfbac
parentbc49ed608e0fdfde92dbfd0b462456c8269f2faa
When ignoring the end of a file, make sure we don't ignore partial words.

Consider a 128-byte write to the chip.  If the last 2 bytes are
considered "empty", then len is adjusted to 126, and run_flash_loader
will only copy 126 bytes to RAM.  However, run_flash_loader then
proceeds to round up to 32 words (128 bytes) when flashing, which has
the effect of clobbering those last two "empty" bytes with junk data.
src/stlink-common.c