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.

TMS570LS0432: about TMS570LS ram and flash detect

Part Number: TMS570LS0432

Hello 

Team

 my system need to detect the flash  and  ram ,so I use the ti library the code is

Flash

start up.C  is
crcAtInit_FLASH = SL_CRC_Calculate((uint64 *)((uint32)&ulFlashStartAddr), ((((uint32)&ulFlashEndAddr)-((uint32)&ulFlashStartAddr)) >> 6));

in main loop  is

/* Run CRC Checks on Flash */

if (SL_CRC_Calculate((uint64 *)((uint32)&ulFlashStartAddr), ((((uint32)&ulFlashEndAddr)-((uint32)&ulFlashStartAddr)) >> 6)) == crcAtInit_FLASH)

{

//pass

}

else

{

//failed

}

-------------------------------------------------------------------------------

RAM

start up.C  is

crcAtInit_VIMRAM = SL_CRC_Calculate(((uint64 *)0xFFF82000),48);

in main loop  is

if (SL_CRC_Calculate(((uint64 *)(uint32*)0xFFF82000), 48) == crcAtInit_VIMRAM)

{

}

else

{

}

Is the way correct?

 Thank you

  • Hi Whong,

    The CRC module can be used to test the integrity of Flash contents by calculating a CRC for all Flash contents and comparing this value to a previously generated "golden" CRC. The "golden" CRC is the CRC value of the flash contents when they are programmed to the flash. It does not make sense to use the CRC value calculated in startup.c as "golden" CRC value to check the CRC calculated in main().

  • Hello

    You means  ,I need to  calculate the  "golden" CRC? and programmed to the flash?

    how to calculate the golden crc ,and Is ram the same as flash?

  • Hello 

     In the start up.C

    crcAtInit_VIMRAM = SL_CRC_Calculate(((uint64 *)0xFFF82000),48);

    crcAtInit_FLASH = SL_CRC_Calculate((uint64 *)((uint32)&ulFlashStartAddr), ((((uint32)&ulFlashEndAddr)-((uint32)&ulFlashStartAddr)) >> 6));

     It does not make sense to use the CRC value calculated in startup.c as "crcAtInit_VIMRAM”  and “crcAtInit_FLASH”  to check the CRC calculated in main()

    why?

    why does make no sence??

     Thank you

  • who can tell me?

  • The main purpose is to check if the flash content is changed by any kind of reasons, so you compare the calculated CRC with the "golden" CRC. The "golden" CRC is typically the CRC value of the flash content calculated when you programmed then to flash. 

    You use the CRC calculated in startup.c as "golden" CRC value, and compare it with the CRC calculated in main(). Theoretically there is no problem. But I don't see the benefit in a real application.