Skip to content

Commit

Permalink
fix write for microcontroler with RAM size less or equal to 32K (#637)
Browse files Browse the repository at this point in the history
  • Loading branch information
trabucayre authored and xor-gate committed Sep 16, 2017
1 parent 1700e6a commit 6511a7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1899,8 +1899,9 @@ int stlink_write_flash(stlink_t *sl, stm32_addr_t addr, uint8_t* base, uint32_t
/* set programming mode */
set_flash_cr_pg(sl);

size_t buf_size = (sl->sram_size > 0x8000) ? 0x8000 : 0x4000;
for(off = 0; off < len;) {
size_t size = len - off > 0x8000 ? 0x8000 : len - off;
size_t size = len - off > buf_size ? buf_size : len - off;

printf("size: %u\n", (unsigned int)size);

Expand Down

0 comments on commit 6511a7e

Please sign in to comment.