Loading two .elf files in Renode (bootloader and application)

70 views Asked by At

I'm trying to simulate a bootloader and an application in Renode. Both are built in separate .elf files, see https://docs.zephyrproject.org/latest/develop/west/sign.html . Can somebody help me writting the correct .resc script? I also swapped the loadELF commands, mentioned in https://github.com/renode/renode/issues/411

My current .resc file only loads the bootloader elf (adding "sysbus LoadELF $ORIGIN/signed_zephyr.elf" doesn´t work):

logFile $ORIGIN/nucleo_f429zi-hello_world-renode.log False
using sysbus
$name?="nucleo_f429zi"
mach create $name

machine LoadPlatformDescription $ORIGIN/nucleo_f429zi-hello_world.repl

showAnalyzer usart3
usart3 RecordToAsciinema $ORIGIN/nucleo_f429zi-hello_world-asciinema

macro reset
"""
    sysbus LoadELF $ORIGIN/mcuboot_zephyr.elf
    cpu0 VectorTableOffset `sysbus GetSymbolAddress "_vector_table"`
    cpu0 EnableProfilerCollapsedStack $ORIGIN/nucleo_f429zi-hello_world-profile true
    sysbus LoadELF $ORIGIN/signed_zephyr.elf
"""

runMacro $reset

Output: Renode Terminal + usart3

I found a similar macro in the demo files but I don´t know how to use it for my case:

macro reset  
"""
    # Set the WAIT_FOR_JTAG GPIO pin. The bootloader stalls if it's set to low.
    gpio OnGPIO 15 true

    # Load the bootloader. The address has to be specified as the binary files do not contain
    # any addressing information.
    sysbus LoadELF $boot 0xffffe000

    # The ELF files already contain information on where to load each part. They also provide symbols, which
    # can be used for execution tracing.
    sysbus LoadELF $bin

    # By default, the initial PC is set to the ELF entry point. Since the bootloader has to be started before the target application,
    # the PC needs to be set manually to the correct value.
    sysbus.cpu PC 0xfffffff0
"""

runMacro $reset
0

There are 0 answers