Skip to content

Commit 61d00d8

Browse files
committed
STM32G4: dual bank FLASH detection
1 parent eb62778 commit 61d00d8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

targets/TARGET_STM/TARGET_STM32G4/flash_api.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static uint32_t GetPage(uint32_t Addr)
4848
static uint32_t GetBank(uint32_t Addr)
4949
{
5050
uint32_t bank = 0;
51-
#if defined(SYSCFG_MEMRMP_FB_MODE) && defined(FLASH_OPTR_DBANK)
51+
#if defined (FLASH_OPTR_DBANK)
5252
if (READ_BIT(SYSCFG->MEMRMP, SYSCFG_MEMRMP_FB_MODE) == 0) {
5353
/* No Bank swap */
5454
if (Addr < (FLASH_BASE + FLASH_BANK_SIZE)) {
@@ -106,7 +106,6 @@ int32_t flash_erase_sector(flash_t *obj, uint32_t address)
106106
int32_t status = 0;
107107

108108
if ((address >= (FLASH_BASE + FLASH_SIZE)) || (address < FLASH_BASE)) {
109-
110109
return -1;
111110
}
112111

0 commit comments

Comments
 (0)