/* Execute FMC_ISPCMD_PAGE_ERASE command to erase SPROM. The page size is 4096 bytes.  */
int32_t FMC_Erase_SPROM(void)
/* Execute FMC_ISPCMD_PAGE_ERASE command to erase SPROM. The page size is 4096 bytes.  */
int32_t FMC_Erase_SPROM(void)
{
    int32_t  ret = 0;
    FMC->ISPCMD = FMC_ISPCMD_PAGE_ERASE;
    FMC->ISPADDR = FMC_SPROM_BASE;
    FMC->ISPDAT = 0x0055AA03UL;
    FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk;
    while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk) { }
    if (FMC->ISPCTL & FMC_ISPCTL_ISPFF_Msk) {
        FMC->ISPCTL |= FMC_ISPCTL_ISPFF_Msk;
        ret = -1;
    }
    return ret;
}