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 -
// Wait until NVM is not busy
/* 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;
calcCRC = (NVM.DATA2 << 16) | (NVM.DATA1<< 8) | NVM.DATA0;
// Next, saving it to eeprom for further comparing...