Please select Into the mobile phone version | Continue to access the computer ver.

CRC32 code in SDK

[Copy Link]
Author: jeroenD | Time: 2021-9-16 22:01:45 | Others|
1 76

1

Threads

1

Posts

5

Credits

Kindergarten

Rank: 1

Credits
5
Posted on 2021-9-16 22:01:45| All floors |Read mode
Hello,

could it be that there is an error in the Livox example code to generate the 32bit CRC checksum?

while (((uintptr_t)data & 3) && len) {
                crc = (crc >> 8) ^ CRC_TABLE_CRC32[(crc & 0xff) ^ *data++];
                len--;
        }


((uintptr_t)data is the address of the variable , and will change every run, and is device dependent. However, since everything is stored on even address numbers, this & 3 will always be 0 and the while will never be taken.

JeroenD
Reply

Use props Report

2

Threads

104

Posts

429

Credits

Administrator

Rank: 9Rank: 9Rank: 9

Credits
429
Posted on 2021-9-24 17:41:57| All floors
You can refer to the following link:
https://github.com/Livox-SDK/Liv ... third_party/FastCRC
Reply

Use props Report

You need to log in before you can reply Login | Register

Credit Rules

Author's New Posts
Quick Reply Back to top