Skip to main content
Santhamurthy R
Associate III
May 30, 2017
Solved

Checksum calculation on C-Flash

  • May 30, 2017
  • 1 reply
  • 980 views
Posted on May 30, 2017 at 13:35

Hello All,

 I am working on SPC560B54L5 board using SPC5studio version 5.2.3.

I am trying to implement the checksum calculation on the C-flash memory in my application. In order to implement checksum I am making use of ''pCheckSum( &ssdConfig, c_dest, c_size, &c_sum, (tpfNullCallback)NULL_CALLBACK);''  API of the flash driver component. In the ''SPC560Bxx_RLA Flash Test Application for Discovery''  I have found that after calculating the checksum, sum value is compared to 0x000000000.

My concern is that, in my application the calculated checksum is not equal to zero. Please explain what is the need for comparing the calculated value to Zero in Flash test application. (Is it due to the pre-calculated value of checksum is equal to zero).

Whereas ''Standard software driver for C90LC Flash'' document clearly describes the sum value will lie in 0x00000000 - 0xFFFFFFFF range.

0690X00000607BUQAY.png

Kindly explain the need for comparison of sum with 0x00000000 in the test application. Also kindly share the source code for the pCheckSum() API so that it will very helpful for us to understand the implementation of checksum API and make use of it as suitable to our application.

Thanks in Advance,

With Regards,

R.Santhamurthy

    This topic has been closed for replies.
    Best answer by Erwan YVIN
    Posted on June 08, 2017 at 11:35

    Hello R.Santhamurthy ,

    Sorry for the answer , i can miss any post not tagged in SPC5x and SPC5Studio

    we can not share this source code

    it seems that the sum value should be 0

    returnCode = pCheckSum( &ssdConfig, dest, size, &sum, (tpfNullCallback)NULL_CALLBACK);
     if ( C90FL_OK != returnCode )
     {
     ErrorTrap(returnCode);
     }
     /* The sum value should be 0 */
     if ( 0x00000000 != sum )
     {
     returnCode = (UINT32)DEMO_FAIL;
     ErrorTrap(returnCode);
     }�?�?�?�?�?�?�?�?�?�?�?�?

    Best regards

    Erwan

    1 reply

    Erwan YVIN
    Erwan YVINBest answer
    ST Employee
    June 8, 2017
    Posted on June 08, 2017 at 11:35

    Hello R.Santhamurthy ,

    Sorry for the answer , i can miss any post not tagged in SPC5x and SPC5Studio

    we can not share this source code

    it seems that the sum value should be 0

    returnCode = pCheckSum( &ssdConfig, dest, size, &sum, (tpfNullCallback)NULL_CALLBACK);
     if ( C90FL_OK != returnCode )
     {
     ErrorTrap(returnCode);
     }
     /* The sum value should be 0 */
     if ( 0x00000000 != sum )
     {
     returnCode = (UINT32)DEMO_FAIL;
     ErrorTrap(returnCode);
     }�?�?�?�?�?�?�?�?�?�?�?�?

    Best regards

    Erwan