Skip to content

boards/arm/stm32l4: shrink flash for nucleo-l432kc:wgen - #21370

Merged
jerpelea merged 1 commit into
apache:masterfrom
Swatantra-66:boards/stm32l4-shrink-wgen-flash
Nov 3, 2026
Merged

jerpelea merged 1 commit into
apache:masterfrom
Swatantra-66:boards/stm32l4-shrink-wgen-flash

Conversation

@Swatantra-66

Copy link
Copy Markdown
Contributor

Summary

The nucleo-l432kc:wgen configuration builds both DAC waveform generator drivers and testing/ostest, operating near the 256 KiB flash capacity. Expanding ostest with unit tests (e.g. pthread_sigqueue in apache/nuttx-apps#3931) causes this configuration to overflow flash by 408 bytes during CI (Linux (arm-stm32l-u-g)).

Following the pattern used in #21219 (commit cb6d987) for the STM32G4 boards, this patch frees flash headroom by:

  • Disabling unused C++ runtime support (CONFIG_HAVE_CXX, CONFIG_HAVE_CXXINITIALIZE)
  • Disabling unused NSH commands (basename, cmp, df, dirname, hexdump, losetup, mkdir, mkrd, mount, rmdir, time, umount, wget, xd)

This frees over 5 KiB of flash space, leaving comfortable headroom for future tests.

Impact

  • Is new feature added? No
  • Impact on user: None. C++ and the disabled NSH commands are not utilized by the waveform generator or ostest demo.
  • Impact on build: Resolves arm-none-eabi-ld: region 'flash' overflowed by 408 bytes on nucleo-l432kc:wgen and restores green CI for Linux (arm-stm32l-u-g).

Testing

  • Verified defconfig sorting and minimal diff against upstream master.

@Swatantra-66
Swatantra-66 requested a review from acassis as a code owner November 2, 2026 11:59
@github-actions github-actions Bot added Size: S The size of the change in this PR is small Board: arm labels Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

xiaoxiang781216
xiaoxiang781216 previously approved these changes Nov 2, 2026
@xiaoxiang781216

Copy link
Copy Markdown
Contributor

@Swatantra-66 please fix:

====================================================================================
Configuration/Tool: nucleo-l432kc/wgen,CONFIG_ARM_TOOLCHAIN_GNU_EABI
2026-11-02 12:56:44
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Building NuttX...
  [1/1] Normalize nucleo-l432kc/wgen
10d9
< # CONFIG_NSH_CMDOPT_HEXDUMP is not set
Saving the new configuration file
HEAD detached at pull/21370/merge
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   boards/arm/stm32l4/nucleo-l432kc/configs/wgen/defconfig

The nucleo-l432kc:wgen configuration builds both DAC waveform generator
drivers and testing/ostest, and operates near flash capacity (256 KiB).
Expanding ostest with new tests (e.g. pthread_sigqueue) causes this
configuration to overflow flash by 408 bytes during CI builds
(Linux arm-stm32l-u-g).

Free flash headroom using existing options:
- Disable unused C++ runtime support (CONFIG_HAVE_CXX,
  CONFIG_HAVE_CXXINITIALIZE).
- Disable unused NSH commands (basename, cmp, df, dirname, hexdump,
  losetup, mkdir, mkrd, mount, rmdir, time, umount, wget, xd).

This frees over 5 KiB of flash space, providing ample headroom for
future testing and libc expansion.

Signed-off-by: Swatantra Yadav <[email protected]>
Assisted-by: Google Gemini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Board: arm Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants