-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Feature Request: RP2350 partition support with XIP_NOCACHE_NOALLOC_NOTRANSLATE_BASE for cross-partition access
Problem Description
The current flash block device implementation uses XIP_BASE
(0x10000000) for reads, which works perfectly for RP2040 and single-partition RP2350 setups. However, on RP2350 with partitioned flash, the bootrom restricts XIP_BASE
to only map the currently booted partition. This prevents applications from accessing data stored in other partitions.
Technical Background
On RP2350, when using A/B firmware partitions with a separate data partition:
- Partition 0: Firmware A (0x002000-0x102000)
- Partition 1: Firmware B (0x102000-0x202000)
- Partition 2: Data (0x202000-0x602000)
The bootrom configures XIP_BASE
to only map the active firmware partition. Attempting to read from the Data partition via XIP_BASE + data_partition_offset
results in bus faults and system hangs.
Proposed Solution
Add support for XIP_NOCACHE_NOALLOC_NOTRANSLATE_BASE
(0x1c000000) as an alternative read method for accessing the entire flash, regardless of partition restrictions.
Implementation Approach
- Detection Logic: Add runtime detection for RP2350 and partitioned flash
- Address Selection: Use
XIP_NOCACHE_NOALLOC_NOTRANSLATE_BASE
when accessing flash outside the booted partition - Backward Compatibility: Maintain existing behavior for RP2040 and non-partitioned RP2350
Use Cases
- Cross-partition file systems (e.g., LittleFS on dedicated data partition)
- Configuration storage in separate partition from firmware
- A/B firmware updates with persistent data storage
- Multi-partition applications requiring access to shared data
Alternative Workaround
We successfully implemented a custom block device that uses XIP_NOCACHE_NOALLOC_NOTRANSLATE_BASE
for reads while maintaining compatibility with the existing pico-vfs API. This could serve as reference implementation for the upstream fix.
References
- RP2350 Datasheet Section 2.11.5.2 - XIP address translation
- Forum discussion - Engineer confirmation of
XIP_NOCACHE_NOALLOC_NOTRANSLATE_BASE
usage