yangsong8-a1 opened a new pull request, #21781:
URL: https://github.com/apache/nuttx/pull/21781
## Summary
The CMSDK APB UART has a single RX holding register. It only raises the RX
interrupt if RX_INT_ENABLE is set at the moment a byte arrives. A byte that
arrives while the enable is clear sets RX_BUF_FULL without an interrupt,
and RX then stalls for good.
- When the RX interrupt is enabled, drain a byte that is already waiting
(e.g. one received during boot before `uart_cmsdk_rxint()` ran).
- `up_putc()` now masks only the TX interrupt enables during polled
output, so RX interrupts stay enabled.
- Remove `uart_cmsdk_restoreuartint()`, which is now unused (clang
`-Wunused-function` error).
- A whitespace-only commit first fixes the existing nxstyle errors in
serial_cmsdk.c.
## Impact
Only boards that use drivers/serial/serial_cmsdk.c (CONFIG_CMSDK_UART,
e.g. MPS2/MPS3).
## Testing
Ubuntu 22.04, gcc 13.1, arm-none-eabi-gcc 10.3, clang 14.
- Built mps2-an500:nsh, mps2-an521:nsh and mps3-an547:nsh, no warnings.
- clang 14 (`--target=thumbv7em-none-eabihf -Wall`) on serial_cmsdk.c:
without the last commit it warns that `uart_cmsdk_restoreuartint` is
unused; with it there is no warning.
- QEMU 6.2, mps2-an500:nsh and mps3-an547:nsh. A host script checks input
echo, then runs 50 rounds. Each round sends `help`, `ps`, `ls -l /dev`
back to back without waiting, types a command one character at a time
while that output is printed, and requires `echo ALIVE_<n>` to answer
within 10 s:
```
mps2-an500 echo test: PASS rounds: 50, bytes received: 146052 PASS
mps3-an547 echo test: PASS rounds: 50, bytes received: 145018 PASS
```
--
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]