This is an automated email from Gerrit.

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

-- gerrit

commit b84135218c6ee5c3bcf43c65639a634275efb73c
Author: Keir Fraser <[email protected]>
Date:   Tue Nov 26 10:20:50 2019 +0000

    stm32f730xx: Fix Flash memory detection.
    
    These value-line devices have only 64kB Flash, whereas the
    stm32f2x probe function assumed all devices have more, and
    failed the assertion in setup_sector().
    
    Change-Id: I913ef22ddab100d094cb48d0a649d65d3fc3b626
    Signed-off-by: Keir Fraser <[email protected]>

diff --git a/src/flash/nor/stm32f2x.c b/src/flash/nor/stm32f2x.c
index b49e76e..ab0a271 100644
--- a/src/flash/nor/stm32f2x.c
+++ b/src/flash/nor/stm32f2x.c
@@ -65,6 +65,7 @@
  *                    4 x 16, 1 x 64, 3 x 128, 4 x 16, 1 x 64, 3 x 128.
  *
  * STM32F7[2|3]
+ * 64 kiByte part with 4 x 16.
  * 512 kiByte part with 4 x 16, 1 x 64, 3 x 128.
  *
  * STM32F7[4|5]
@@ -913,7 +914,14 @@ static void setup_bank(struct flash_bank *bank, int start,
 {
        int remain;
 
+       /* Initial four small-size sectors. */
        start = setup_sector(bank, start, 4, (max_sector_size_in_kb / 8) * 
1024);
+
+       /* Value line devices may have the bare minimum four sectors. */
+       if (flash_size_in_kb < max_sector_size_in_kb)
+               return;
+
+       /* Medium-size sector to take us to a max-sector-size boundary. */
        start = setup_sector(bank, start, 1, (max_sector_size_in_kb / 2) * 
1024);
 
        /* remaining sectors all of size max_sector_size_in_kb */

-- 


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

Reply via email to