mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 20:13:40 +00:00
aaf6a36c55
The ESP32-S3 ROM bootloader loads IRAM/DRAM into SRAM but does not configure the flash cache or MMU. Previously the target incorrectly reused the ESP32 boot assembly (esp32.S) which lacks flash XIP support. Add a dedicated esp32s3.S boot assembly that: - Sets up windowed-ABI registers, stack, and FPU - Disables all watchdog timers (RTC, TIMG0, TIMG1, Super WDT) - Configures VECBASE and clears PS.EXCM before any callx4 - Calls ROM functions to configure cache modes: rom_config_instruction_cache_mode (16KB, 8-way, 32B line) rom_config_data_cache_mode (32KB, 8-way, 32B line) - Initializes MMU, maps flash page 0 for IROM and DROM, clears bus-shut bits, and enables both caches - Jumps to runtime.main in IROM (flash) Update the linker script (esp32s3.ld) to place .text and .rodata in flash-mapped regions (IROM/DROM) with proper alignment for the MMU page size. Update esp32s3-interrupts.S with proper exception vector handlers. Point esp32s3.json at the new esp32s3.S instead of esp32.S. Signed-off-by: deadprogram <ron@hybridgroup.com>
24 lines
863 B
JSON
24 lines
863 B
JSON
{
|
|
"inherits": ["xtensa"],
|
|
"inheritable-only": true,
|
|
"cpu": "esp32s3",
|
|
"features": "+atomctl,+bool,+clamps,+coprocessor,+debug,+density,+div32,+esp32s3,+exception,+fp,+highpriinterrupts,+interrupt,+loop,+mac16,+memctl,+minmax,+miscsr,+mul32,+mul32high,+nsa,+prid,+regprotect,+rvector,+s32c1i,+sext,+threadptr,+timerint,+windowed",
|
|
"build-tags": ["esp32s3", "esp"],
|
|
"scheduler": "tasks",
|
|
"serial": "usb",
|
|
"linker": "ld.lld",
|
|
"default-stack-size": 8192,
|
|
"rtlib": "compiler-rt",
|
|
"libc": "picolibc",
|
|
"linkerscript": "targets/esp32s3.ld",
|
|
"extra-files": [
|
|
"src/device/esp/esp32s3.S",
|
|
"targets/esp32s3-interrupts.S",
|
|
"src/internal/task/task_stack_esp32.S"
|
|
],
|
|
"binary-format": "esp32s3",
|
|
"flash-method": "esp32jtag",
|
|
"emulator": "qemu-system-xtensa -machine esp32 -nographic -drive file={img},if=mtd,format=raw",
|
|
"gdb": ["xtensa-esp32-elf-gdb"]
|
|
}
|