forked from auracaster/openocd
stm32: enable flash bank size override
It has been seen on some stm32 targets that the flash size register that is probed by the driver may contain an invalid size. This change enables the user to override the probed value. Change-Id: I09359e59a96f9133d3d939670957d32a830a944e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1132 Tested-by: jenkins Reviewed-by: Johan Almquist <johan.almquist@assaabloy.com>
This commit is contained in:
@@ -956,6 +956,13 @@ static int stm32x_probe(struct flash_bank *bank)
|
||||
}
|
||||
}
|
||||
|
||||
/* if the user sets the size manually then ignore the probed value
|
||||
* this allows us to work around devices that have a invalid flash size register value */
|
||||
if (bank->size) {
|
||||
LOG_INFO("ignoring flash probed value, using configured bank size");
|
||||
flash_size_in_kb = bank->size / 1024;
|
||||
}
|
||||
|
||||
LOG_INFO("flash size = %dkbytes", flash_size_in_kb);
|
||||
|
||||
/* did we assign flash size? */
|
||||
|
||||
Reference in New Issue
Block a user