CV-Bowen opened a new pull request, #22391:
URL: https://github.com/apache/nuttx/pull/22391
## Summary
- `include/sys/param.h: add MIN3/MAX3 helpers`: used by the next commit.
- `!drivers/serial/uart_rpmsg: rework uart_rpmsg to counter-based flow
control`: every WRITE waited for a response carrying the accepted byte
count, so the link carried one frame per round trip. The protocol now
follows net/rpmsg/rpmsg_sockif.c: a single frame `{cmd, pos, len,
data}`; SYNC announces the receive capacity, DATA carries the
sender's consumed position (`len == 0` is a pure acknowledgement).
The sender keeps `sendsize`, `sendpos` and `ackpos` and sends while
`sendsize - (sendpos - ackpos)` is not 0; credit is returned once the
reader has consumed more than half of the receive buffer. The endpoint
runs at `RPMSG_PRIO_RT`.
## BREAKING CHANGE
The uart_rpmsg wire protocol changes: a core with this change cannot
talk to one with the old request/response protocol. Quick fix: update
both ends together.
## Impact
- uart_rpmsg wire protocol, see above. `uart_rpmsg_init()` and the
device names are unchanged.
- New `MIN3()` / `MAX3()` in `<sys/param.h>`.
## 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
Both commits build sim:rpserver, sim:rpproxy, qemu-armv8a:rpserver and
qemu-armv8a:rpproxy with 0 warnings (sim:rpserver/rpproxy use
uart_rpmsg: the proxy's nsh is `/dev/ttyproxy` on the server).
Through `cu /dev/ttyproxy` on sim: 15 rounds of `ls -l /proc` and
`cat /proc/meminfo` on the proxy, each followed by `rpmsg ping all 5
512 1 0` on the server: 45/45, no assertion.
No regression in rpmsg: sim:rpserver/rpproxy and
qemu-armv8a:rpserver/rpproxy boot and pass the fixed rpmsg cases (dump, ping,
rpmsgfs; 15/15; the sim proxy cases run over `/dev/ttyproxy`). 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]