2025-12-17 2:18 AM
Hello,
I would like to calculate a CRC-16/IBM-SDLC.
I configure the CRC_HandleTypeDef structure as below for HAL_CRC_Init function:
h->Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_DISABLE;
h->Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_DISABLE;
h->Init.GeneratingPolynomial = 0x00001021U;
h->Init.CRCLength = CRC_POLYLENGTH_16B;
h->Init.InitValue = 0x0000FFFFU;
h->Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_BYTE;
h->Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_ENABLE;
h->InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES;
But it seems that the parameters 'InputDataInversionMode' and 'OutputDataInversionMode' have no effect because I get 0xA60C as result for input 0x11 0x22 0x33 0x44 what it is matching with CRC-16/GENIBUS.
Someone could be help me to understand the issue?
2025-12-17 7:07 AM
Show your code.
If you're feeding in bytes (and not half-words or words) then InputDataInversionMode has no effect.
OutputDataInversionMode should have an effect.