Skip to content

Commit 98e34fd

Browse files
ahmed-haouesborneoa
authored andcommitted
flash/stm32l4x: support STM32U5F/U5Gx devices
STM32U5F/U5Gx devices are similar to STM32U59/U5Ax devices while at there update STM32U5xx revisions Change-Id: I4f1c302cc91739a89cf4869401e9f5015dbc72b9 Signed-off-by: HAOUES Ahmed <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8616 Reviewed-by: Antonio Borneo <[email protected]> Reviewed-by: Tarek BOCHKATI <[email protected]> Tested-by: jenkins Reviewed-by: Tomas Vanek <[email protected]>
1 parent 50c1a15 commit 98e34fd

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

src/flash/nor/stm32l4x.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,11 +370,15 @@ static const struct stm32l4_rev stm32u53_u54xx_revs[] = {
370370

371371
static const struct stm32l4_rev stm32u57_u58xx_revs[] = {
372372
{ 0x1000, "A" }, { 0x1001, "Z" }, { 0x1003, "Y" }, { 0x2000, "B" },
373-
{ 0x2001, "X" }, { 0x3000, "C" }, { 0x3001, "W" },
373+
{ 0x2001, "X" }, { 0x3000, "C" }, { 0x3001, "W" }, { 0x3007, "U" },
374374
};
375375

376376
static const struct stm32l4_rev stm32u59_u5axx_revs[] = {
377-
{ 0x3001, "X" },
377+
{ 0x3001, "X" }, { 0x3002, "W" },
378+
};
379+
380+
static const struct stm32l4_rev stm32u5f_u5gxx_revs[] = {
381+
{ 0x1000, "A" }, { 0x1001, "Z" },
378382
};
379383

380384
static const struct stm32l4_rev stm32wba5x_revs[] = {
@@ -674,6 +678,18 @@ static const struct stm32l4_part_info stm32l4_parts[] = {
674678
.otp_base = 0x0BFA0000,
675679
.otp_size = 512,
676680
},
681+
{
682+
.id = DEVID_STM32U5F_U5GXX,
683+
.revs = stm32u5f_u5gxx_revs,
684+
.num_revs = ARRAY_SIZE(stm32u5f_u5gxx_revs),
685+
.device_str = "STM32U5F/U5Gxx",
686+
.max_flash_size_kb = 4096,
687+
.flags = F_HAS_DUAL_BANK | F_QUAD_WORD_PROG | F_HAS_TZ | F_HAS_L5_FLASH_REGS,
688+
.flash_regs_base = 0x40022000,
689+
.fsize_addr = 0x0BFA07A0,
690+
.otp_base = 0x0BFA0000,
691+
.otp_size = 512,
692+
},
677693
{
678694
.id = DEVID_STM32WBA5X,
679695
.revs = stm32wba5x_revs,
@@ -2095,14 +2111,15 @@ static int stm32l4_probe(struct flash_bank *bank)
20952111
case DEVID_STM32U53_U54XX:
20962112
case DEVID_STM32U57_U58XX:
20972113
case DEVID_STM32U59_U5AXX:
2114+
case DEVID_STM32U5F_U5GXX:
20982115
/* according to RM0456 Rev 4, Chapter 7.3.1 and 7.9.13
20992116
* U53x/U54x have 512K max flash size:
21002117
* 512K variants are always in DUAL BANK mode
21012118
* 256K and 128K variants can be in DUAL BANK mode if FLASH_OPTR:DUALBANK is set
21022119
* U57x/U58x have 2M max flash size:
21032120
* 2M variants are always in DUAL BANK mode
21042121
* 1M variants can be in DUAL BANK mode if FLASH_OPTR:DUALBANK is set
2105-
* U59x/U5Ax have 4M max flash size:
2122+
* U59x/U5Ax/U5Fx/U5Gx have 4M max flash size:
21062123
* 4M variants are always in DUAL BANK mode
21072124
* 2M variants can be in DUAL BANK mode if FLASH_OPTR:DUALBANK is set
21082125
* Note: flash banks are always contiguous

src/flash/nor/stm32l4x.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
#define DEVID_STM32L4R_L4SXX 0x470
104104
#define DEVID_STM32L4P_L4QXX 0x471
105105
#define DEVID_STM32L55_L56XX 0x472
106+
#define DEVID_STM32U5F_U5GXX 0x476
106107
#define DEVID_STM32G49_G4AXX 0x479
107108
#define DEVID_STM32U59_U5AXX 0x481
108109
#define DEVID_STM32U57_U58XX 0x482

0 commit comments

Comments
 (0)