This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 86b2851345d1f50f83e1b67ebbea8fca4ffae747
Author: Bowen Wang <[email protected]>
AuthorDate: Thu Nov 5 10:57:26 2026 +0800

    drivers/rpmsg: describe the port frame check as an XOR checksum
    
    The frame check of rpmsg_port_uart and rpmsg_port_spi is xorsum16(), not
    a CRC. Say so in the frame format documentation and in the Kconfig
    prompts, and note in the help what the checksum does not catch.
    
    Signed-off-by: Bowen Wang <[email protected]>
---
 Documentation/os/drivers/special/rpmsg/rpmsg_port_uart.rst |  3 ++-
 drivers/rpmsg/Kconfig                                      | 12 ++++++++++--
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/Documentation/os/drivers/special/rpmsg/rpmsg_port_uart.rst 
b/Documentation/os/drivers/special/rpmsg/rpmsg_port_uart.rst
index 9fe32059d5a..1fc9b5d473d 100644
--- a/Documentation/os/drivers/special/rpmsg/rpmsg_port_uart.rst
+++ b/Documentation/os/drivers/special/rpmsg/rpmsg_port_uart.rst
@@ -127,7 +127,8 @@ Data Frame Format
    │ 2 byte │ 2 byte │ 2 byte │ 2 byte │   N bytes    │
    └────────┴────────┴────────┴────────┴──────────────┘
 
-- crc: CRC16 checksum (optional, enabled via CONFIG_RPMSG_PORT_UART_CRC)
+- crc: 16-bit XOR checksum of the rest of the frame, see ``xorsum16()``
+  (optional, enabled via CONFIG_RPMSG_PORT_UART_CRC)
 - cmd: Command field (unused for data frames, set to 0)
 - avail: Available space (unused for data frames, set to 0)
 - len: Total length including header
diff --git a/drivers/rpmsg/Kconfig b/drivers/rpmsg/Kconfig
index aa504879a0d..ea819a64ecb 100644
--- a/drivers/rpmsg/Kconfig
+++ b/drivers/rpmsg/Kconfig
@@ -102,8 +102,12 @@ config RPMSG_PORT_SPI_THREAD_STACKSIZE
        default 4096
 
 config RPMSG_PORT_SPI_CRC
-       bool "Rpmsg SPI Port Use CRC Check"
+       bool "Rpmsg SPI Port Use Checksum"
        default n
+       ---help---
+               Check every frame with a 16-bit XOR checksum (xorsum16()). It
+               catches corrupted framing at little cost, but it is not a CRC: 
it
+               misses errors that flip the same bit in two 16-bit words.
 
 config RPMSG_PORT_SPI_RX_THRESHOLD
        int "Rpmsg SPI Port Rx Buffer Threshold"
@@ -144,8 +148,12 @@ config RPMSG_PORT_UART_TX_THREAD_STACKSIZE
        default DEFAULT_TASK_STACKSIZE
 
 config RPMSG_PORT_UART_CRC
-       bool "Rpmsg UART Port CRC Enable"
+       bool "Rpmsg UART Port Checksum Enable"
        default n
+       ---help---
+               Check every frame with a 16-bit XOR checksum (xorsum16()). It
+               catches corrupted framing at little cost, but it is not a CRC: 
it
+               misses errors that flip the same bit in two 16-bit words.
 
 config RPMSG_PORT_UART_COMPRESSION
        bool "Rpmsg UART Port LZF Compression"

Reply via email to