Skip to content

Commit

Permalink
st-flash: Honor size, if given
Browse files Browse the repository at this point in the history
  • Loading branch information
UweBonnes committed Jun 7, 2012
1 parent 7155c59 commit cfb1e86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flash/main.c
Expand Up @@ -154,10 +154,10 @@ int main(int ac, char** av)
}
else /* read */
{
if ((o.addr >= sl->flash_base) &&
if ((o.addr >= sl->flash_base) && (o.size == 0) &&
(o.addr < sl->flash_base + sl->flash_size))
o.size = sl->flash_size;
else if ((o.addr >= sl->sram_base) &&
else if ((o.addr >= sl->sram_base) && (o.size == 0) &&
(o.addr < sl->sram_base + sl->sram_size))
o.size = sl->sram_size;
err = stlink_fread(sl, o.filename, o.addr, o.size);
Expand Down

0 comments on commit cfb1e86

Please sign in to comment.