aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/flash/nor/stm32lx.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/flash/nor/stm32lx.c b/src/flash/nor/stm32lx.c
index 716517b1..38631440 100644
--- a/src/flash/nor/stm32lx.c
+++ b/src/flash/nor/stm32lx.c
@@ -476,8 +476,11 @@ static int stm32lx_probe(struct flash_bank *bank)
/* get flash size from target. */
retval = target_read_u16(target, F_SIZE, &flash_size_in_kb);
- if (retval != ERROR_OK)
- return retval;
+ if (retval != ERROR_OK) {
+ LOG_WARNING("failed reading flash size, default to max target family");
+ /* failed reading flash size, default to max target family */
+ flash_size_in_kb = 0xffff;
+ }
if ((device_id & 0xfff) == 0x416) {
/* check for early silicon */