summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-29 17:07:23 +0000
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-04-29 17:07:23 +0000
commit26414b39d4d151508bed35c35e5d34c38fd00cc5 (patch)
tree4bdffdf9518d51c8bc89c2f51c5cd3cb48e4cc7c /src/flash
parent1f4308ddc4b321f6ad00c2730c6b42e60e72bf20 (diff)
downloadopenocd_libswd-26414b39d4d151508bed35c35e5d34c38fd00cc5.tar.gz
openocd_libswd-26414b39d4d151508bed35c35e5d34c38fd00cc5.tar.bz2
openocd_libswd-26414b39d4d151508bed35c35e5d34c38fd00cc5.tar.xz
openocd_libswd-26414b39d4d151508bed35c35e5d34c38fd00cc5.zip
- stm32x default to 128k if flash size failed.
git-svn-id: svn://svn.berlios.de/openocd/trunk@627 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/stm32x.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c
index e85c0e5a..25a9b0da 100644
--- a/src/flash/stm32x.c
+++ b/src/flash/stm32x.c
@@ -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 )