X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fstm32lx.c;h=27a446de19b4522f5494ab8e54fa3ed00f591099;hb=055abd0b9cb3427fb9b52263d2be49620e8e4c97;hp=3863144029959d4c9461189a34dd90ec9871c71c;hpb=531fbf0ef25e75884f2ade2acafcf010cb3d7d2a;p=fw%2Fopenocd diff --git a/src/flash/nor/stm32lx.c b/src/flash/nor/stm32lx.c index 386314402..27a446de1 100644 --- a/src/flash/nor/stm32lx.c +++ b/src/flash/nor/stm32lx.c @@ -482,6 +482,11 @@ static int stm32lx_probe(struct flash_bank *bank) flash_size_in_kb = 0xffff; } + /* some variants read 0 for flash size register + * use a max flash size as a default */ + if (flash_size_in_kb == 0) + flash_size_in_kb = 0xffff; + if ((device_id & 0xfff) == 0x416) { /* check for early silicon */ if (flash_size_in_kb == 0xffff) {