Browse Source

flash: stm32l handle flash size read failure

Rather than failing if the flash size reg cannot be read lets assume
we have the max flash size fitted.

It is quite common on early ST silicon to not correct support this register.

Change-Id: Ife058d60ae0027faad2c929ebd5b7fe2ef27234d
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/743
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
tags/v0.6.0-rc1
Spencer Oliver 12 years ago
committed by Freddie Chopin
parent
commit
531fbf0ef2
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      src/flash/nor/stm32lx.c

+ 5
- 2
src/flash/nor/stm32lx.c View File

@@ -476,8 +476,11 @@ static int stm32lx_probe(struct flash_bank *bank)

/* get flash size from target. */
retval = target_read_u16(target, F_SIZE, &flash_size_in_kb);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK) {
LOG_WARNING("failed reading flash size, default to max target family");
/* failed reading flash size, default to max target family */
flash_size_in_kb = 0xffff;
}

if ((device_id & 0xfff) == 0x416) {
/* check for early silicon */


Loading…
Cancel
Save