Skip to content

Conversation

@xobs
Copy link
Contributor

@xobs xobs commented Nov 21, 2025

This moves the flash algorithm into uncached ranges as required for version 3.0 of the chip.

ld/esp32p4.x Outdated
Comment on lines 3 to 4
/* Start 64k into the uncached RAM region */
IRAM : ORIGIN = 0x8FF30000, LENGTH = 0x10000
Copy link
Contributor

@bugadani bugadani Nov 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you push this over to 0x8FF50000 instead? ROM code in older devices use RAM up until 0x4ff40000, and probe-rs places breakpoints before the algo. Besides, the 64k in the comment is wrong, although that's not a big deal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it to 0x8ff40020, which works.

src/main.rs Outdated
// ESP32-C61 | 0x4081_0000 | 0x4081_0000 | 0x4082_0000 | 0x4083_0000 | 0x4083_8000 !! ROM data use starts at 0x4083EA70, so let's use H2's memory layout
// ESP32-H2 | 0x4081_0000 | 0x4081_0000 | 0x4082_0000 | 0x4083_0000 | 0x4083_8000 !! has smaller RAM, only reserve 32K for data
// ESP32-P4 | 0x4FF1_0000 | 0x4FF1_0000 | 0x4FF6_0000 | 0x4FF7_0000 | 0x4FFC_0000
// ESP32-P4 | 0x8FF3_0000 | 0x8FF3_0000 | 0x8FF6_0000 | 0x8FF7_0000 | 0x8FFC_0000 !! Uncached region
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// ESP32-P4 | 0x8FF3_0000 | 0x8FF3_0000 | 0x8FF6_0000 | 0x8FF7_0000 | 0x8FFC_0000 !! Uncached region
// ESP32-P4 | 0x8FF3_0000 | 0x8FF3_0000 | 0x8FF6_0000 | 0x8FF7_0000 | 0x8FF8_0000 !! Uncached region

This doesn't really change anything, but because ROM functions in newer chips use the end of RAM, let's shrink our documented range a bit :)

@xobs xobs force-pushed the esp32p4-move-flash-region branch from db8603f to 25c938a Compare November 22, 2025 15:29
xobs added 2 commits November 22, 2025 23:36
This moves the flash algorithm into uncached ranges as required for version
3.0 of the chip.
@xobs xobs force-pushed the esp32p4-move-flash-region branch from 25c938a to 42a8733 Compare November 22, 2025 15:37
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.

2 participants