/**
* [url=home.php?mod=space&uid=247401]@brief[/url] Get Flash Checksum
*
* @param[in] u32Addr Specific flash start address
* @param[in] i32Size Specific a size of Flash area
*
* [url=home.php?mod=space&uid=266161]@return[/url] A checksum value of a flash block.
*
* [url=home.php?mod=space&uid=1543424]@Details[/url] To get VECMAP value which is the page address for remapping to vector page (0x0).
*
*/
static __INLINE uint32_t FMC_GetCheckSum(uint32_t u32Addr, int32_t i32Size)
{
FMC->ISPCMD = FMC_ISPCMD_CAL_CHECKSUM;
FMC->ISPADDR = u32Addr;
FMC->ISPDAT = i32Size;
FMC->ISPTRG = 0x1;
#if ISBEN
__ISB();
#endif
while(FMC->ISPTRG);
FMC->ISPCMD = FMC_ISPCMD_CHECKSUM;
FMC->ISPTRG = 0x1;
while(FMC->ISPTRG);
return FMC->ISPDAT;
}
|