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.

TMS320F28027F: Flash CRC Instability

Part Number: TMS320F28027F

All,

I'm using the STL_CRC_TEST_testNvMemory() function in the IEC_60730 ti firmware to calculate the Flash CRC for memory regions B thru D. Calculating the CRC at the start of the program yields the same CRC each time. If I run the same CRC function during operation, I get a different CRC result and that result will change in subsequent calls. I currently do not have any functions in the program that modify Flash. Any help would be much appreciated.

void IEC_Running_CRC(void) {
	DINT;
	IEC_disableFlashPreFetch();
	STL_CRC_TEST_testNvMemory((uint32_t *)FLASH_SECTOR_B_D_START,(uint32_t *)FLASH_SECTOR_B_D_END,(uint64_t *)&gGoldenCRC[4],NV_TYPE_FLASH);
	gCRC = STL_CRC_TEST_getCrcResult();
	IEC_enableFlashPreFetch();
	EINT;
}

Regards,

  • Hi Drew,

    Are you using breakpoints in your code when you are testing this? Because the PSA is cycle based, any breakpoint can possibly impact the results.

    sal
  • Additionally, Try getting the CRC result after enabling the prefetcher.

    sal
  • On top of what Sal suggested,

    when CRC is calculated, is the device unlocked and is CRC algorithm running from secure memory (or) unsecure memory? This could have an impact on CRC value.

    Manoj

  • Sal & Manoj,

    I think I've narrowed the instability down. When I disable the live update feature in the debugging windows and only check the CRC using the pause button the CRC becomes stable. It also seems that interrupts have to be disabled in order to get a stable CRC value. Is there any way other than using the PSA to efficiently calculate a Flash CRC with interrupts still enabled.

    Regards,

  • Drew,

    Thanks for the update. This is consistent with the PSA being a cycle by cycle calculation. Any debugger read and any interrupt will corrupt the PSA's CRC calculation because the PSA is snooping and calculating the CRC from the data bus. And because it is cycle by cycle, if there is even an unexpected stall or ISR, the calculation will be corrupted.

    It depends on how "efficient" you want the CRC calculated. You could always use the C28x to calculate the CRC but this will be much slower.

    The F2806x and F2807x in the Piccollo series both are equipped with the VCU engine which will greatly increase the performance of the CRC calculation.

    sal