aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/stm32lx.c
diff options
context:
space:
mode:
authorSpencer Oliver <spen@spen-soft.co.uk>2012-01-09 12:42:31 +0000
committerSpencer Oliver <spen@spen-soft.co.uk>2012-01-12 20:42:40 +0000
commitad0847ca38e4c9d7ea0051ac7718afd3aa61868e (patch)
tree5024ea4f6cd92776416d57fb3a829ce03b485d95 /src/flash/nor/stm32lx.c
parentafe95871c59f05d532529af84e1ee80e3845e923 (diff)
flash: use correct device_id mask
The stm32 drivers have been using 0x7ff as the DEV_ID mask, this should have been 0xfff. Change-Id: I232469620969d6dd1b9a2a2aa15ec18b947dbb05 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/352 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Diffstat (limited to 'src/flash/nor/stm32lx.c')
-rw-r--r--src/flash/nor/stm32lx.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/flash/nor/stm32lx.c b/src/flash/nor/stm32lx.c
index 29a7aac9..2cd16d6f 100644
--- a/src/flash/nor/stm32lx.c
+++ b/src/flash/nor/stm32lx.c
@@ -503,8 +503,7 @@ static int stm32lx_probe(struct flash_bank *bank)
LOG_DEBUG("device id = 0x%08" PRIx32 "", device_id);
- if ((device_id & 0x7ff) != 0x416)
- {
+ if ((device_id & 0xfff) != 0x416) {
LOG_WARNING("Cannot identify target as a STM32L family.");
return ERROR_FAIL;
}
@@ -702,8 +701,7 @@ static int stm32lx_get_info(struct flash_bank *bank, char *buf, int buf_size)
if (retval != ERROR_OK)
return retval;
- if ((device_id & 0x7ff) == 0x416)
- {
+ if ((device_id & 0xfff) == 0x416) {
printed = snprintf(buf, buf_size, "stm32lx - Rev: ");
buf += printed;
buf_size -= printed;