|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Warm-reboot orchestration over an open streaming ELF source. More...
#include "board_console.h"#include "board_net.h"#include "board_periph.h"#include "emu_console.h"#include "emu_elf.h"#include "emu_exc.h"#include "emu_host_io_internal.h"#include "emu_memmap.h"#include "emu_mpu.h"#include "emu_seams.h"#include "emu_view.h"Go to the source code of this file.
Functions | |
| uint32_t | warm_reboot (uc_engine *uc, const emu_elf_source_t *elf, bool trace) |
| Warm-reboot the firmware: re-run from the reset vector in place. | |
Warm-reboot orchestration over an open streaming ELF source.
Restores PT_LOAD bytes through the bounded loader, resets models, and restarts from the vector table without changing source ownership.
Definition in file emu_elf_reboot.c.
| uint32_t warm_reboot | ( | uc_engine * | uc, |
| const emu_elf_source_t * | elf, | ||
| bool | trace ) |
Warm-reboot the firmware: re-run from the reset vector in place.
Mirrors a Cortex-M reset without tearing down the Unicorn engine. Restores the code image and the .data initial values by re-writing the ELF's PT_LOAD segments (the firmware's own Reset_Handler then re-zeroes .bss and re-copies .data), re-reads SP/PC from the vector table, resets the peripheral models (the reset-cause RSTSRn and the VBATT backup domain deliberately survive their reset hooks, so the reboot cause and battery-backed state persist), and clears the host-side exception / scheduler bookkeeping so the next boot starts clean. The installed Unicorn hooks persist across this, so they are NOT re-added, and one-shot CLI input (–keys / –input / –usb-in) is NOT re-injected.
| [in,out] | uc | Unicorn engine to reboot (kept alive). |
| [in] | elf | Open firmware source whose segments are re-loaded. |
| [in] | trace | Whether –trace is active (forwarded to the models). |
| 0 | The image re-load failed; the caller must end the run. |
elf loaded successfully at startup and remains open. Definition at line 24 of file emu_elf_reboot.c.
References board_console_reset(), board_net_init(), board_periph_init(), emu_console_reset(), emu_div0_clear_fault(), emu_div0_disarm(), emu_exc_reset(), emu_mem_read(), emu_memmap_mram_base(), emu_mpu_clear_fault(), emu_view_reset_console(), k_xpsr_t_bit, load_elf(), and priv_emu_io_errf().
Referenced by internal_run_loop_prologue(), and internal_run_loop_run_chunk().