crc

Make CRC on stm32 match with software implementation

限于喜欢 提交于 2021-02-19 04:22:45
问题 Upd. See the end of post for working code I'm already mad with this. How can I make checksum from CRC unit on stm32f103 match with software implementation? Stm has polynom 0x04C11DB7 and reset value 0xFFFFFFFF . So I've tried to calculate it in python. Code for stm: uint32_t crc32_hard_block(uint32_t *buf, uint32_t len) { CRC_ResetDR(); uint32_t crc = CRC_CalcBlockCRC(buf, len); return crc; } uint32_t buf[4] = {50, 10, 243, 147}; uint32_t crc_hard_block = crc32_hard_block(buf, 4); Code for

Is it possible to do rudimentary error correction with CRC?

梦想的初衷 提交于 2021-02-17 13:08:37
问题 I know the whole intention of using CRC is to do error detection, but I heard someone state that it can be used to do basic error correction in addition to error detection. I was curious if this was the case, and if so, how powerful is it? I mean, we usually refer to CRC as capable of performing x-bit detection, but I'm curious if it is capable of performing x-bit correction. If so, how does this work? Thanks. 回答1: It is possible to do single-bit error correction with a CRC. Assume one has a

Is it possible to do rudimentary error correction with CRC?

青春壹個敷衍的年華 提交于 2021-02-17 13:07:55
问题 I know the whole intention of using CRC is to do error detection, but I heard someone state that it can be used to do basic error correction in addition to error detection. I was curious if this was the case, and if so, how powerful is it? I mean, we usually refer to CRC as capable of performing x-bit detection, but I'm curious if it is capable of performing x-bit correction. If so, how does this work? Thanks. 回答1: It is possible to do single-bit error correction with a CRC. Assume one has a

Most efficent way to calculate CRC64 with reflected input

我的未来我决定 提交于 2021-02-07 14:47:47
问题 I need to calculate a CRC-64 using this setup into this wonderful website: http://www.sunshine2k.de/coding/javascript/crc/crc_js.html As you can see I require "input reflected" and that means that I need to reverse the bit order of any byte (a bit annoying). For the moment, I implemented this with a lookup table (for example 0x55 -> 0xAA), but I was wondering if there is any property of CRC which can be used to be more efficient. This is my code (in C): static const unsigned long long CRC64

CRC midstream instead of at the end

廉价感情. 提交于 2021-01-29 07:28:58
问题 Normally one would add a CRC to the end of the data stream. The CRC check would include the CRC itself and return 0 if the CRC is correct. I need to add a CRC to verify my embedded code. It needs to be checked in place, but the top word in memory space is for an interrupt vector. Is it possible to place a key value midstream such that the CRC check returns 0 for the whole code? (or is this unsolvable?) 回答1: It's definitely possible. You can run a CRC backwards, which would be fast and easy.

Why we need to invert crc? In which cases we need to do this?

家住魔仙堡 提交于 2021-01-29 04:18:13
问题 Why we need to invert crc? In which cases we need to do this? (invert mean crc = ~crc ) Is it defence from zero cases (when whole message is consists of zeros)? How it helps in this case? 回答1: You mean invert, or take the one's complement. (Reverse would mean swapping the order of the bits, undoing a CRC calculation, or reverse-engineering the CRC parameters.) That is done when the CRC parameters are defined that way. See this list of CRCs, where those with xorout defined as all 1's are

Verification of a CRC checksum against zero

和自甴很熟 提交于 2021-01-07 01:30:46
问题 I had some contact with the CRC-16 checksum in the past and was accustomed to verifying it by recalculating the CRC-16 checksum over the file I want to verify, plus the 2 bytes of the CRC-16 itself. If the result was zero, then the file integrity was valid, otherwise not. This can be coded very efficiently like with the following pseudo-C: if (recalculated_crc16_checksum != 0) // Error: file integrity is corrupt else // Success: file integrity is valid I recently wanted to use the CRC-32

crc32 function explanation with regards to data streams

房东的猫 提交于 2021-01-07 01:29:52
问题 Where I can find this crc32() function in detail? I saw this Link but I couldn't figure out how CRC is being calculated. I asked a question about updating the CRC based on the data stream instead of waiting to have all the data. I got the answer as follows (Thanks to @MarkAdler): unsigned long crc = crc32(0, NULL, 0); // initial CRC for (...) { // some sort of loop ... // generating a chunk of data crc = crc32(crc, buf, len); // update the CRC with the data ... // this all gets repeated many

undetected error probabilities in CRC and relation to link error rate

蹲街弑〆低调 提交于 2020-12-13 03:44:05
问题 How does the probability of undetected error vary as a function of link type ? are they related at all? I mean if the link is lossy or has a higher bit error rate how this would affect the Undetected Error Probability? Is there any formula to calculate that? 回答1: What you really mean by "link type" is the error characteristics of the channel. On a channel with a high bit error rate, e.g. the number of bits in the CRC ( n ) in error somewhere in each message (where each messages gets a CRC),

undetected error probabilities in CRC and relation to link error rate

最后都变了- 提交于 2020-12-13 03:41:20
问题 How does the probability of undetected error vary as a function of link type ? are they related at all? I mean if the link is lossy or has a higher bit error rate how this would affect the Undetected Error Probability? Is there any formula to calculate that? 回答1: What you really mean by "link type" is the error characteristics of the channel. On a channel with a high bit error rate, e.g. the number of bits in the CRC ( n ) in error somewhere in each message (where each messages gets a CRC),