This is an automated email from Gerrit.

Christopher Head ([email protected]) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/4744

-- gerrit

commit 9575ac7b6410e4b877f0e41656b2cba7d4588893
Author: Christopher Head <[email protected]>
Date:   Tue Oct 30 14:37:22 2018 -0700

    flash/stm32h7x: fix IWDG1_SW bit name
    
    Bit 4 in OPTSR is called IWDG1_SW, according to RM0433, not IWDG1_HW.
    
    Change-Id: I4da63df9272cf091267b956c412b95671ea1d3c9
    Signed-off-by: Christopher Head <[email protected]>

diff --git a/src/flash/nor/stm32h7x.c b/src/flash/nor/stm32h7x.c
index fcfcf91..7e565e7 100644
--- a/src/flash/nor/stm32h7x.c
+++ b/src/flash/nor/stm32h7x.c
@@ -79,7 +79,7 @@
 #define OPT_START      (1 << 1)
 
 /* FLASH_OPTCUR bit definitions (reading) */
-#define IWDG1_HW       (1 << 4)
+#define IWDG1_SW       (1 << 4)
 
 /* register unlock keys */
 #define KEY1           0x45670123
@@ -327,7 +327,7 @@ static int stm32x_read_options(struct flash_bank *bank)
        stm32x_info->option_bytes.user2_options = (optiondata >> 16) & 0xff;
        stm32x_info->option_bytes.user3_options = (optiondata >> 24) & 0x83;
 
-       if (optiondata & IWDG1_HW)
+       if (optiondata & IWDG1_SW)
                stm32x_info->option_bytes.independent_watchdog_selection = 1;
        else
                stm32x_info->option_bytes.independent_watchdog_selection = 0;
@@ -369,9 +369,9 @@ static int stm32x_write_options(struct flash_bank *bank)
        optiondata |= (stm32x_info->option_bytes.user3_options & 0x83) << 24;
 
        if (stm32x_info->option_bytes.independent_watchdog_selection)
-               optiondata |= IWDG1_HW;
+               optiondata |= IWDG1_SW;
        else
-               optiondata &= ~IWDG1_HW;
+               optiondata &= ~IWDG1_SW;
 
        /* program options */
        retval = target_write_u32(target, FLASH_REG_BASE_B0 + FLASH_OPTPRG, 
optiondata);

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to