This is an automated email from Gerrit.

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

-- gerrit

commit 47b1c1b8ac436b4ca489dba347816142c9685245
Author: Alex J Lennon <[email protected]>
Date:   Thu Aug 2 17:59:24 2018 +0100

    stm32l4x: Fix stm32l4x dual bank support
    
    The dual bank option was being incorrectly read and the
    bank b base incorrectly set. This is tested with 512kB
    dual bank configuration but needs checking with other
    configurations (e.g. 256kb).
    
    This fix should remove the need to use a mass_erase command
    prior to programming with OpenOCD
    
    Change-Id: I6e920f11b794c4c1fd34c0e44fb8fa01e7fe8f85
    Signed-off-by: Alex J Lennon <[email protected]>

diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c
index 4fb7e03..6f99988 100644
--- a/src/flash/nor/stm32l4x.c
+++ b/src/flash/nor/stm32l4x.c
@@ -649,10 +649,10 @@ static int stm32l4_probe(struct flash_bank *bank)
                return retval;
 
        /* only devices with < 1024 kiB may be set to single bank dual banks */
-       if ((flash_size_in_kb == 1024) || !(options & OPT_DUALBANK))
+       if ((flash_size_in_kb == 1024) || !(options & (1<<OPT_DUALBANK)))
                stm32l4_info->option_bytes.bank_b_start = 256;
        else
-               stm32l4_info->option_bytes.bank_b_start = flash_size_in_kb << 9;
+               stm32l4_info->option_bytes.bank_b_start = flash_size_in_kb >> 2;
 
        /* did we assign flash size? */
        assert((flash_size_in_kb != 0xffff) && flash_size_in_kb);

-- 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to