Skip to content

pack: clamp flash-algo RAM to the device's RAM region#1976

Open
eakorolev wants to merge 1 commit into
pyocd:developfrom
eakorolev:clamp-flash-algo-ram
Open

pack: clamp flash-algo RAM to the device's RAM region#1976
eakorolev wants to merge 1 commit into
pyocd:developfrom
eakorolev:clamp-flash-algo-ram

Conversation

@eakorolev

@eakorolev eakorolev commented Jun 8, 2026

Copy link
Copy Markdown

_select_flash_ram() uses the pack's <algorithm RAMsize> as-is. When a DFP declares it larger
than the device's RAM, the loader (laid out top-down) lands past physical RAM and flashing faults
before erase.

Caught on SiliconLabs.GeckoPlatform_EFR32MG21_DFP / EFR32MG21A020F768 (RAM 0x10000, algo
RAMsize=0x18000): Memory transfer fault (write) @ 0x20017cb0.

Fix: clamp the algo RAM to the containing RAM region — same as the flash-range clamp in
_add_flash_subregions(). Added test_ram_select_explicit_clamped_to_region (fails without the fix).


Related: #1767 (same class of problem, unfixed); #1468 works around it per-target for MAX32660.

@eakorolev eakorolev marked this pull request as draft June 8, 2026 06:34
@eakorolev eakorolev changed the base branch from main to develop June 8, 2026 06:36
A DFP may declare an <algorithm> RAMsize larger than the device's actual RAM.
@eakorolev eakorolev force-pushed the clamp-flash-algo-ram branch from 812bd0b to 87e4c0e Compare June 8, 2026 06:42
@eakorolev eakorolev marked this pull request as ready for review June 8, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant