There have been a lot of questions about the CRC on this part. Most of the recommendations are to send a command to disable the CRC or alternatively use a slow, bit-by-bit algorithm. The below code implements the CRC for this part using a byte-by-byte algorithm. It is based on a state machine approach where the present state is the current CRC and the input data is eight bits of data.
static const uint8_t crc_lut[16][128] = { |
If anyone can think of a way to reduce the table size further, let me know.