Skip to content

Commit

Permalink
Fix erase init struct for flash erase
Browse files Browse the repository at this point in the history
  • Loading branch information
majcher committed Jan 10, 2022
1 parent 27a3719 commit 25c1fe3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions targets/TARGET_STM/TARGET_STM32G0/flash_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ int32_t flash_erase_sector(flash_t *obj, uint32_t address)
/* MBED HAL erases 1 sector at a time */
/* Fill EraseInit structure*/
EraseInitStruct.TypeErase = FLASH_TYPEERASE_PAGES;
EraseInitStruct.Banks = FLASH_BANK_1;
EraseInitStruct.Page = (address & 0xFFFFF) / 2048; // page size = 2048
EraseInitStruct.NbPages = 1;

Expand Down

0 comments on commit 25c1fe3

Please sign in to comment.