Matching CRC32 from STM32F0 and zlib

后端 未结 5 1078
隐瞒了意图╮
隐瞒了意图╮ 2021-02-10 17:53

I\'m working on a communication link between a computer running Linux and a STM32F0. I want to use some kind of error detection for my packets and since the STM32F0 has CRC32 hw

5条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-10 18:19

    I had similar issues implementing a CRC on an STM32 CRC module where the final checksum was not matching. I was able to fix this by looking at the example code in stm32f30x_crc.c that is provided with STMCube. In the source it has a function for 8-bit CRC that used the following code

    (uint8_t)(CRC_BASE) = (uint8_t) CRC_Data;

    to write to the DR register. As stated previously, the line CRC->DR is defined as volatile uint32_t which will access the whole register. It would have been helpful if ST had been more explicit about accessing the DR register rather than simply saying it supports 8-bit types.

提交回复
热议问题