Skip to content

Conversation

BenChung
Copy link

@BenChung BenChung commented Oct 7, 2025

This implements the skip-data-copy feature, which disables loading the .data section (containing statically allocated variables) in cases when that section is either:

  • Already loaded and possible, or
  • No longer valid when the startup code runs.

This occurs for example with boot2 using the BOOT_LOADER_RAM_MEMCPY option, which copies the .data section and then de-initializes XIP before relinquishing control leaving the contents of .data at the LMA undefined.

This fixes #609. Tested on a RP2040 in a pico. The test project is https://github.com/BenChung/RP2040_boot2_run_from_ram, which panics without this fix, or works correctly with this patch (shown on the branch https://github.com/BenChung/RP2040_boot2_run_from_ram/tree/fixed).

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.

Add feature to disable .data copy when using a copying bootloader
1 participant