Permalink
Browse files

st-flash: Honor size, if given

  • Loading branch information...
1 parent 7155c59 commit cfb1e862525f95252e367ccc38845da5a9a017af @UweBonnes UweBonnes committed Jun 7, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 flash/main.c
View
@@ -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);

0 comments on commit cfb1e86

Please sign in to comment.