AnsweredAssumed Answered

STM32F429 - Erase falsh sector doupts

Question asked by Paramasivan on Nov 20, 2014
Latest reply on Nov 20, 2014 by Clive One
Hi,

I am using STM32f429 disco FW_upgrade code as bootloader for my application. I had seen it erase only 11 sectors (1MB) of flash memory. I want to erase upto 23 sectors from my application address, So i have modified the code as below. But it hangs on fault handler.


 /* Erase Flash sectors */
  startsector = FLASH_If_GetSectorNumber(Address);
  
  sectorindex = startsector;
  
  /* Erase FLASH sectors to download image */
  while ((erasestatus == FLASH_COMPLETE) && (sectorindex <= FLASH_Sector_22) && (HCD_IsDeviceConnected(&USB_OTG_Core) == 1))
  {
    erasestatus = FLASH_EraseSector(sectorindex, VoltageRange_3);
    sectorindex += 8;
  }
  
  if ((sectorindex != (FLASH_Sector_22 + 8)) || (erasestatus != FLASH_COMPLETE))
  {
    return 1;
  }
  else
  {
    return 0;
  }

Outcomes