raulcxw opened a new pull request, #19236:
URL: https://github.com/apache/nuttx/pull/19236
## Summary
Add NuttX support for two Realtek Ameba dual-core **WHC (WiFi Host
Controller)** SoCs and their evaluation boards:
| SoC | Board | AP core (NuttX) | NP core (WiFi) |
|------------|--------------|-----------------|----------------|
| RTL8721Dx | `pke8721daf` | km4 (Cortex-M33)| km0 |
| RTL8720F | `rtl8720f_evb`| km4tz (Cortex-M33)| km4ns |
On these parts NuttX runs on the **application (AP) core**; the WiFi
MAC/PHY firmware runs on the **network (NP) core**, and the two cores talk
over the vendor IPC. The host WiFi stack is driven through a WHC glue layer.
What this PR adds:
- `arch/arm/src/rtl8721dx/` and `arch/arm/src/rtl8720f/` chip support, plus a
shared `arch/arm/src/common/ameba/` layer (IPC, WHC WiFi host glue, flash
MTD, LOGUART console, SDK fetch/build tooling).
- `boards/arm/rtl8721dx/pke8721daf/` and `boards/arm/rtl8720f/rtl8720f_evb/`
with an `nsh` defconfig each.
- Platform/board documentation under `Documentation/platforms/arm/`.
Working features (both boards): NSH over LOGUART, WiFi **STA scan +
connect**,
WiFi **SoftAP**, **littlefs** on the on-chip flash (MTD), and AP↔NP IPC.
### How the dual-core / vendor-SDK integration works
- **Out-of-tree, pinned SDK — no vendored blobs.** The build auto-fetches a
pinned commit of the public `ameba-rtos` SDK (shallow clone) into
`arch/arm/src/common/ameba/`, provisions its toolchain/venv, and compiles
the
needed register-layer (fwlib) and WHC glue sources *from SDK source* into
per-board archives. The SDK tree is kept **pristine (zero patches)** — it
natively supports the single-core / boot build entry points we use.
- **NuttX owns the image2 entry.** `arch/arm/src/<chip>/ameba_app_start.c`
is a
NuttX-licensed adaptation of the SDK `app_start()` that performs the
OS-independent silicon init and then calls NuttX `main()`. No SDK source
file
is modified.
- **NP/boot built from the same pinned SDK every build**, fed NuttX's own
disassembly so the SDK's "noused" WiFi-API generator keeps exactly the host
APIs NuttX references (avoids an NP deadlock). This guarantees the two
cores
never drift.
- All vendor build artifacts live in a **git-ignored** `prebuilt/` staging
dir;
the SDK kconfig snapshots the packaging step needs are regenerated from the
pinned SDK on every build (never committed).
## Impact
- **New architecture/boards only** — adds new files under `arch/arm/src/...`
and `boards/arm/...`; the only edits to existing files are the additive
registration entries in `arch/arm/Kconfig` and `boards/Kconfig`. No
existing
board or architecture is affected.
- **Build system:** `make` only. The board `CMakeLists.txt` intentionally
emits
a clear "CMake build not yet supported" `FATAL_ERROR` for these boards.
- **Network:** standard NuttX netdev / wireless ioctls; no core net changes.
- **Documentation:** new pages only.
- **Security:** none (no changes to common code paths).
## Testing
Built and run on real hardware for both boards.
Build (host: Ubuntu, `arm-none-eabi` from the SDK-provisioned toolchain):
```
./tools/configure.sh pke8721daf:nsh && make # -> app.bin, boot.bin,
km0_image2_all.bin
./tools/configure.sh rtl8720f_evb:nsh && make # -> app.bin, boot.bin,
km4ns_image2_all.bin
```
The same configs are built in CI on a clean container using the official
`apache-nuttx-ci-linux` image (fresh SDK fetch from the pinned commit), and
the
resulting firmware was flashed and verified on hardware:
- NSH prompt over LOGUART, basic shell commands.
- `wapi`/`iwconfig` WiFi **scan** and **connect** to a WPA2 AP; DHCP lease
and
ping over the air.
- **SoftAP** brought up; a client associates and obtains a DHCP address.
- **littlefs** mounted on the flash data partition (read/write/persist across
reboot).
### Notes for reviewers
- The vendor SDK is **auto-fetched (pinned)**, not vendored — there are no
binary blobs in the tree, and `prebuilt/` is git-ignored.
- nxstyle emits "Mixed case identifier" on vendor SDK symbol names
(e.g. `Img2EntryFun0`, `SYSTIMER_Init`) referenced from the adaptation
files.
These are the SDK's public API spellings and cannot be renamed.
- RTL8720F links the SDK `lib_rom.a` with `--whole-archive` (its ROM symbols
must all be present); this is required by the silicon's ROM layout.
- A fork-only GitHub Actions workflow used to produce/verify the CI firmware
is
**not** part of this PR.
--
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]