arch/arm/ameba: cache SDK sub-config, add ameba_menuconfig, silence vendor -Wint-conversion#19366
Open
raulcxw wants to merge 1 commit into
Open
arch/arm/ameba: cache SDK sub-config, add ameba_menuconfig, silence vendor -Wint-conversion#19366raulcxw wants to merge 1 commit into
raulcxw wants to merge 1 commit into
Conversation
…r warning The NP and bootloader images are built from the vendored ameba-rtos SDK. Rework how that sub-build is configured and driven: - Materialize the SDK menuconfig once, guarded by a stamp (SDK revision + board overlay). A no-change rebuild no longer rewrites the SDK .config, so the SDK stops reconfiguring and recompiling most of the NP image every time; only the AP-driven "noused" file is regenerated. (ameba_sdk_config.sh) - Configure the SDK from a two-tier prj.conf-style overlay per board: ameba_sdk.conf (user-editable) layered under ameba_sdk_force.conf (forced options such as CONFIG_SHELL=n, always applied last and re-applied after an edit), so options that must stay fixed cannot be overridden. - Add "make ameba_menuconfig": edit the SDK options in the SDK's own native menuconfig UI and save the diff back to the board overlay. - Silence -Wint-conversion for the vendored SDK sources (both the NuttX fwlib compile and the SDK NP/boot build): the SDK passes NULL to irq_register()'s u32 "Data" argument in many places; the warning is suppressed for vendor code instead of editing every call site. Signed-off-by: raul_chen <raul_chen@realsil.com.cn>
xiaoxiang781216
approved these changes
Jul 11, 2026
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
The NP and bootloader images are built from the vendored ameba-rtos SDK on
every NuttX build. Three problems are addressed:
.config, made CMake reconfigure, and recompiled most of the NP image evenwhen nothing changed. It is now materialized once, guarded by a stamp
(pinned SDK revision + the board config overlay); an unchanged rebuild
reuses it, so only the AP-driven "noused" file is regenerated.
ameba_sdk.conf(user-editable) layered underameba_sdk_force.conf(forced options such as
CONFIG_SHELL=n, applied last and re-applied afteran edit), so options that must stay fixed for the port cannot be overridden.
make ameba_menuconfigis added to edit the SDK options through the SDK'sown native menuconfig UI and save the diff back to the board overlay
(the SDK-side counterpart of
make menuconfig).libameba_fwlib.acompile and the SDK NP/boot build): the SDK passesNULLto
irq_register()'su32"Data" argument in many places, an intentionalNULL-as-context idiom; the pedantic warning is suppressed for vendor code
rather than editing every call site (which would also re-break on every new
SDK file).
Impact
make ameba_menuconfig; existing build/flash usage unchanged.recompiles ~3 files instead of most of the NP image); affects only the
arch/arm/src/{common/ameba,rtl8721dx,rtl8720f}build glue and the twoboards. No other arch/board.
compile flag; the config is driven via the SDK's existing
--apply-file).Testing
Build host: Ubuntu 22.04 (x86_64, WSL2), GCC 11 for host tools; target
toolchain: Realtek
arm-none-eabiasdk (auto-fetched).Targets:
pke8721daf:nsh(RTL8721Dx),rtl8720f_evb:nsh(RTL8720F).Incremental rebuild cost, no source change (after change):
even after enabling CONFIG_SHELL in make ameba_menuconfig and saving,
the built SDK config shows it forced back off:
$ grep CONFIG_SHELL .../build_RTL8721Dx/menuconfig/.config
CONFIG_SHELL is not set
No
-Wint-conversionwarnings in the build log (previously emitted fromameba_pmctimer.c/ameba_pmu.c). Both boards built, flashed and booted(NSH + Wi-Fi STA).