Skip to content

apm32: link newlib-nano in make builds - #4378

Merged
HiFiPhile merged 1 commit into
masterfrom
apm32-nano-specs
Nov 1, 2026
Merged

HiFiPhile merged 1 commit into
masterfrom
apm32-nano-specs

Conversation

@HiFiPhile

@HiFiPhile HiFiPhile commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The apm32 family.mk files linked full newlib, while family.cmake passes --specs=nano.specs. On apm32f103_dev_board (20 KB RAM), full newlib adds about 2.8 KB of RAM (mallocr, locale, impure, findfp). The make build of net_lwip_webserver then overflowed RAM by 744 bytes, while the CMake build fit.

This adds --specs=nano.specs to the make LDFLAGS of apm32f10x and apm32f0xx, as family.cmake and the stm32 families already do.

Found through the random make job build---one-random-make-apm32f10x-large-arm-gcc on #4373. It fails on master too.

Fixes #4330

Verification

  • net_lwip_webserver on apm32f103_dev_board, make: master overflows RAM by 744 B. With this change it links at 19520 B of 20480 B, the same as the CMake build, and the map shows newlib-nano.
  • tools/build.py -s make, all examples:
    • apm32f103_dev_board: 31 OK;
    • apm32f107_dev_board: 42 OK;
    • apm32f072_dev_board: 32 OK.
  • Not tested on hardware.

family.mk linked full newlib while family.cmake passes
--specs=nano.specs. On apm32f103_dev_board (20 KB RAM) that costs ~2.8 KB
of RAM (mallocr, locale, impure, findfp), so the make build of
net_lwip_webserver overflowed RAM by 744 bytes while the CMake build fit.
Pass --specs=nano.specs in both apm32 families, as family.cmake and the
stm32 families do.
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fa2fc2a7-0817-4487-88e1-d154ea68d502
Commits

Reviewing files that changed from the base of the PR and between 67570a6 and 690adf3.

Files selected for processing: 2
  • hw/bsp/apm32f0xx/family.mk
  • hw/bsp/apm32f10x/family.mk

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

The APM32F0xx and APM32F10x linker flags now include --specs=nano.specs. Their existing nosys.specs, -nostdlib, and -nostartfiles options remain.

Possibly related issues

  • hathach/tinyusb#4330: This issue reports a RAM overflow in the APM32F103 webserver build. The PR adds the nano.specs linker option identified as reducing RAM use, but the issue’s remaining confirmation step is open.

Possibly related PRs

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 690ad

The change aligns APM32 Make builds with the existing newlib-nano configuration to reduce RAM usage. No merge-blocking issue is identified; merge after normal build checks.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title "apm32: link newlib-nano in make builds" matches the main change. The PR adds --specs=nano.specs to the Make LDFLAGS for apm32f10x and apm32f0xx, so the build links newlib-nano instead of fu…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description directly explains the linker flag changes, the RAM overflow issue, the intended newlib-nano alignment, and the reported verification results.
Full details: Title check

Explanation

The title "apm32: link newlib-nano in make builds" matches the main change. The PR adds --specs=nano.specs to the Make LDFLAGS for apm32f10x and apm32f0xx, so the build links newlib-nano instead of full newlib. The title is specific and concise, and it names the platform and the build system.

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@greptile-apps

greptile-apps Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] This PR appears safe to merge; no actionable issues were found.

Summary

Adds --specs=nano.specs to the Make link flags for apm32f0xx and apm32f10x.

  • APM32 Make builds now use the smaller newlib-nano library.

Reviews (1) · Last reviewed commit: "apm32: link newlib-nano in make builds" · Reviewed by Greptile

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Code size

Nothing to measure: no code change, or no snapshot build leg selected.
Full report

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Hardware-in-the-loop (HIL) Test Report

No HIL run for this push (no affected boards, or hardware testing did not run).

@HiFiPhile
HiFiPhile merged commit 7bc8fb8 into master Nov 1, 2026
257 checks passed
@HiFiPhile
HiFiPhile deleted the apm32-nano-specs branch November 1, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

net_lwip_webserver: RAM overflows by 744 bytes on apm32f103_dev_board

1 participant