Can the STM32 CRC peripheral be made to work with the CRC-15_CAN polynomial?
Can the CRC for the ADBMS1818 (and other Analog Devices BMS parts) be generated using the STM32 CRC peripheral?
The ADBMS1818 datasheet shows a 15 bit polynomial for the CRC as--
x 15 + x 14 + x 10 + x 8 + x 7 + x 4 + x 3 + 1
Other sources call this a CAN-15-CRC polynomial, e.g., the Wikipedia article Cyclic redundancy check.
Wikipedia lists this polynomial as "even", and the Ref Manual for the STM32L431 says that the CRC peripheral does not work for even polynomials. However, it is not clear as to the exact definition of what Wikipedia and ST are using for "even." So, it is not clear that this polynomial can be handled with the 'L431 CRC.
However, if the problem is odd/even, there might be some tricks to make it work, e.g. reversal of the polynomial with a zero added, but I'm not sure if that is possible. I've made some attempts that have not been successful.
Finally, the datasheet has an example of software routine for generating the CRC. It uses a polynomial representation of 0x4599. However, the Wikipedia and its references show it as 0xC599 (16b!).
For software implementation the usual table lookup is probably satisfactory, however if it is possible to make use of the 'L431 hardware it would save the memory space for the table and provide a small improvement in computation time.
