summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/flash/stm32x.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c
index d3e167d9..9ce16f7d 100644
--- a/src/flash/stm32x.c
+++ b/src/flash/stm32x.c
@@ -664,7 +664,8 @@ int stm32x_probe(struct flash_bank_s *bank)
LOG_INFO( "flash size = %dkbytes", num_pages );
/* calculate numbers of pages */
- num_pages /= (page_size - 1024);
+ if (page_size - 1024)
+ num_pages /= (page_size - 1024);
bank->base = 0x08000000;
bank->size = (num_pages * page_size);