CRC calculation

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi guys,

I need your help!

The main idea is calculating crc value before uploading the flash and saving it to the eeprom section for comparing by the MCU while booting.

I want to calculate the same crc value as calculated by my ATxMega256A3u in a low level driver(NVM_CMD_APP_CRC_gc).

What exactly the polynomial i need to use? What exactly i need to do with the flash HEX file?

And which range in the application section, the driver performing the calculations?

 

Here is my ATxMega256A3U code for it - 

void crcCalc(void){

    // Wait until NVM is not busy

   do {

      /* Block execution while waiting for the NVM to be ready. */

   } while ((NVM.STATUS & NVM_NVMBUSY_bm) == NVM_NVMBUSY_bm);

 

   // load and execute NVM command

   NVM.CMD = NVM_CMD_APP_CRC_gc;

   NVM_EXEC();

 

   calcCRC = (NVM.DATA2 << 16) | (NVM.DATA1<< 8) | NVM.DATA0;

   ...

   // Next, saving it to eeprom for further comparing...

}

Last Edited: Mon. Jul 17, 2017 - 07:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

There have been other threads about XMega CRC calculation. Google certainly must know?

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i'm already used this function but it's doesn't give me a same result like in EEPROM

i need to know in what range xmega calculating crc