Hi, sebastien I fully understand your concerns, and I agree that changing the default algorithm may cause trouble to currently active projects. However, I have searched the code for the application scope of crc16 in nuttx, and I found that many drivers are using customized CRC-16/IBM implementations, which are not capabilities provided by the system.
CRC-16/IBM: Below drivers implement need CRC-16/IBM support: 1. 1wire_crc private implementation: (poly: 0x8005 (0xA001) initial seed: 0x0000, xor output: 0x0000) https://github.com/apache/nuttx/blob/master/drivers/1wire/1wire_crc.c#L73-L98 2. spi/uart driver communicate with linux: https://github.com/apache/nuttx/blob/master/drivers/rpmsg/rpmsg_port_spi_slave.c#L45-L46 https://github.com/apache/nuttx/blob/master/drivers/rpmsg/rpmsg_port_spi.c#L45-L46 https://github.com/apache/nuttx/blob/master/drivers/rpmsg/rpmsg_port_uart.c#L59-L60 ---------------------------------------- CRC-16/XMODEM: CRC-16/XMODEM is currently only used in y/zmodem in nuttx-apps: https://github.com/apache/nuttx-apps/blob/master/system/ymodem/ymodem.c#L176 https://github.com/apache/nuttx-apps/blob/master/system/zmodem/zm_state.c#L204 https://github.com/apache/nuttx-apps/blob/master/system/zmodem/zm_proto.c#L194 https://github.com/apache/nuttx-apps/blob/master/system/zmodem/zm_send.c#L996 Furthermore, we found that many communication protocols are using CRC-16/IBM implementation. In the email, I also explained that this is because popular operating systems, such as Linux/OpenBSD/FreeBSD are using CRC-16/IBM by default: OpenBSD: https://github.com/openbsd/src/blob/master/sys/lib/libkern/crc16.h FreeBSD: https://github.com/freebsd/freebsd-src/blob/main/sys/libkern/crc16.c Linux: https://github.com/torvalds/linux/blob/master/lib/crc16.c So I want to convince you further, I think this is better for the future development of NuttX Sebastien Lorquet <sebast...@lorquet.fr> 于2025年4月7日周一 21:19写道: > Hello, > > Compatibility with other OSes in this domain is dubious. > > What is the actual need for cross-OS crc16 compatibility? > > Self-compatibilty is much more important. What is a non volatile storage > structure was created by the old CRC (old release) is checked with the > new CRC? > > This will be an immediate fatal error with potentially grave consequences. > > I am FULLY AGAINST this change. > > It MUST NOT PROCEED. > > I still think you can introduce additional routines to compute other CRC > variations, but the default crc MUST DEFINITELY NOT CHANGE. > > Use the new routines in a wrapper in your code, but DO NOT CHANGE the > default CRC algorithm > > This is an ABSOLUTELY CRITICAL ISSUE! > > -1 > > Sebastien > > > On 07/04/2025 10:35, chao an wrote: > > Hi Community, > > > > I plan to switch the default CRC16 algorithm directory of NuttX from > > CRC-16/XMODEM to CRC-16/IBM: > > https://github.com/apache/nuttx/pull/16147 > > > > CRC-16/XMODEM as the default implementation has significant limitations, > > especially when communicating with popular operating systems and it comes > > to CRC encryption verification, the algorithm needs to be switched. > > > > I have conducted research on POSIX-compatible operating systems, and > almost > > all of them use CRC-16/IBM as the default implementation: > > > > OpenBSD: > > https://github.com/openbsd/src/blob/master/sys/lib/libkern/crc16.h > > > > FreeBSD: > > https://github.com/freebsd/freebsd-src/blob/main/sys/libkern/crc16.c > > > > Linux: > > https://github.com/torvalds/linux/blob/master/lib/crc16.c > > > > So I need your vote here: > > If you prefer CRC-16/XMODEM, please reply with -1. > > If you recommend CRC-16/IBM, please reply with +1. > > > > BRs, > > >