diff options
author | Karl Palsson <karlp@tweak.net.au> | 2017-08-09 17:11:29 +0000 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2017-08-10 09:20:39 +0100 |
commit | 04b23ef5022bd0ebbcac7ceed5112d822bbd966d (patch) | |
tree | 88ee59b9e4b65ba7d9eb653d2cf8222ff14bc20e /src/flash/nor | |
parent | 02bc718d1a49dd04bffa446f1dadd6b86d0d107c (diff) |
stm32l1: Devid 0x429 only has 8bit flash size register
A footnote in RM0038r14.
Change-Id: Ic31894d846fbbe917a7290b2b7ff8fb582bb65da
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
Reviewed-on: http://openocd.zylin.com/4198
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/flash/nor')
-rw-r--r-- | src/flash/nor/stm32lx.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/flash/nor/stm32lx.c b/src/flash/nor/stm32lx.c index e4f499d3..0c2fddc9 100644 --- a/src/flash/nor/stm32lx.c +++ b/src/flash/nor/stm32lx.c @@ -790,6 +790,11 @@ static int stm32lx_probe(struct flash_bank *bank) flash_size_in_kb = 256; } + /* 0x429 devices only use the lowest 8 bits of the flash size register */ + if (retval == ERROR_OK && (device_id & 0xfff) == 0x429) { + flash_size_in_kb &= 0xff; + } + /* Failed reading flash size or flash size invalid (early silicon), * default to max target family */ if (retval != ERROR_OK || flash_size_in_kb == 0xffff || flash_size_in_kb == 0) { |