Skip to content

Commit 25c1fe3

Browse files
committed
Fix erase init struct for flash erase
1 parent 27a3719 commit 25c1fe3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

targets/TARGET_STM/TARGET_STM32G0/flash_api.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ int32_t flash_erase_sector(flash_t *obj, uint32_t address)
5757
/* MBED HAL erases 1 sector at a time */
5858
/* Fill EraseInit structure*/
5959
EraseInitStruct.TypeErase = FLASH_TYPEERASE_PAGES;
60+
EraseInitStruct.Banks = FLASH_BANK_1;
6061
EraseInitStruct.Page = (address & 0xFFFFF) / 2048; // page size = 2048
6162
EraseInitStruct.NbPages = 1;
6263

0 commit comments

Comments
 (0)