uint64 crcCalculate (uint64 * startAddr, uint32 count64) { uint32 count = 0u; CRC_CTRL0 |= 0x00000001U; /* Reset the CRC Module */ CRC_CTRL0 &= 0xFFFFFFFEU; CRC_CTRL2 |= 0x00000003U; /* Configure to Full CPU Mode */ for (count=0u; count < count64; count++) { /*SAFETYMCUSW 45 D MR:21.1 <APPROVED> "Reason - value 0 for start address is valid as * it is used for crc calculation"*/ CRC_SIGREG = *startAddr; /*SAFETYMCUSW 45 D MR:21.1 <APPROVED> "Reason - value 0 for start address is valid as * it is used for crc calculation"*/ startAddr++; } return(CRC_SIGREG); }
I used this function to use the CRC in RM48, but I invoked this function like this
crcAtInit_FLASH = crcCalculate(((uint64 *)0x00000000), 0x2000); crcAtInit_FEE = crcCalculate(((uint64 *)0xF0200000), 0x2000);
And the FEE one was OK but the FLASH go to a flash abort.
If I want to CRC the Flash, how to use the full_cpu_mode correctly ?