]> www.infradead.org Git - users/borneoa/openocd-next.git/commitdiff
flash/stm32l4x: support STM32U5F/U5Gx devices
authorHAOUES Ahmed <ahmed.haoues@st.com>
Wed, 12 Mar 2025 13:37:46 +0000 (14:37 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 29 Mar 2025 18:25:02 +0000 (18:25 +0000)
STM32U5F/U5Gx devices are similar to STM32U59/U5Ax devices
while at there update STM32U5xx revisions

Change-Id: I4f1c302cc91739a89cf4869401e9f5015dbc72b9
Signed-off-by: HAOUES Ahmed <ahmed.haoues@st.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8616
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/flash/nor/stm32l4x.c
src/flash/nor/stm32l4x.h

index 3062fca72a0720effad0a1a5f5635b56350d25b8..fa57db8bbf5d11cf0d99471d80a96f278a59c79c 100644 (file)
@@ -370,11 +370,15 @@ static const struct stm32l4_rev stm32u53_u54xx_revs[] = {
 
 static const struct stm32l4_rev stm32u57_u58xx_revs[] = {
        { 0x1000, "A" }, { 0x1001, "Z" }, { 0x1003, "Y" }, { 0x2000, "B" },
-       { 0x2001, "X" }, { 0x3000, "C" }, { 0x3001, "W" },
+       { 0x2001, "X" }, { 0x3000, "C" }, { 0x3001, "W" }, { 0x3007, "U" },
 };
 
 static const struct stm32l4_rev stm32u59_u5axx_revs[] = {
-       { 0x3001, "X" },
+       { 0x3001, "X" }, { 0x3002, "W" },
+};
+
+static const struct stm32l4_rev stm32u5f_u5gxx_revs[] = {
+       { 0x1000, "A" }, { 0x1001, "Z" },
 };
 
 static const struct stm32l4_rev stm32wba5x_revs[] = {
@@ -674,6 +678,18 @@ static const struct stm32l4_part_info stm32l4_parts[] = {
          .otp_base              = 0x0BFA0000,
          .otp_size              = 512,
        },
+       {
+         .id                    = DEVID_STM32U5F_U5GXX,
+         .revs                  = stm32u5f_u5gxx_revs,
+         .num_revs              = ARRAY_SIZE(stm32u5f_u5gxx_revs),
+         .device_str            = "STM32U5F/U5Gxx",
+         .max_flash_size_kb     = 4096,
+         .flags                 = F_HAS_DUAL_BANK | F_QUAD_WORD_PROG | F_HAS_TZ | F_HAS_L5_FLASH_REGS,
+         .flash_regs_base       = 0x40022000,
+         .fsize_addr            = 0x0BFA07A0,
+         .otp_base              = 0x0BFA0000,
+         .otp_size              = 512,
+       },
        {
          .id                    = DEVID_STM32WBA5X,
          .revs                  = stm32wba5x_revs,
@@ -2095,6 +2111,7 @@ static int stm32l4_probe(struct flash_bank *bank)
        case DEVID_STM32U53_U54XX:
        case DEVID_STM32U57_U58XX:
        case DEVID_STM32U59_U5AXX:
+       case DEVID_STM32U5F_U5GXX:
                /* according to RM0456 Rev 4, Chapter 7.3.1 and 7.9.13
                 * U53x/U54x have 512K max flash size:
                 *   512K variants are always in DUAL BANK mode
@@ -2102,7 +2119,7 @@ static int stm32l4_probe(struct flash_bank *bank)
                 * U57x/U58x have 2M max flash size:
                 *   2M variants are always in DUAL BANK mode
                 *   1M variants can be in DUAL BANK mode if FLASH_OPTR:DUALBANK is set
-                * U59x/U5Ax have 4M max flash size:
+                * U59x/U5Ax/U5Fx/U5Gx have 4M max flash size:
                 *   4M variants are always in DUAL BANK mode
                 *   2M variants can be in DUAL BANK mode if FLASH_OPTR:DUALBANK is set
                 * Note: flash banks are always contiguous
index f152c9f30ae43bd746df0214a8f12268c010ef60..3199d4f6dc1b1007aa6c36e0937300a0447e360a 100644 (file)
 #define DEVID_STM32L4R_L4SXX   0x470
 #define DEVID_STM32L4P_L4QXX   0x471
 #define DEVID_STM32L55_L56XX   0x472
+#define DEVID_STM32U5F_U5GXX   0x476
 #define DEVID_STM32G49_G4AXX   0x479
 #define DEVID_STM32U59_U5AXX   0x481
 #define DEVID_STM32U57_U58XX   0x482