2015-03-26 10:38 PM
429 has 1M flash and I divide it into two banks using dual bank mode. Each has 512MB.
I want to erase sector 15 (0x0808 C000 - 0x0808 FFFF) , but it fails. But if I use single bank mode and erase sector 8 (0x0808 0000 - 0x0809 FFFF), it operate correct. As below, I use the standard function in Cube. Who can give me a tips on how to solve it? uint32_t FLASH_EraseSector(uint32_t sectorAdd) { FLASH_EraseInitTypeDef EraseInitStruct; uint32_t errSector = RET_OK; HAL_FLASH_Unlock(); HAL_FLASH_OB_Unlock(); /* Fill EraseInit structure*/ EraseInitStruct.TypeErase = TYPEERASE_SECTORS; EraseInitStruct.VoltageRange = VOLTAGE_RANGE_3; EraseInitStruct.Sector = FLASH_GetSector(sectorAdd); EraseInitStruct.NbSectors = 1; HAL_FLASHEx_Erase(&EraseInitStruct, &errSector); HAL_FLASH_OB_Lock(); HAL_FLASH_Lock(); return errSector; }2015-03-27 03:14 AM
Are you sure it's not a 2MB part, or the software thinks it is? What's the exact part number?
What's value is returned in EraseInitStruct.Sector in these two cases? I think also the OB Lock/Unlock are unnecessary, they would be in SPL code.2015-03-28 09:06 AM
Part number is STM32F429IGT6. It a 1 M part.
EraseInitStruct.Sector = 15, which is the right sector number in bank 2 [0x0808 C000 - 0x0808 FFFF]. I know sector+4 in HAL_FLASHEx_Erase() funtion then SNB is 19. I don't know why it can't work.2023-07-10 09:27 PM
Any solution or insight here? Also facing the same issue