[fix] unknown bug, must use 0x40 instead of pgsize when writing flash

pull/1/head
texane 2011-01-14 10:49:59 -06:00
rodzic 8c85458eff
commit 1896ea7336
1 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -1551,12 +1551,13 @@ static int stlink_fwrite_flash
goto on_error; goto on_error;
} }
/* write each page */ /* write each page. above WRITE_BLOCK_SIZE fails? */
for (off = 0; off < mf.len; off += sl->flash_pgsz) #define WRITE_BLOCK_SIZE 0x40
for (off = 0; off < mf.len; off += WRITE_BLOCK_SIZE)
{ {
/* adjust last page size */ /* adjust last write size */
size_t size = sl->flash_pgsz; size_t size = WRITE_BLOCK_SIZE;
if ((off + sl->flash_pgsz) > mf.len) if ((off + WRITE_BLOCK_SIZE) > mf.len)
size = mf.len - off; size = mf.len - off;
if (run_flash_loader(sl, &fl, addr + off, mf.base + off, size) == -1) if (run_flash_loader(sl, &fl, addr + off, mf.base + off, size) == -1)