leocafonso opened a new pull request, #20463:
URL: https://github.com/apache/nuttx/pull/20463
## Summary
* Why: the current RA8M1 SCI_B driver does not support DTC/FIFO, had no
termios
ioctl, and the error interrupt handler never cleared its ICU IR flag
* What: arch/arm/src/ra8m1 (SCI_B driver + DTC engine + Kconfig),
boards/arm/ra8m1/ek-ra8m1 (SCI0 pins, new serial-test config), and
Documentation/platforms/arm/ra8m1.
* How:
- Adds the DTC (ra_dtc.c/.h) as a generic DMA engine, normal mode only.
- Generalizes FIFO/DTC from SCI9-only to every instance (SCI0-4, SCI9);
FIFO and DTC are mutually exclusive per instance, not combinable.
- Fixes the missing `ra_clear_ir()` in the error interrupt handler (the
livelock above) and adds a drain-on-error path so a receive error no
longer silently blocks all further reception.
- Adds termios `TCGETS`/`TCSETS` (baud/parity/stop bits) and
`TIOCGICOUNT`
(frame/overrun/parity counters).
- Adds SCI0's GPIO pins and a `serial-test` board config for exercising
this on hardware.
* No related NuttX/NuttX-Apps Issue or PR.
## Impact
* New feature added? YES: DTC support, per-instance FIFO, termios ioctl,
TIOCGICOUNT, and a new `serial-test` board config.
* Impact on user? YES: new opt-in Kconfig options
(`CONFIG_RA_DTC`, `CONFIG_RA_SCIn_FIFO`/`TXDTC`/`RXDTC`,
`CONFIG_SERIAL_TERMIOS`, `CONFIG_SERIAL_TIOCGICOUNT`); default `nsh`
config and existing SCI9-only behavior are unchanged.
* Impact on build? NO: all additions are Kconfig-gated; default configs
are unaffected.
* Impact on hardware? YES: arch/arm/src/ra8m1 (SCI_B driver) and
boards/arm/ra8m1/ek-ra8m1 (board.h, new config).
* Impact on documentation? YES: Documentation/platforms/arm/ra8m1 updated.
* Impact on security? NO.
* Impact on compatibility? NO: purely additive, mutually-exclusive
Kconfig options; nothing existing removed or renamed.
## Testing
I confirm that changes are verified on local setup and works as intended:
* Build Host(s): Linux (Ubuntu 24.04, x86_64), GCC 13.3.0 host /
arm-none-eabi-gcc 13.2.1 (Arm GNU Toolchain 13.2.rel1) target,
CMake+Ninja.
* Target(s): arm:ek-ra8m1 (R7FA8M1AHECBD), configs `nsh` and `serial-test`,
plus ad hoc FIFO/DTC/TIOCGICOUNT Kconfig combinations.
Reproduction steps, using the new `serial-test` config (SCI0 wired as
`/dev/ttyS1`, looped TX->RX externally, SCI9 as the console on a
separate terminal):
```
nsh> stty -F /dev/ttyS1 speed 3000000
nsh> serialrx /dev/ttyS1 1000 &
nsh> serialblaster /dev/ttyS1 1000
```
Testing logs before change:
(baseline: SCI9-only console, no FIFO/DTC/termios support existed)
Testing logs after change:
- cmake+ninja build clean (no warnings) for: default nsh, nsh+FIFO,
nsh+DTC+TIOCGICOUNT+TERMIOS, and serial-test, each from a fresh checkout.
- On hardware (EK-RA8M1, SCI0 as ttyS1 looped back, SCI9 console):
- FIFO (TTRG=15/RTRG=0): clean up to 3 Mbps for transfers within the
1024-byte RX ring buffer (serialblaster/serialrx, matched byte counts).
- RX DTC: confirmed working after the arming-bug fix
- Before the ra_clear_ir() fix: any receive error froze the whole board,
nsh included. After: nsh on SCI9 stays responsive through a sustained
3 Mbps overrun on SCI0.
- termios: stty -F /dev/ttyS1 speed <N> changes baud rate live.
## PR verification Self-Check
* [ ] This PR introduces only one functional change.
* [x] I have updated all required description fields above.
* [x] My PR adheres to Contributing Guidelines and Documentation.
* [ ] My PR is still work in progress (not ready for review).
* [ x] My PR is ready for review and can be safely merged into a codebase.
--
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]