Fix the progress indicator for F2/F4 flash writing
authorUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Thu, 2 Feb 2012 21:49:33 +0000 (22:49 +0100)
committerUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Thu, 2 Feb 2012 21:52:43 +0000 (22:52 +0100)
src/stlink-common.c

index 294f932b2bd7c4ad5d37e29e79db05e05bd6237e..68b7d5049ab6a44f9e7ba0f7e7bd5f3f96ff6756 100644 (file)
@@ -1377,7 +1377,7 @@ int stlink_write_flash(stlink_t *sl, stm32_addr_t addr, uint8_t* base, unsigned
                                /* show progress. writing procedure is slow
                                           and previous errors are misleading */
                                const uint32_t pgnum = (off / PROGRESS_CHUNK_SIZE)+1;
-                               const uint32_t pgcount = len / PROGRESS_CHUNK_SIZE;
+                               const uint32_t pgcount = len / PROGRESS_CHUNK_SIZE +1;
                                fprintf(stdout, "Writing %ukB chunk %u out of %u\n", PROGRESS_CHUNK_SIZE/1024, pgnum, pgcount);
                        }
                }