This is an automated email from Gerrit.

Spencer Oliver (s...@spen-soft.co.uk) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/1133

-- gerrit

commit 3d59eabcc5627827b71a085e91919635fab1122c
Author: Spencer Oliver <s...@spen-soft.co.uk>
Date:   Thu Feb 7 11:30:38 2013 +0000

    flash: stm32l sanity check flash size register
    
    If the user does not configure the flash bank size (default) then perform
    a sanity check as we have seen some devices reporting >6MB of flash.
    
    Change-Id: I9964fab2fa19a5cc7769fea1ee904c45c5c6c214
    Signed-off-by: Spencer Oliver <s...@spen-soft.co.uk>

diff --git a/src/flash/nor/stm32lx.c b/src/flash/nor/stm32lx.c
index f871a36..a0b7918 100644
--- a/src/flash/nor/stm32lx.c
+++ b/src/flash/nor/stm32lx.c
@@ -557,6 +557,14 @@ static int stm32lx_probe(struct flash_bank *bank)
        if (bank->size) {
                LOG_INFO("ignoring flash probed value, using configured bank 
size");
                flash_size_in_kb = bank->size / 1024;
+       } else {
+
+               /* we have seen some rogue stm32l parts that report they have > 
6M of flash
+                * perform a sanity check using 1MB as a upper limit */
+               if (flash_size_in_kb > 1024) {
+                       LOG_WARNING("possible incorrect flash size detected, " \
+                                       "if this size is incorrect please 
manually configure the flash bank size");
+               }
        }
 
        /* STM32L - we have 32 sectors, 16 pages per sector -> 512 pages

-- 

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to