Fix STM32H7 FLASH_OPTCR unlock sequence

In STM32H7, the FLASH option key register (FLASH_OPTKEYR)
mapped at 0x008 and 0x108 is the same register and cannot be
unlocked twice.
pull/1416/head
Lingzhu Xiang 2024-07-23 12:48:30 +08:00
rodzic d7103ffd06
commit 42b3a10962
2 zmienionych plików z 0 dodań i 3 usunięć

Wyświetl plik

@ -236,7 +236,6 @@
#define FLASH_H7_KEYR1 (FLASH_H7_REGS_ADDR + 0x04)
#define FLASH_H7_KEYR2 (FLASH_H7_REGS_ADDR + 0x104)
#define FLASH_H7_OPT_KEYR (FLASH_H7_REGS_ADDR + 0x08)
#define FLASH_H7_OPT_KEYR2 (FLASH_H7_REGS_ADDR + 0x108)
#define FLASH_H7_CR1 (FLASH_H7_REGS_ADDR + 0x0c)
#define FLASH_H7_CR2 (FLASH_H7_REGS_ADDR + 0x10c)
#define FLASH_H7_SR1 (FLASH_H7_REGS_ADDR + 0x10)

Wyświetl plik

@ -685,8 +685,6 @@ static int32_t unlock_flash_option(stlink_t *sl) {
break;
case STM32_FLASH_TYPE_H7:
optkey_reg = FLASH_H7_OPT_KEYR;
if (sl->chip_flags & CHIP_F_HAS_DUAL_BANK)
optkey2_reg = FLASH_H7_OPT_KEYR2;
break;
case STM32_FLASH_TYPE_L0_L1:
optkey_reg = get_stm32l0_flash_base(sl) + FLASH_OPTKEYR_OFF;