/* Execute FMC_ISPCMD_PAGE_ERASE command to erase a flash page. The page size is 4096 bytes.  */
int32_t FMC_Erase(uint32_t u32PageAddr)
/* Execute FMC_ISPCMD_PAGE_ERASE command to erase a flash page. The page size is 4096 bytes.  */
int32_t FMC_Erase(uint32_t u32PageAddr)
{
    int32_t  ret = 0;
    if (u32PageAddr == FMC_SPROM_BASE)
    {
        ret = FMC_Erase_SPROM();
    }
    else
    {
        FMC->ISPCMD = FMC_ISPCMD_PAGE_ERASE;
        FMC->ISPADDR = u32PageAddr;
        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;
}