Dear Champs,
I am asking this for our customer.
Would you please help clarify?
We use input below.
static const uint16 testInput[CRC_TEST_PACKET_LEN] = {
0x4001, 0x8002, 0xC003, 0x0004, 0x4005, 0x8006, 0xC007, 0x0008
};
main()
{
...
// Calculate CRC-32 example
crc32ResultVcu = getCRC32_vcu(0xFFFFFFFF, (uint16*)testInput,
(CRC_parity_e)CRC_parity_even, CRC_TEST_PACKET_BYTES);
...
}
The result is 0xA0626DD6 shown below.
From online calculator
https://www.lddgo.net/en/encrypt/crc
The result is 0x9B37AF70.
We tried different online tools and they were the same, but the result is different from that by our VCU0 CRC.
Would you please help clarify?
The code we use is enclosed here - using the TI LED blink example and this CRC32 calculation.
// // Included Files // #include "driverlib.h" #include "device.h" #include "vcu0_crc.h" //! Test Packet Length in number of words #define CRC_TEST_PACKET_LEN 8 //! Test Packet Length in number of BYTES #define CRC_TEST_PACKET_BYTES (CRC_TEST_PACKET_LEN << 1) static const uint16 testInput[CRC_TEST_PACKET_LEN] = { 0x4001, 0x8002, 0xC003, 0x0004, 0x4005, 0x8006, 0xC007, 0x0008 }; volatile uint32_t crc32ResultVcu; // // Main // void main(void) { // // Initialize device clock and peripherals // Device_init(); // // Initialize GPIO and configure the GPIO pin as a push-pull output // Device_initGPIO(); GPIO_setPadConfig(DEVICE_GPIO_PIN_LED1, GPIO_PIN_TYPE_STD); GPIO_setDirectionMode(DEVICE_GPIO_PIN_LED1, GPIO_DIR_MODE_OUT); // // Initialize PIE and clear PIE registers. Disables CPU interrupts. // Interrupt_initModule(); // // Initialize the PIE vector table with pointers to the shell Interrupt // Service Routines (ISR). // Interrupt_initVectorTable(); // // Enable Global Interrupt (INTM) and realtime interrupt (DBGM) // EINT; ERTM; // Calculate CRC-32 example crc32ResultVcu = getCRC32_vcu(0xFFFFFFFF, (uint16*)testInput, (CRC_parity_e)CRC_parity_even, CRC_TEST_PACKET_BYTES); // // Loop Forever // for(;;) { // // Turn on LED // GPIO_writePin(DEVICE_GPIO_PIN_LED1, 0); // // Delay for a bit. // DEVICE_DELAY_US(500000); // // Turn off LED // GPIO_writePin(DEVICE_GPIO_PIN_LED1, 1); // // Delay for a bit. // DEVICE_DELAY_US(500000); } }