This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS3137: Hardware CRC calculation

Part Number: TMS570LS3137

I am performing CRC Calculation on 3MB Internal Flash and 32MB External Flash software calculation method of implementation takes long time (33,554,432 * 10) machine cycles, Does TMS570LS3137 has Hardware CRC IP. If yes how do I use it is there any APPLICATION NOTE.

#pragma section=".intvecs"
#pragma section=".rodata"
ulFlashStartAddr = (uint32) __section_begin(".intvecs"); /* Used for Flash CRC Calculation */
ulFlashEndAddr = (uint32) __section_end(".rodata"); /* Used for Flash CRC Calculation */

SL_ESM_Init(ESM_ApplicationCallback);
crcAtInit_VIMRAM = SL_CRC_Calculate(((uint64 *)0xFFF82000), 256);
crcAtInit_FEE = SL_CRC_Calculate(((uint64 *)0xF0200000), 8);
crcAtInit_FLASH = SL_CRC_Calculate((uint64 *)((uint32)ulFlashStartAddr), ((((uint32)ulFlashEndAddr)-((uint32)ulFlashStartAddr)) >> 6));
crcAtInit_StaticRAM = SL_CRC_Calculate((uint64*)static_ram,1); /* enable the below functions only if profiling is ebnabled*/
_enable_interrupt_();

#define CRC_CTRL0 (*(volatile uint32 *)0xFE000000U)
#define CRC_CTRL2 (*(volatile uint32 *)0xFE000010U)
#define CRC_STATUS (*(volatile uint32 *)0xFE000028U)
#define CRC_SIGREGL1 (*(volatile uint32 *)0xFE000060U)
#define CRC_SIGREGH1 (*(volatile uint32 *)0xFE000064U)
#define CRC_SIGREG (*(volatile uint64 *)0xFE000060U)
#define CRC_REGL1 (*(volatile uint32 *)0xFE000068U)
#define CRC_REGH1 (*(volatile uint32 *)0xFE00006CU)
/*SAFETYMCUSW 61 D MR: 8.10,8.11 <APPROVED> Comment_1*/
uint64 SL_CRC_Calculate (uint64* startAddr, const uint32 count64)
{
volatile uint32 count = 0u; /* volatile in order to prevent from being optimised */

CRC_CTRL0 |= 0x00000001U; /* Reset the CRC Module */
CRC_CTRL0 &= 0xFFFFFFFEU;
CRC_CTRL2 |= 0x00000003U; /* Configure to Full CPU Mode */

/*SAFETYMCUSW 134 S MR: 12.2 <APPROVED> Comment_5*/
/*SAFETYMCUSW 134 S MR: 12.2 <APPROVED> Comment_5*/
for (count=0u; count < count64; count++) {
/*SAFETYMCUSW 45 D MR:21.1 <APPROVED> Comment_2*/
/*SAFETYMCUSW 93 S MR: 6.1,6.2,10.1,10.2,10.3,10.4 <APPROVED> "LDRA Tool issue" */
CRC_SIGREG = (uint64)(*startAddr);
/*SAFETYMCUSW 45 D MR:21.1 <APPROVED> Comment_2*/
/*SAFETYMCUSW 567 S MR:17.1,17.4 <APPROVED> "Pointer increment needed" */
startAddr++;
}
return(CRC_SIGREG);
}