TriCore TC277 CRC Generation

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User16165
Level 1
Level 1
Hi,

I am looking into the possibility of using the FCE peripheral in 32-bit CRC mode to validate application code stored in PFlash. The application code will contain its CRC value that is calculated at link time using the Tasking linker checksum algorithm which is also used to create the boot mode header (BMHD) CRC values. I can successfully get the linker to create a 32-bit CRC over a specified flash memory range and embed this value to a known location; I can also get the FCE to calculate its CRC over this same range but the two CRC's differ. I am still trying to understand why they are not the same and have even limited the address range to a single 32-bit value. I notice in the FCE and linker documentation, the former refers to using a polynomial of 0x04C11DB7 and the latter a polynomial of 0xEDB88320; apparently one is the reversed polynomial of the other. Does this render using the FCE and linker CRC calculations incompatible with each other? i.e. will they always return different CRC's?

Any help/suggestions much appreciated.
Regards
Richard
0 Likes
3 Replies
User16165
Level 1
Level 1
Any suggestions/thoughts??
0 Likes
VincentWan
Employee
Employee
50 replies posted 5 sign-ins First like received
Hi

Yes, with different polynomial, you will get different CRC results.
You can try the link below to check your calculated data CRC result with different polynomial.

http://www.sunshine2k.de/coding/javascript/crc/crc_js.html
0 Likes
lock attach
Attachments are accessible only for community members.
DissegnaR
Employee
Employee
First reply posted Welcome!

Hi,

I was trying to implement a piece of code that checks if the CRC calculated with the FCE block is the same as the one calculated with the assembly instruction CRC32 used in the iLLD function IfxCpu_calculateCrc32().

By reading the user manual of the microcontroller I am using (TC297), I can see that the protocol used is the IEEE 802.3 ethernet, in the same way by checking the "Instruction set" document of the Tricore  TC1.6 P&E  I can see that the CRC32 instruction contained in the iLLD I am using is also adopting the same standard. 

The way tackle this was to take the already existing code in the project "FCE_CRC_1_KIT" and then I tried to compare the results I get from the CRC32 kernels with the result from the previously mentioned iLLD.

I also found out that the CRC calculated with the FCE corresponds with the one calculated in the internet page referred by the link previously posted by @VincentWan , by setting 
input reflected: on
result reflected:on
polynomial 0x4C11DB7
initial_value = 0x0
final xor value = 0xFFFFFFFF

My problem is that I cannot manage to obtain the same result using the iLLD function.
Are there any suggestions for me on how to get this right?

0 Likes