flash: stm32f2x incorrectly using 512 as max family size

Change-Id: I2bac348c6d0baabd3d88335c5aa0a318ef66653a
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/353
Tested-by: jenkins
__archive__
Spencer Oliver 2012-01-09 12:44:48 +00:00
parent 04fe2ca554
commit 0cccdde3c7
1 changed files with 8 additions and 4 deletions

View File

@ -640,15 +640,15 @@ static int stm32x_probe(struct flash_bank *bank)
/* check for early silicon */
if (flash_size_in_kb == 0xffff) {
/* number of sectors may be incorrrect on early silicon */
LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 512k flash");
flash_size_in_kb = 512;
LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 1024k flash");
flash_size_in_kb = 1024;
}
} else if ((device_id & 0xfff) == 0x413) {
/* check for early silicon */
if (flash_size_in_kb == 0xffff) {
/* number of sectors may be incorrrect on early silicon */
LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 512k flash");
flash_size_in_kb = 512;
LOG_WARNING("STM32 flash size failed, probe inaccurate - assuming 1024k flash");
flash_size_in_kb = 1024;
}
} else {
LOG_WARNING("Cannot identify target as a STM32 family.");
@ -747,6 +747,10 @@ static int get_stm32x_info(struct flash_bank *bank, char *buf, int buf_size)
snprintf(buf, buf_size, "A");
break;
case 0x1001:
snprintf(buf, buf_size, "Z");
break;
default:
snprintf(buf, buf_size, "unknown");
break;