Skip to content

Commit

Permalink
Fix STM32H7 option byte programming
Browse files Browse the repository at this point in the history
THe previous option_base at 0x5200201c cannot be used for
programming the option bytes.

The option bytes are programmed at 0x52002020 (FLASH_OPTSR_PRG).
  • Loading branch information
xlz committed Jul 23, 2024
1 parent d7103ff commit 5e958dd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/chips/H72x_H73x.chip
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ flash_pagesize 0x20000 // 128 KB
sram_size 0x20000 // 128 KB "DTCM"
bootrom_base 0x1ff00000
bootrom_size 0x20000 // 128 KB
option_base 0x5200201c // STM32_H7_OPTION_BYTES_BASE
option_base 0x52002020 // STM32_H7_OPTION_BYTES_BASE
option_size 0x2c // 44 B
flags swo
2 changes: 1 addition & 1 deletion config/chips/H74x_H75x.chip
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ flash_pagesize 0x20000 // 128 KB
sram_size 0x20000 // 128 KB "DTCM"
bootrom_base 0x1ff00000
bootrom_size 0x20000 // 128 KB
option_base 0x5200201c // STM32_H7_OPTION_BYTES_BASE
option_base 0x52002020 // STM32_H7_OPTION_BYTES_BASE
option_size 0x2c // 44 B /* FLASH_OPTSR_CUR to FLASH_BOOT_PRGR */
flags swo dualbank
2 changes: 1 addition & 1 deletion config/chips/H7Ax_H7Bx.chip
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ flash_pagesize 0x20000 // 128 KB
sram_size 0x20000 // 128 KB "DTCM"
bootrom_base 0x1ff00000
bootrom_size 0x20000 // 128 KB
option_base 0x5200201c // STM32_H7_OPTION_BYTES_BASE
option_base 0x52002020 // STM32_H7_OPTION_BYTES_BASE
option_size 0x2c // 44 B
flags swo dualbank
2 changes: 1 addition & 1 deletion inc/stm32.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ enum stm32_chipids {

#define STM32_F4_OPTION_BYTES_BASE ((uint32_t) 0x40023c14)

#define STM32_H7_OPTION_BYTES_BASE ((uint32_t) 0x5200201c)
#define STM32_H7_OPTION_BYTES_BASE ((uint32_t) 0x52002020)

#define STM32_L0_OPTION_BYTES_BASE ((uint32_t) 0x1ff80000)
#define STM32_L1_OPTION_BYTES_BASE ((uint32_t) 0x1ff80000)
Expand Down

0 comments on commit 5e958dd

Please sign in to comment.