2022-07-12 08:32 AM
I've been implementing I2C communication between F401CCU6 and Nucleo F746ZG, while adding CRC I got different outputs, Nucleo provides configurable CRC peripheral, while F401 is by default set to 0x4C11DB7 (https://www.st.com/resource/en/reference_manual/rm0368-stm32f401xbc-and-stm32f401xde-advanced-armbased-32bit-mcus-stmicroelectronics.pdf#page=68&zoom=100,89,116)It also provides reseting initial value to 0xFFFF FFFF, ("The CRC calculator can be reset to 0xFFFF FFFF with the RESET control bit in the CRC_CR register. This operation does not affect the contents of the CRC_IDR register")
I've set Nucleo CRC polynomial, init value to match those on BlackPill. Calculated value matches with CRC-32/MPEG-2 standard (available at https://crccalc.com/ for example).
Did anyone has experienced this too?
2022-07-14 06:43 PM
> HAL_CRC_Calculate(&hcrc, (uint32_t*)test_crc, 1);
> Should be working?
Sure. If you followed the often poorly documented way it was intended to be used by Cube's authors, it "works" exactly as those Cube authors intended. Which is not necessarily the same way you want, and it also may change with changing Cube version.
Use direct register access, if you want to have control over how it works.
JW