From 0aa47113f3c2e3a723e9f2932bdefb0277ac204b Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Wed, 27 Sep 2017 15:19:31 +0200 Subject: [PATCH] stm32f4: Fix F4 dual bank OPTCR1 to option byte mapping. --- src/target/stm32f4.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/target/stm32f4.c b/src/target/stm32f4.c index cfeec58..c6a9a5f 100644 --- a/src/target/stm32f4.c +++ b/src/target/stm32f4.c @@ -595,8 +595,9 @@ static bool stm32f4_cmd_option(target *t, int argc, char *argv[]) val[0] |= (target_mem_read32(t, start ) & 0xffff); if (readcount > 1) { if (start == 0x1FFFC000) /* F4 */ { - val[1] = target_mem_read32(t, start + 8 - 0x10000); + val[1] = target_mem_read32(t, 0x1ffec008); val[1] &= 0xffff; + val[1] <<= 16; } else { val[1] = (target_mem_read32(t, start + 0x18) & 0xffff) << 16; val[1] |= (target_mem_read32(t, start + 0x10) & 0xffff); @@ -609,9 +610,9 @@ static bool stm32f4_cmd_option(target *t, int argc, char *argv[]) optcr_mask(t, val); tc_printf(t, "OPTCR: 0x%08X ", val[0]); if (readcount > 1) - tc_printf(t, "OPTCR1: 0x%08X ", val[1]); + tc_printf(t, "OPTCR1: 0x%08lx ", val[1]); if (readcount > 2) - tc_printf(t, "OPTCR2: 0x%08X" , val[2]); + tc_printf(t, "OPTCR2: 0x%08lx" , val[2]); tc_printf(t, "\n"); return true; }