Commit 167bad5
committed
Use real F4 sector sizes for STM32F410/F413 erase
STM32F410 and STM32F413/F423 were missing from the F4 sector-size list in
stlink_calculate_pagesize(), so they fell back to the uniform flash_pagesize
(16 KB) from the chip config. The erase loop advances by that page size, but
calculate_F4_sectornum() maps every address within a sector to the same
sector number -- so a 64 KB sector was erased 4 times and a 128 KB sector 8
times.
Add both chip ids to the list so the erase advances by the real sector size
(16/64/128 KB) and erases each sector once. Measured on a Nucleo-F413ZH: a
512 KiB write dropped from ~44 s to ~16 s (32 -> 4 sector erases). Small
16 KB sectors are unchanged (page size already matched the sector).
Signed-off-by: James Walmsley <james@fullfat-fs.co.uk>1 parent 8f6157f commit 167bad5
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1022 | 1022 | | |
1023 | 1023 | | |
1024 | 1024 | | |
1025 | | - | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
1026 | 1028 | | |
1027 | 1029 | | |
1028 | 1030 | | |
| |||
0 commit comments