cancel
Showing results for 
Search instead for 
Did you mean: 

Checksum calculation on C-Flash

Santhamurthy R
Associate II
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 discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Erwan YVIN
ST Employee
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

View solution in original post

1 REPLY 1
Erwan YVIN
ST Employee
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