CV-Bowen opened a new pull request, #21445:
URL: https://github.com/apache/nuttx/pull/21445
## Summary
- `libs/libc: add crc16xor()`: a 16-bit XOR checksum of a buffer. It
reads the buffer as `uint64_t` once the pointer is 8-byte aligned,
64 bytes per loop iteration, and folds the result down to 16 bits.
- `drivers/rpmsg: check the port frames with crc16xor()`: rpmsg_port_spi,
rpmsg_port_spi_slave and rpmsg_port_uart compute the frame check with
`crc16xor()` instead of the CRC-16/IBM table lookup. The check runs on
every frame in both directions.
## Impact
New libc function `crc16xor()` in `<nuttx/crc16.h>`. With
`CONFIG_RPMSG_PORT_SPI_CRC` or `CONFIG_RPMSG_PORT_UART_CRC` on, the
value in the frame header changes, so both ends of a port link need this
change. No Kconfig change; with the CRC options off nothing changes.
## Testing
Host: Ubuntu 22.04.5 LTS x86_64, QEMU version 10.2.1, sim: cc (Ubuntu
13.1.0-8ubuntu1~22.04) 13.1.0, qemu-armv8a: aarch64-none-elf-gcc (Arm GNU
Toolchain 12.2.Rel1 (Build arm-12.24)) 12.2.1 20221205
qemu-armv8a:rpserver + qemu-armv8a:rpproxy (port uart link) with
`CONFIG_RPMSG_PORT_UART_CRC=y` added on both sides (test-only):
`rpmsg ping all 20 1024 3 0` from both sides, each byte checked by the
peer. 20/20 on master (`crc16ibm`) and with this PR (`crc16xor`), and
no `Recv error crc` in either log. `nm` confirms the PR build links
`crc16xor` and no longer `crc16ibm`.
The SPI ports were built only; there is no SPI port setup in the tree.
Baseline: No regression in rpmsg: sim:rpserver/rpproxy and
qemu-armv8a:rpserver/rpproxy boot and pass the fixed rpmsg cases (dump, ping,
rpmsgfs; 15/15). qemu-armv8a was built with LIBC_ENVPATH and BINFMT_CHECKEXEC
disabled, which current master needs for nxinit to start nsh there; unrelated
to this change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]