I'm sending data from python code to stm32g0xx mcu. I'm using stm32 hardware CRC computing unit and https://pypi.org/project/crc/ as the other side. Unfortunately I can't catch the common setup for both sides.
The mcu side is configured in the default way:
hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE;
hcrc.Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_ENABLE;
hcrc.Init.CRCLength = CRC_POLYLENGTH_32B;
hcrc.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE;
hcrc.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE;
hcrc.InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES;
On the python side, I'm trying every setup with the same polynomial 0x04C11DB7 (CRC32, BZIP2 and POSIX) but haven't succeeded yet.
Can you please recommend me a better way instead of trying every possible combination?
Thx
The magic formula for the python code to be compatible with the STM32 default is:
Thanks to @Ilya who confirmed my own thoughts I already had at the time.