From bff1b6f05a56eed8e150c25d925bd51ca2840daf Mon Sep 17 00:00:00 2001 From: Tarek BOCHKATI Date: Mon, 9 Mar 2020 13:33:08 +0100 Subject: [PATCH] flash/stm32l4x: add support of STM32WB3x devices STM32WB3x devices' flash are quite similar to STM32WB5x, except the maximum flash size, which is 512K for WB3x and 1M for WB5x Change-Id: I3098d7153a7429e0e72c75cec962c05768b0b018 Signed-off-by: Tarek BOCHKATI Reviewed-on: http://openocd.zylin.com/5475 Tested-by: jenkins Reviewed-by: Tomas Vanek --- src/flash/nor/stm32l4x.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c index 42f3394ec..2cc378a90 100644 --- a/src/flash/nor/stm32l4x.c +++ b/src/flash/nor/stm32l4x.c @@ -188,6 +188,10 @@ static const struct stm32l4_rev stm32_495_revs[] = { { 0x2001, "2.1" }, }; +static const struct stm32l4_rev stm32_496_revs[] = { + { 0x1000, "A" }, +}; + static const struct stm32l4_rev stm32_497_revs[] = { { 0x1000, "1.0" }, }; @@ -313,6 +317,16 @@ static const struct stm32l4_part_info stm32l4_parts[] = { .flash_regs_base = 0x58004000, .fsize_addr = 0x1FFF75E0, }, + { + .id = 0x496, + .revs = stm32_496_revs, + .num_revs = ARRAY_SIZE(stm32_496_revs), + .device_str = "STM32WB3x", + .max_flash_size_kb = 512, + .has_dual_bank = false, + .flash_regs_base = 0x58004000, + .fsize_addr = 0x1FFF75E0, + }, { .id = 0x497, .revs = stm32_497_revs, @@ -985,6 +999,7 @@ static int stm32l4_probe(struct flash_bank *bank) } break; case 0x495: /* STM32WB5x */ + case 0x496: /* STM32WB3x */ /* single bank flash */ page_size_kb = 4; num_pages = flash_size_kb / page_size_kb;