Skip to main content
stanzanim
Associate III
April 15, 2016
Question

STM32Foxx CRC: usage of HAL Drivers

  • April 15, 2016
  • 11 replies
  • 3702 views
Posted on April 15, 2016 at 14:34

I want to make the CRC progress as soon as I receive bytes so I want to calculate partial CRCs as soon as the packet is entering the system. Should I use 

HAL_CRC_Accumulate with buffer size =1?

I also deal with bytes incoming and want to get a 16 bit CRC. Should I simply cast to (uint_16 the 32 bit results)

I cannot fing so many C example on the web ... some initial questions 

- how can I setup the peripheral to work with 8 bit data and generating a 16bit CRC?

- how can I set a generator polynomial for MODBUS (0xA01 16 bits)? It looks like Cube MX 4,13 does not allow to disable automatic poly generation from the MX GUI ... see separate post). Or maybe the STM32F030K6 (target device)  does not allow manual poly assignment (which is crazy, IMO)

thanks
    This topic has been closed for replies.

    11 replies

    stanzanim
    stanzanimAuthor
    Associate III
    April 20, 2016
    Posted on April 20, 2016 at 23:45

    I am struggling to make the USART Rx working with DMA HAL drivers: thanks much, I'll let you know