Skip to content

Commit d250808

Browse files
tmediccixiaoxiang781216
authored andcommitted
esp32s3/elf: Fix ELF loader on ESP32-S3 when using external PSRAM
Prior to this commit, it wasn't possible to load ELF modules from the external PSRAM. There were two main issues about it: 1) copying data using the instruction bus was being used instead of the data bus (this, per si, isn't a problem, but requires special attention regarding data alignment), and 2) the cache was not being properly cleaned and flushed to properly access the loaded data using the instruction bus. Signed-off-by: Tiago Medicci Serrano <[email protected]>
1 parent 60ca804 commit d250808

File tree

8 files changed

+591
-7
lines changed

8 files changed

+591
-7
lines changed

arch/xtensa/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ config ARCH_CHIP_ESP32S3
8989
select ARCH_HAVE_TEXT_HEAP_SEPARATE_DATA_ADDRESS
9090
select ARCH_HAVE_TEXT_HEAP_WORD_ALIGNED_READ
9191
select ARCH_HAVE_TESTSET
92+
select ARCH_DCACHE
93+
select ARCH_ICACHE
9294
select ARCH_VECNOTIRQ
9395
select LIBC_PREVENT_STRING_KERNEL
9496
select LIBC_ARCH_MEMCPY if BUILD_FLAT

arch/xtensa/src/esp32s3/Make.defs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ HEAD_CSRC = esp32s3_start.c
2828

2929
# Required ESP32-S3 files (arch/xtensa/src/esp32s3)
3030

31-
CHIP_CSRCS = esp32s3_irq.c esp32s3_clockconfig.c esp32s3_region.c
31+
CHIP_CSRCS = esp32s3_cache.c esp32s3_irq.c esp32s3_clockconfig.c esp32s3_region.c
3232
CHIP_CSRCS += esp32s3_systemreset.c esp32s3_user.c esp32s3_allocateheap.c esp32s3_reset_reasons.c
3333
CHIP_CSRCS += esp32s3_wdt.c esp32s3_gpio.c esp32s3_lowputc.c esp32s3_serial.c
3434
CHIP_CSRCS += esp32s3_rtc_gpio.c esp32s3_libc_stubs.c esp32s3_spi_timing.c

0 commit comments

Comments
 (0)