/* Execute ISP FMC_ISPCMD_PROGRAM to program a word to flash.  */
int32_t FMC_Write(uint32_t u32Addr, uint32_t u32Data)
/* Execute ISP FMC_ISPCMD_PROGRAM to program a word to flash.  */
int32_t FMC_Write(uint32_t u32Addr, uint32_t u32Data)
{
    int32_t i32TimeOutCnt;
    g_FMC_i32ErrCode = 0;
    FMC->ISPCMD = FMC_ISPCMD_PROGRAM;
    FMC->ISPADDR = u32Addr;
    FMC->ISPDAT = u32Data;
    FMC->ISPTRG = FMC_ISPTRG_ISPGO_Msk;
    i32TimeOutCnt = FMC_TIMEOUT_WRITE;
    while (FMC->ISPTRG & FMC_ISPTRG_ISPGO_Msk)
    {
        if (i32TimeOutCnt-- <= 0)
        {
            g_FMC_i32ErrCode = -1;
            return -1;
        }
    }
    return 0;
}