arch/arm/rtl8721f: add RTL8721F chip and EVB board support - #19575
Open
dcgong2917 wants to merge 4 commits into
Open
arch/arm/rtl8721f: add RTL8721F chip and EVB board support#19575dcgong2917 wants to merge 4 commits into
dcgong2917 wants to merge 4 commits into
Conversation
Add a P0 skeleton port for the Realtek RTL8721F (SDK codename Green2 /
amebagreen2). Structurally the RTL8721F is a twin of the RTL8720F -- the
AP/host core is km4tz (ARMv8-M.main, TrustZone secure) and the WiFi MAC/PHY
runs on the km4ns network-processor core -- so this port is modelled on the
RTL8720F one and shares the IC-agnostic ameba glue in
arch/arm/src/common/ameba.
This is the "configures and links" skeleton (rtl8721f_evb:nsh builds an
image end to end). Four differences from the RTL8720F template were needed
to make the empty shell link against amebagreen2:
* km4tz has no FPU (cmsis_cpu.h defines __FPU_PRESENT 0), so the chip does
not select ARCH_HAVE_FPU and the image is built soft-float.
* ameba_app_start.c matches amebagreen2's ram_km4tz silicon init: the
nocache MPU map, the non-secure ROM BSS clear, OSC4M (not OSC2M)
calibration gated on EFUSE cut >= B and CHIP_TYPE_ASIC_POSTSIM.
* amebagreen2 ships no lib_rom.a, so the ROM archive whole-archive link is
dropped; the WiFi/OS/non-secure ROM symbols come from the SDK
ameba_rom_symbol_acut{,_wifi,_os}.ld maps appended to the image2 linker
script, exactly as green2's own image2 link does.
* the AP WiFi security lib is lib_wifi_common.a (was lib_wifi_com_sec.a).
The per-chip IRQ vector table (irq.h) and the RAM_START/RAM_SIZE layout
still carry RTL8720F values and are refined in the follow-up bring-up work.
Signed-off-by: dechao_gong <dechao_gong@realsil.com.cn>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Wire the RTL8721F km4tz core up to a working NuttShell: - irq.h: renumber the KM4TZ external vector table to the RTL8721F APIRQn map (UART_LOG=24, IPC=5, +GPIOB/C, TIMER7/8, ...). - ameba_loguart.c: fix the LOG-UART base to 0x40810000. The former 0x401C6000 belongs to a different Ameba part; the wrong base bus- faulted on the RX interrupt-enable write while TX still worked (LOGUART_PutChar uses its own ROM-internal base). - ameba_app_start.c: adjust the MPU read-only / RAM regions for the RTL8721F memory map and seed the RTC on first power-on so the SDM32K-clocked SYSTIMER comes up (mirrors the SDK app_rtc_init). - ameba_ipc.c: move the km4tz<->km4ns IPC to APIRQn 5 (IPC_CPU0). - ameba_board.mk: pull in fwlib ameba_rtc.c for the RTC_* symbols. - defconfig: RTL8721F RAM map, enable TIMER/TIMER_ARCH/ARMV8M_SYSTICK for a live system tick, and drop the WiFi/NET stack for now. - scripts/Make.defs: use the RTL8721F_NOR flash profile. Boots cleanly to nsh> on hardware; tick, RX and builtin apps verified. Signed-off-by: dechao_gong <dechao_gong@realsil.com.cn>
Bring up the last two RTL8721F feature blocks and wire them into the nsh board configuration: - littlefs on the on-chip flash MTD region (P2). - WHC/INIC WiFi with the on-chip IPC control plane, NuttX net stack, DHCP client and the wapi command tool (P3). Two porting fixes were required for the WiFi control plane: - ameba_ipc.c: the AP IPC device base (IPCAP_DEV) was carried over verbatim from the RTL8720F template (0x40804000). On this SoC IPC0 lives at 0x40815000; using the wrong base makes ipc_table_init() program the RX-full mask in the wrong register block, so the NP->AP interrupt never fires and WiFi bring-up hangs waiting for the device to answer. Point IPCAP_DEV at the correct 0x40815000 base. - ameba_board.mk: the EVB silicon is B-cut, so link against the ameba_rom_symbol_bcut*.ld ROM symbol tables (the A-cut tables resolve the WiFi ROM helpers to the wrong addresses and fault at run time). Validated on hardware: NSH comes up, wapi scan lists real APs, a WPA2 connect succeeds, the DHCP client obtains a lease and ICMP to the public internet round-trips. The board defconfig keeps SSID/passphrase as placeholders; real credentials are supplied at run time via the wapi commands. Signed-off-by: dechao_gong <dechao_gong@realsil.com.cn>
Add platform documentation for the Realtek RTL8721F: a chip overview page and the rtl8721f_evb board page, modelled on the existing RTL8720F / RTL8721Dx docs. The platform index picks them up automatically via its */index glob. The pages cover the vendor-SDK/toolchain dependency, the make and CMake build/flash flow, and the hardware-verified features: NSH over the LOG-UART console, littlefs at /data on the on-chip NOR flash, Wi-Fi station and SoftAP via the wapi tool, and the DHCP client/server. Signed-off-by: dechao_gong <dechao_gong@realsil.com.cn> Co-Authored-By: Claude <noreply@anthropic.com>
dcgong2917
requested review from
acassis,
davids5,
jerpelea,
johannes-nivus and
raiden00pl
as code owners
July 29, 2026 11:02
xiaoxiang781216
approved these changes
Jul 29, 2026
Contributor
|
@dcgong2917 please fix the CMake error: |
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
Add initial NuttX support for the Realtek RTL8721F, a dual-core
Cortex-M55 (KM4 TrustZone) + Cortex-M55 (KM4 NS) SoC targeting
Wi-Fi 6 / Bluetooth 5.3 IoT applications. The RTL8721F belongs to
the amebagreen2 SoC family alongside the already-merged RTL8720F;
chip-specific constants substituted.
from the RTL8721F TRM; differs from RTL8720F in peripheral numbering.
running OS-independent silicon init (cache, BSS clear, LOGUART,
data-flash high-speed setup, OSC calibration, SDM32K/RTC system
timer, pinmap, MPU) before calling NuttX main(). Owning this file
keeps the vendor SDK pristine.
ameba_timerisr.c, ameba_allocateheap.c, ameba_ipc.c — standard NuttX
ARM bring-up adapted to the RTL8721F memory map and boot flow.
linker flags for the RTL8721F image2 build.
half into NuttX netdev at bring-up.
board.h pin table, boot and bringup hooks, LittleFS on internal
4 MiB flash (/dev/mtd0 -> /mnt/lfs).
symbol prefixes (RTC_, EFUSE_, SDM32K_, Get_OSC131_, Set_OSC131_)
that cannot be renamed without breaking linkage against the vendor
blob; extends the existing Ameba SDK comment block.
peripheral list, toolchain, flash procedure) and EVB board page.
Impact
entirely new directories; no existing platform is modified.
inside the existing Ameba comment block; no behavioural change for
any other platform.
ARCH_BOARD_RTL8721F_EVB entries appended; no existing entries changed.
Testing
Built for
rtl8721f_evb:nshand verified on hardware (RTL8721F EVB):power cycles confirmed.
tools/checkpatch.shclean on all new/changed sources (0error:lines); full build produces
nuttx.binwith no new warnings.