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 <tiago.medicci@espressif.com>
This commit is contained in:
Tiago Medicci Serrano
2025-08-14 14:33:03 -03:00
committed by Xiang Xiao
parent 60ca804b56
commit d250808c1c
8 changed files with 591 additions and 7 deletions
+1
View File
@@ -32,6 +32,7 @@
#include <assert.h>
#include <debug.h>
#include <nuttx/arch.h>
#include <nuttx/cache.h>
#include <nuttx/elf.h>
#include <nuttx/lib/elf.h>
+1 -1
View File
@@ -194,7 +194,7 @@ int up_relocateadd(const Elf32_Rela *rel, const Elf32_Sym *sym,
break;
case R_XTENSA_32:
(*(uint32_t *)addr) += value;
(*(uint32_t *)(up_textheap_data_address((void *)addr))) += value;
break;
case R_XTENSA_ASM_EXPAND: