]> git.sur5r.net Git - openocd/commitdiff
- stm32x default to 128k if flash size failed.
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 29 Apr 2008 17:07:23 +0000 (17:07 +0000)
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 29 Apr 2008 17:07:23 +0000 (17:07 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@627 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/flash/stm32x.c

index e85c0e5a715ee2815e21665fe84acf37de21c6c4..25a9b0da3d7c605dabbe3df1634f91e960034e89 100644 (file)
@@ -627,7 +627,12 @@ int stm32x_probe(struct flash_bank_s *bank)
     }
     
        /* get flash size from target */
-       target_read_u16(target, 0x1FFFF7E0, &num_sectors);
+       if (target_read_u16(target, 0x1FFFF7E0, &num_sectors) != ERROR_OK)
+       {
+               /* failed reading flash size, default to 128k */
+               LOG_WARNING( "STM32 flash size failed, probe inaccurate - assuming 128k flash" );
+               num_sectors = 128;
+       }
        
        /* check for early silicon rev A */
        if ((device_id >> 16) == 0 )