Skip to content

arch/arm/ameba: cache SDK sub-config, add ameba_menuconfig, silence vendor -Wint-conversion#19366

Open
raulcxw wants to merge 1 commit into
apache:masterfrom
Ameba-AIoT:pr-build
Open

arch/arm/ameba: cache SDK sub-config, add ameba_menuconfig, silence vendor -Wint-conversion#19366
raulcxw wants to merge 1 commit into
apache:masterfrom
Ameba-AIoT:pr-build

Conversation

@raulcxw

@raulcxw raulcxw commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

The NP and bootloader images are built from the vendored ameba-rtos SDK on
every NuttX build. Three problems are addressed:

  • The SDK menuconfig was regenerated on every build, which rewrote the SDK
    .config, made CMake reconfigure, and recompiled most of the NP image even
    when 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.
  • The SDK config is now driven by 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, applied last and re-applied after
    an edit), so options that must stay fixed for the port cannot be overridden.
  • make ameba_menuconfig is added to edit the SDK options through the SDK's
    own native menuconfig UI and save the diff back to the board overlay
    (the SDK-side counterpart of make menuconfig).
  • libameba_fwlib.a compile and the SDK NP/boot build): the SDK passes NULL
    to irq_register()'s u32 "Data" argument in many places, an intentional
    NULL-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

  • Users: adds make ameba_menuconfig; existing build/flash usage unchanged.
  • Build: much faster incremental rebuilds for these boards (no-change rebuild
    recompiles ~3 files instead of most of the NP image); affects only the
    arch/arm/src/{common/ameba,rtl8721dx,rtl8720f} build glue and the two
    boards. No other arch/board.
  • Hardware / runtime: no change to the firmware itself.
  • Compatibility: no SDK source is modified (the warning suppression is a
    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-eabi asdk (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-conversion warnings in the build log (previously emitted from
ameba_pmctimer.c / ameba_pmu.c). Both boards built, flashed and booted
(NSH + Wi-Fi STA).

@github-actions github-actions Bot added Area: Tooling Arch: arm Issues related to ARM (32-bit) architecture Size: M The size of the change in this PR is medium Board: arm labels Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Area: Tooling Board: arm Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants