arch/arm/rtl8721f: add UART character driver support - #19588
Open
dcgong2917 wants to merge 1 commit into
Open
Conversation
Expose the RTL8721F general-purpose UARTs through the shared Ameba serial driver in arch/arm/src/common/ameba. Only the chip-specific glue is added: a new ameba_uart_chip.h supplying the green2 register bases, IRQs, clock masks and UART TX/RX pin-mux function codes, plus the build wiring and a board port table registering UART0 at /dev/ttyS1. The common serial layer is reused unchanged. A new "uart" board config enables the driver with the serialrx and serialblaster examples and runtime TERMIOS support. Verified on RTL8721F EVB hardware with a PA24/PA25 loopback: single-message echo, 2600-byte serialrx/serialblaster throughput with no loss, and TERMIOS reconfiguration (CS7 data-bit truncation, parity and stop-bit ioctl round-trip, and 9600 baud reprogramming) all pass. Signed-off-by: dechao_gong <dechao_gong@realsil.com.cn> Assisted-by: Claude <noreply@anthropic.com>
xiaoxiang781216
approved these changes
Jul 31, 2026
acassis
requested changes
Jul 31, 2026
| ``arch/arm/src/common/ameba/ameba_gpio.h`` (port A/B, pin 0-31), matching the | ||
| Ameba SDK ``PinName`` layout. | ||
|
|
||
| uart |
Contributor
There was a problem hiding this comment.
@dcgong2917 please add the board picture that was missing in the previous PR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expose the RTL8721F general-purpose UARTs through the shared Ameba serial
driver in
arch/arm/src/common/ameba. Only chip-specific glue is added:arch/arm/src/rtl8721f/ameba_uart_chip.h— rtl8721F register bases, IRQs,clock masks and UART TX/RX pin-mux function codes consumed by the common
driver.
Make.defs,ameba_board.mkandCMakeLists.txt(bothmake and cmake paths), guarded by
CONFIG_AMEBA_UART, adding the commonameba_uart.cand the fwlib RAM register-layer source.rtl8721f_uart.c) registering UART0 at/dev/ttyS1on PA24/PA25. The LOG-UART keeps the console and
/dev/ttyS0.uartboard config enabling the driver with theserialrx/serialblasterexamples and runtime TERMIOS support, plus docs.The common serial layer is reused unchanged. This mirrors the GPIO port
(#19582) pattern for this IC.
Impact
CONFIG_AMEBA_UART(default n).common/amebasources or to other boards/ICs.Testing
Built and flashed on the RTL8721F EVB (make and cmake both build a clean
nuttx.bin; checkpatch and nxstyle pass; defconfig is canonical).Hardware-verified via a PA24/PA25 loopback:
serialrx/serialblastersingle-message echo (hello_uart) — pass.and stop-bit ioctl round-trip, and 9600-baud reprogramming — all pass.