crc16_reflect()
showing unexpected results
#78135
-
Hello, I am migrating a project to Zephyr and I noticed there was a CRC module in Zephyr. Since CRC16 is being used in the project that I am working on, I decided to test the module and found that example code: #define POLYNOMIAL 0xD175
uint8_t src[] = "Hello, World.";
size_t len = sizeof(src) - 1;
uint16_t crc = crc16_reflect(POLYNOMIAL, 0, src, len);
// Expected value of crc: 0xF97E
// Received value of crc: 0x5F50 I checked the result with several web CRC calculators such as sunshine's CRC calculator Parameters:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
As per the documentation of the function, the polynomial should be reflected.
Using 0xae8b (0xd175 reflected) in the web calculator matches the output you're seeing :) |
Beta Was this translation helpful? Give feedback.
As per the documentation of the function, the polynomial should be reflected.
Using 0xae8b (0xd175 reflected) in the web calculator matches the output you're seeing :)