2018-01-08 03:14 AM
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
2018-01-08 05:57 AM
Which bank is executing code? A stall would be expected if the code is executing from bank2.
2018-01-08 07:06 AM
running from bank1 and writing to bank2 single sectors, I've found the issue, I need to put a 'wait for last operation function' between the sector writing.
thanks sir