Hi, I am completely stuck -- the STM32 does not compute any CRC value for me -- I always read zero from the CRC_DR register. I just used the standard peripheral library V3.5.0. My test code is: #include ''stm32f10x_crc.h'' uint32_t crc; const uint32_t crctestdata[] = { 0x01020304, 0x05060708, 0x090a0b0c, 0x0d0e0f00}; void test(void) { CRC_ResetDR(); crc = CRC_CalcBlockCRC(crctestdata, 4); } I am using the STM32F10ZGT on an STM3210E-EVAL board. Regards Dirk
The functionuint32_t revbit(uint32_t data) doesnt work for me.
I get the same data as were inserted.
I was trying debug it, Assembler part -asm(''rbit r0,r0''); -works but function doesnt return register R0.
It is a cheap hack. I'd probably write the whole thing in assembler myself, and in-line, the code was provided as a quick demonstration / proof of concept. The assembler I'd expect for the function would be revbit: rbit r0,r0 bx lr Or you could just implement it in C u32 revbit(u32 data) { int i; u32 rev = 0; for(i=0; i<32; i++) rev |= ((data >> i) & 1) << (31 - i); return rev; }; What tool chain are you using? This was based on the IAR code provided