cancel
Showing results for 
Search instead for 
Did you mean: 

CRC calculation unit

ostheim
Associate II
Posted on March 26, 2008 at 07:20

CRC calculation unit

12 REPLIES 12
ostheim
Associate II
Posted on May 17, 2011 at 12:26

Hello!

I've just found in the datasheet some hints regarding a crc calculation unit. But I miss the details about it.

As far as I understand the information in the overview, I suspect there is some support to calculate a checksum of a series of 32-bit words and thus support checksum verification of selected data. I assume there is some kind of function or interface that is given the current data and returns the calculated checksum.

I've checked the documents but couldn't find:

  • which polynomial is used

  • how to invoke the crc calculation unit

  • how to initialise the crc calculator

    I plan to use some IAP-scheme with CRC protection. Well, I know it's not too difficult to implement a fast CRC-generator using a pre-calculated table, but it seems to be already there and ready to use ....

    Thanks

    Mike

bob239955
Associate II
Posted on May 17, 2011 at 12:26

see;-

http://www.st.com/stonline/products/support/micro/files/um0427.zip

. Specifically; \STM32f10xFWLib\FWLIB\examples\SPI\Example3

http://www.st.com/stonline/products/literature/an/13649.pdf

; Section3 STM32F10xxx Full duplex SPI-SPI comms with CRC transfer.

http://www.st.com/stonline/products/literature/rm/13902.pdf

Section 18.4.4 SPI CRC Polynomial Rgeister: SPI_CRCPR offset 0x10

and also Section 18.4.5 SPI RXCRCR, Section 18.4.6 SPI_TXCRCR

- CRC used is (by default) 16bit CCITT CRC. Section 18.4.5 RM0008.

- Invoke by setting bit CRCEN in SPI_CR1. Section 18.4.1 RM0008.

- Initialise by clearing then setting SPE in SPI_CR1.Section 18.4.1 RM0008.

The SPI has a CRC generator/checker, the UART does not!:-Y

[ This message was edited by: bobz on 17-03-2008 16:23 ]

lanchon
Associate II
Posted on May 17, 2011 at 12:26

I2C also has an 8-bit CRC

jas
Associate II
Posted on May 17, 2011 at 12:26

I did a google search for 13587.pdf, 1st hit was V5.0 march data sheet here

http://www.st.com/stonline/products/literature/ds/13587.pdf

Looks like it hasnt filtered down to the Cortex Literature page yet.

ostheim
Associate II
Posted on May 17, 2011 at 12:26

Thanks for your replies :D

Sorry, it seems my question wasn't too clear.

I've seen there are several CRC-components attached to communication ports (I2C,SPI,USB). But as far as I understand these are hardwired to the communication port.

My question refers to the recently released datasheet(13587.pdf, Rev 5, March 2008)

Quote:

CRC (cyclic redundancy check) calculation unit

The CRC (cyclic redundancy check) calculation unit is used to get a CRC code from a 32-bit

data word and a fixed generator polynomial.

Among other applications, CRC-based techniques are used to verify data transmission or

storage integrity. In the scope of the EN/IEC 60335-1 standard, they offer a means of

detecting errors in a so-called non-volatile memory (here a Flash memory). The CRC

calculation unit helps compute a signature of the software during runtime, to be compared

with a reference signature generated at link-time and stored at a given memory location.

This CRC unit seems not to be embedded in some communication port as the others are. It's purpose is to check integrity of programmed data in memory.

Is there somewhere more information about how to use this feature?

Regards

Mike

bob239955
Associate II
Posted on May 17, 2011 at 12:26

..er can you post a link to this revision 5 document. It seems that only revision 4 is available here

http://www.st.com/mcu/familiesdocs-110.html#Datasheet

Thanks. :D

bob239955
Associate II
Posted on May 17, 2011 at 12:26

Actually the link

http://www.st.com/mcu/familiesdocs-110.html#Datasheet

does link to the Googled revision 5 but the link is decribed as revision 4 - so we might be forgiven for not noticing it has been updated.

Maybe the answer to the original question will soon be forthcomming in a matching new revision of the Flash Programming reference here;-

http://www.st.com/stonline/products/literature/ds/13259.pdf

That would be a revision greater than 2. But watch out for the April 1st edition. :o 2.0

[ This message was edited by: bobz on 18-03-2008 23:31 ]

lanchon
Associate II
Posted on May 17, 2011 at 12:26

great! I love working with outdated docs, it makes this otherwise dull work much more fun and challenging!

yep, new peripheral at 0x40023000. I doubt we have it in our hardware though. must be a last minute change to conform with some kind of ''safety'' standard.

16-32micros
Associate III
Posted on May 17, 2011 at 12:26

Dear all,

As you have presumed, We have added a new general purpose HW CRC calcultaion unit feature in our documentation and is already existing in STM32 silicon to enhance safety and Code/Program checking inside Flash or RAM to check the integrity and inrease the protection level of the code and avoid you implementing it by Firmware with minimum SW overhead : The CRC (cyclic redundancy check) calculation unit is used to get a CRC code from a 32-bit data word and a fixed generator polynomial :

This feature will be described in details in our Next release of Reference Manual (RM0008) and how to use it in your final applications.

The CRC calculation unit helps compute a signature of the software during runtime, to be compared with a reference signature generated at linktime ( Bootloader or IAP , Tools, etc..) and stored at a given memory location in Flash for example.

Cheers,

STOne-32