AnsweredAssumed Answered

"FLASH_Erase_Sector()" stalls erasing the bank2 sectors on the STM32F427IG

Question asked by Henry Brasil on Jan 8, 2018
Latest reply on Jan 8, 2018 by Henry Brasil

Dear Sir, I am experiencing the following problem:

I am using the STM32F427IG configured via the DB1M option byte as "dual bank" mode, so I have configured the flash as 512K on the bank1 and 512K on the bank2; the mcu VDD is 3.3V.

 

the following code works until I star to erase the bank2 sectors:

__HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_WRPERR | FLASH_FLAG_PGAERR | FLASH_FLAG_PGPERR | FLASH_FLAG_PGSERR); //ok

 

HAL_FLASH_Unlock(); //OK

//BANK 1 SECTORS ERASE

FLASH_Erase_Sector(FLASH_SECTOR_5,FLASH_VOLTAGE_RANGE_3);// erase sector5 bank1, it works

FLASH_Erase_Sector(FLASH_SECTOR_6,FLASH_VOLTAGE_RANGE_3);// erase sector6 bank1, it works

FLASH_Erase_Sector(FLASH_SECTOR_7,FLASH_VOLTAGE_RANGE_3);// erase sector7 bank1, it works

//BANK 2 SECTORS ERASE

FLASH_Erase_Sector(FLASH_SECTOR_17,FLASH_VOLTAGE_RANGE_3);// erase sector17 bank1, stuck here

FLASH_Erase_Sector(FLASH_SECTOR_18,FLASH_VOLTAGE_RANGE_3);// erase sector18 bank1, 

FLASH_Erase_Sector(FLASH_SECTOR_19,FLASH_VOLTAGE_RANGE_3);// erase sector19 bank1,

HAL_FLASH_Lock();

 

it stalls here:

FLASH_Erase_Sector(FLASH_SECTOR_17,FLASH_VOLTAGE_RANGE_3);// erase sector17 bank1, stuck here

 

Can you help me? thanks

Outcomes