I'm trying to generate a CRC at both the server end (JAVA) and the device end to compare after transmitting a file via GPRS.
The JAVA code just uses the util.zip.CRC32 library and is straightforward. I've checked the output of that against online CRC32 calculators and have no issue.
The following 32 byte test string:
String input = "DEADBEEFDEADBEEFDEADBEEFDEADBEEF";
has a CRC output of: 0x7157cda5
I'm using an F4 device. According to the appnote:
http://www.st.com/st-web-ui/static/active/en/resource/technical/document/application_note/DM00068118.pdfpage 13, the fixed initial value and polynomial is the same as CRC32 and the same as the JAVA implementation, so in theory they should be the same... right?
So I've tried feeding it into the CRC generator in different ways but I can't seem to get a match for the same string. I'm hoping someone has done this before and can see the error of my ways.
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_CRC, ENABLE);
uint8_t buffer[32] = "DEADBEEFDEADBEEFDEADBEEFDEADBEEF";
CRC_ResetDR();
CRC_CalcBlockCRC((uint32_t*)buffer, 32/4);
printf("CRC value: %#x", CRC_GetCRC());
Gives me an output of: 0x36b4e934