This is an automated email from Gerrit. Andrey Yurovsky ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/1522
-- gerrit commit a227441048d073368c80486009c9433692a9d83b Author: Andrey Yurovsky <[email protected]> Date: Mon Jul 22 17:26:02 2013 -0700 stm32lx flash: fix flash size for Medium+ devices Unfortunately the Medium+ density devices have their F_SIZE register at a different location: 0x1FF800CC instead of 0x1FF8004C. Fix this for Medium+ devices which have IDCODE 0x427. Separately, A further complication is that IDCODE 0x436 can be Medium+ as well as High Density (and the current implementation assumes the latter). There does not seem to be a way to tell them apart from openocd's perspective so I have no attempted to move apply the F_SIZE fix to those devices and this should be investigated further, perhaps as a user parameter. Change-Id: Ie03b1e119a61f2a854bc2ccc5f90ce3e8852e272 Signed-off-by: Andrey Yurovsky <[email protected]> diff --git a/src/flash/nor/stm32lx.c b/src/flash/nor/stm32lx.c index 181c311..226ea95 100644 --- a/src/flash/nor/stm32lx.c +++ b/src/flash/nor/stm32lx.c @@ -88,6 +88,7 @@ /* other registers */ #define DBGMCU_IDCODE 0xE0042000 #define F_SIZE 0x1FF8004C +#define F_SIZE_MP 0x1FF800CC /* on Medium+ STM32L devices */ /* Constants */ #define FLASH_PAGE_SIZE 256 @@ -555,7 +556,10 @@ static int stm32lx_probe(struct flash_bank *bank) } /* Get the flash size from target. */ - retval = target_read_u16(target, F_SIZE, &flash_size_in_kb); + if ((device_id & 0xfff) == 0x427) + retval = target_read_u16(target, F_SIZE_MP, &flash_size_in_kb); + else + retval = target_read_u16(target, F_SIZE, &flash_size_in_kb); /* Failed reading flash size or flash size invalid (early silicon), * default to max target family */ -- ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
