May 07, 2014
02:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 07, 2014
02:19 AM
According to the Reference Manual (xmc4500_rm_v1.4_2014_04.pdf) the resulting CRC value can be obtained from the register RESm at any time. But the fact is, that the FCE needs at least one processor tackt to finish the calculations, e.g.:
My code is optimized with -O3 flag and executed from PSRAM at 120 MHz.
uint32_t result;
// fisrt implementation
FCE_KE0->CRC = 0xFFFFFFFF; // CRC Seed
FCE_KE0->IR = 1;
FCE_KE0->IR = 2;
FCE_KE0->IR = 3;
result = FCE_KE0->RES; // <<< WRONG RESULT!!!
// second implementation
FCE_KE0->CRC = 0xFFFFFFFF; // CRC Seed
FCE_KE0->IR = 1;
FCE_KE0->IR = 2;
FCE_KE0->IR = 3;
__NOP();
result = FCE_KE0->RES; // <<< CORRECT RESULT!!!
My code is optimized with -O3 flag and executed from PSRAM at 120 MHz.
1 Reply
Aug 26, 2016
01:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 26, 2016
01:24 AM
Yes, this problem was not seen in earlier products because a wait state was always inserted. For XMC this needs to be done by software. We have documented this issue in the Errata Sheets.