Skip to main content
paramasivan
Associate III
November 20, 2014
Question

STM32F429 - Erase falsh sector doupts

  • November 20, 2014
  • 1 reply
  • 483 views
Posted on November 20, 2014 at 11:38

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;

  }
    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    November 20, 2014
    Posted on November 20, 2014 at 15:06

    The index is not enumerated linearly.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..