Skip to content

Commit

Permalink
target/stm32f1: fix split-bank erase
Browse files Browse the repository at this point in the history
Add a missing `bank_offset` when checking for bank unlock completion.
  • Loading branch information
tlyu authored and dragonmux committed Jan 9, 2024
1 parent a97e3a2 commit 233066b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/target/stm32f1.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ static bool stm32f1_flash_unlock(target_s *target, uint32_t bank_offset)
{
target_mem_write32(target, FLASH_KEYR + bank_offset, KEY1);
target_mem_write32(target, FLASH_KEYR + bank_offset, KEY2);
uint32_t ctrl = target_mem_read32(target, FLASH_CR);
uint32_t ctrl = target_mem_read32(target, FLASH_CR + bank_offset);
if (ctrl & FLASH_CR_LOCK)
DEBUG_ERROR("unlock failed, cr: 0x%08" PRIx32 "\n", ctrl);
return !(ctrl & FLASH_CR_LOCK);
Expand Down

0 comments on commit 233066b

Please sign in to comment.