# Boot Renode Script (boot.resc)


# Add this script's path to the global path, so
# we can include files relative to ourselves.
path add $ORIGIN

i @peripherals/ESP32_SPIController.cs
i @peripherals/ESP32_UART.cs
i @peripherals/ESP32S3_EXTMEM.cs
i @peripherals/ESP32S3_GPIO.cs
i @peripherals/ESP32S3_RTC_CNTL.cs

using sysbus

mach create "SoC"
machine LoadPlatformDescription @badge.repl

# Silence regions we don't want to implement yet
sysbus SilenceRange <0x60038000, 0x60038FFF> # USB_DEVICE
sysbus SilenceRange <0x60080000, 0x60080FFF> # USB0
sysbus SilenceRange <0x60039000, 0x60039FFF> # USB_WRAP

machine StartGdbServer 3333 true

showAnalyzer uart0
showAnalyzer uart1

# The macro `reset` gets called implicitly when running `machine Reset`
macro reset
"""
sysbus LoadELF @blackmagic.elf
sysbus LoadBinary @partition-table.bin 0x3C008000
sysbus LoadBinary @esp32s3-irom.bin 0x40000000
sysbus LoadBinary @esp32s3-drom.bin 0x3FF00000
#sysbus LoadBinary @esp32s3-efuses.bin 0x60007000
sysbus LoadELF @bootloader.elf
cpu PC 0x40000400
"""

runMacro $reset

start
