arch/arm/rp23xx: add text heap (up_textheap_memalign) support#19256
Open
ricardgb wants to merge 1 commit into
Open
arch/arm/rp23xx: add text heap (up_textheap_memalign) support#19256ricardgb wants to merge 1 commit into
ricardgb wants to merge 1 commit into
Conversation
Implement the text-heap allocator for the RP2350 so that relocatable code (loadable modules, code buffers) can be placed in executable RAM. The RP2350 Cortex-M33 executes from SRAM and NuttX runs it with the MPU disabled, so the text heap is backed directly by the kernel heap (kmm_memalign / kmm_free / kmm_heapmember); no separate executable region or up_textheap_data_address() alias is required. Selected via ARCH_HAVE_TEXT_HEAP on ARCH_CHIP_RP23XX and compiled when CONFIG_ARCH_USE_TEXT_HEAP is set (off by default). Developed with Claude Code (Anthropic's agentic coding tool) and exercised on a Raspberry Pi Pico 2 W by loading and running a Thumb code image from the text heap. Signed-off-by: Ricard Rosson <ricard@groundbits.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
||
| void *up_textheap_memalign(size_t align, size_t size) | ||
| { | ||
| return kmm_memalign(align, size); |
Contributor
There was a problem hiding this comment.
if text heap is same as kernel heap, why need select ARCH_HAVE_TEXT_HEAP?
linguini1
requested changes
Jul 4, 2026
linguini1
left a comment
Contributor
There was a problem hiding this comment.
Waiting for consensus about fully generated PRs.
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
Adds the text-heap allocator for the RP2350 (rp23xx), enabling relocatable/loadable code to be placed in executable RAM (
up_textheap_memalign/up_textheap_free/up_textheap_heapmember). The RP2350 Cortex-M33 executes from SRAM and NuttX runs it with the MPU disabled, so the text heap is backed directly by the kernel heap (kmm_*); no separate executable region orup_textheap_data_address()alias is required.Selected via
ARCH_HAVE_TEXT_HEAPonARCH_CHIP_RP23XX; compiled whenCONFIG_ARCH_USE_TEXT_HEAPis set (off by default).Impact
arch/arm/src/rp23xx/rp23xx_textheap.c.arch/arm/Kconfig: RP23XX selectsARCH_HAVE_TEXT_HEAP.Make.defs/CMakeLists.txt: compile the file underCONFIG_ARCH_USE_TEXT_HEAP. No change when the option is off.Testing
raspberrypi-pico-2:nsh+CONFIG_ARCH_USE_TEXT_HEAP=ycompiles cleanly;nxstyleclean.🤖 Generated with Claude Code