cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong CRC on STM32F3 at byte-level

elettromanu
Associate II
Posted on April 08, 2015 at 13:09

I'm trying to

use

the

CRC

peripheral on STM32F3

to calculate the

CRC

at

byte-level

but I can not

get the same result

as

indicated

in

application note

AN4187

.

The

following snippet of

code should

return a

CRC

equal to

0x4C

(according to AN4187) instead

I get 0x80

.

Where

is the error

?

            CRC->INIT = 0xFF;

            CRC->CR = CRC_CR_POLYSIZE_1;

            CRC->POL = 0xCB;        

            CRC->CR |= CRC_CR_RESET;

            CRC->DR = 0xC1;

p.s. The

peripheral

clock has been enabled.

Many thanks in advance for your help.

#stm32f3-crc
2 REPLIES 2
Posted on April 08, 2015 at 15:58

Perhaps you want

*((uint8_t *)&CRC->DR) = 0xC1;

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
elettromanu
Associate II
Posted on April 09, 2015 at 09:54

That's right!

Clive

thanks

for your

invaluable

support!

Best Regards