Skip to content

Commit 415a8f8

Browse files
committed
use uncached ranges for esp32p4
This moves the flash algorithm into uncached ranges as required for version 3.0 of the chip.
1 parent 31ad757 commit 415a8f8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ max-cpu-frequency = []
2929

3030
[profile.release]
3131
codegen-units = 1
32-
debug = false
32+
debug = true
3333
debug-assertions = false
3434
incremental = false
3535
lto = "fat"

ld/esp32p4.x

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
MEMORY {
3-
/* Start 64k into the RAM region */
4-
IRAM : ORIGIN = 0x4FF10000, LENGTH = 0x10000
3+
/* Start 64k into the uncached RAM region */
4+
IRAM : ORIGIN = 0x8FF30000, LENGTH = 0x10000
55
}
66

77
PROVIDE ( esp_rom_spiflash_attach = spi_flash_attach );

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const _: [u8; 43776] = [0; core::mem::size_of::<Decompressor>()];
3333
// ESP32-C6 | 0x4081_0000 | 0x4081_0000 | 0x4084_0000 | 0x4085_0000 | 0x4086_0000
3434
// 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
3535
// ESP32-H2 | 0x4081_0000 | 0x4081_0000 | 0x4082_0000 | 0x4083_0000 | 0x4083_8000 !! has smaller RAM, only reserve 32K for data
36-
// ESP32-P4 | 0x4FF1_0000 | 0x4FF1_0000 | 0x4FF6_0000 | 0x4FF7_0000 | 0x4FFC_0000
36+
// ESP32-P4 | 0x8FF3_0000 | 0x8FF3_0000 | 0x8FF6_0000 | 0x8FF7_0000 | 0x8FFC_0000 !! Uncached region
3737

3838
// "State" base address
3939
#[cfg(feature = "esp32")]
@@ -55,7 +55,7 @@ const STATE_ADDR: usize = 0x4082_0000;
5555
#[cfg(feature = "esp32h2")]
5656
const STATE_ADDR: usize = 0x4082_0000;
5757
#[cfg(feature = "esp32p4")]
58-
const STATE_ADDR: usize = 0x4FF6_0000;
58+
const STATE_ADDR: usize = 0x8FF6_0000;
5959

6060
// End of target memory configuration
6161

0 commit comments

Comments
 (0)