This is an automated email from Gerrit.

Tarek BOCHKATI ([email protected]) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/5444

-- gerrit

commit 55937d01afcbb4f80976df5db4378e9ec90b0c8c
Author: Tarek BOCHKATI <[email protected]>
Date:   Fri Feb 7 20:13:10 2020 +0100

    flash/stm32f1x: fix maximum flash size for some devices
    
    For STM32F0xxx, according to RM0360 Rev 4 and RM0091 Rev 9,
    the accurate flash sizes are in RM0360, Table 4 and 5
    
      DEV_ID=0x440 => F030x8 => 64K (64 * 1K)
                      F05xxx => idem
      DEV_ID=0x442 => F030xC => 256K (128 * 2K)
                      F09xxx => idem
      DEV_ID=0x444 => F030x4 => 16K (16 * 1K)
                      F030x6 => 32K (32 * 1K)
      DEV_ID=0x445 => F070x6 => 32K (32 * 1K)
                      F04xxx => idem
      DEV_ID=0x448 => F070xB => 128K (64 * 2K)
    
    For STM32 F100xx HD VL (0x428), max_flash_size_kb is 512 (was 128)
      refer to RM0041 Rev5: Table 5. Flash module organization (high-density
      value line devices) => (256 page of 2 Kbytes each)
    
    Change-Id: I4ead13093f8f4b8ec900482ee049a6fc83dcc664
    Signed-off-by: Tarek BOCHKATI <[email protected]>

diff --git a/src/flash/nor/stm32f1x.c b/src/flash/nor/stm32f1x.c
index 7d5a8f0..37dcafd 100644
--- a/src/flash/nor/stm32f1x.c
+++ b/src/flash/nor/stm32f1x.c
@@ -714,17 +714,33 @@ static int stm32x_probe(struct flash_bank *bank)
        /* set page size, protection granularity and max flash size depending 
on family */
        switch (device_id & 0xfff) {
        case 0x440: /* stm32f05x */
+               page_size = 1024;
+               stm32x_info->ppage_size = 4;
+               max_flash_size_in_kb = 64;
+               stm32x_info->user_data_offset = 16;
+               stm32x_info->option_offset = 6;
+               stm32x_info->default_rdp = 0xAA;
+               stm32x_info->can_load_options = true;
+               break;
        case 0x444: /* stm32f03x */
        case 0x445: /* stm32f04x */
                page_size = 1024;
                stm32x_info->ppage_size = 4;
-               max_flash_size_in_kb = 64;
+               max_flash_size_in_kb = 32;
                stm32x_info->user_data_offset = 16;
                stm32x_info->option_offset = 6;
                stm32x_info->default_rdp = 0xAA;
                stm32x_info->can_load_options = true;
                break;
        case 0x448: /* stm32f07x */
+               page_size = 2048;
+               stm32x_info->ppage_size = 4;
+               max_flash_size_in_kb = 128;
+               stm32x_info->user_data_offset = 16;
+               stm32x_info->option_offset = 6;
+               stm32x_info->default_rdp = 0xAA;
+               stm32x_info->can_load_options = true;
+               break;
        case 0x442: /* stm32f09x */
                page_size = 2048;
                stm32x_info->ppage_size = 4;
@@ -768,7 +784,7 @@ static int stm32x_probe(struct flash_bank *bank)
        case 0x428: /* stm32f100xx high-density value line */
                page_size = 2048;
                stm32x_info->ppage_size = 4;
-               max_flash_size_in_kb = 128;
+               max_flash_size_in_kb = 512;
                break;
        case 0x422: /* stm32f302/3xb/c */
                page_size = 2048;

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to