|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Minimal copy-to-run payload – one image that runs from the SRAM run base. More...
#include <stdint.h>Go to the source code of this file.
Enumerations | |
| enum | payload_probe_t : uintptr_t { k_payload_probe_sentinel = 0x22010000U , k_payload_probe_counter = 0x22010004U } |
| Fixed SRAM probe words the bootloader leaves untouched. More... | |
| enum | payload_sentinel_t : uint32_t { k_payload_sentinel_value = 0x9710C0DEU } |
| Sentinel value ("#97 1 code"): this payload ran via copy-to-run. More... | |
Functions | |
| void | payload_reset (void) |
| Payload reset entry: set the sentinel, then advance a heartbeat forever. | |
Variables | |
| uint32_t | g_ra8_ls_stack_top |
| Initial-MSP symbol, defined by payload.ld at the top of the run region. | |
| static const uintptr_t | s_vectors [2] |
| 2-entry vector table: initial MSP + reset, at the image base. | |
Minimal copy-to-run payload – one image that runs from the SRAM run base.
A tiny, self-contained application linked ONCE at the dfu_bootloader's SRAM run base (k_ra8_dfu_run_base = 0x22020000, see payload.ld). A copy-to-run launcher (ra8_dfu_launch) copies this image to that base and branches here, so the IDENTICAL .bin is bootable from Slot A or Slot B – the proof that copy-to-run removes the per-slot build (issue #97). It backs both the dfu_copy_to_run HIL demo (which embeds and launches it) and the bench staging of ../dfu_bootloader (which stages it into a real slot).
On entry it writes a distinctive sentinel and then advances a heartbeat counter forever, both at a fixed probe word that sits between the bootloader's low .bss and the run base (so neither the bootloader nor this image's copy touches it). A J-Link probe of those two words – plus a PC inside the SRAM run window – confirms the image ran via copy-to-run. Interrupts stay masked (the launcher masked them before the hand-off and this payload never re-enables them), so the 2-entry vector table is sufficient.
Build with examples/ek_ra8d2/hw_validated/hil/dfu_copy_to_run/scripts/ build_payload.sh (also emits payload_image.h for the demo).
Definition in file payload.c.
| enum payload_probe_t : uintptr_t |
Fixed SRAM probe words the bootloader leaves untouched.
0x22010000 lies above the bootloader's low-SRAM footprint and below the run base, so it is owned by neither the bootloader nor this image.
| Enumerator | |
|---|---|
| k_payload_probe_sentinel | Sentinel word (proof-of-run). |
| k_payload_probe_counter | Heartbeat counter (liveness). |
| enum payload_sentinel_t : uint32_t |
| void payload_reset | ( | void | ) |
Payload reset entry: set the sentinel, then advance a heartbeat forever.
Definition at line 70 of file payload.c.
References k_payload_probe_counter, k_payload_probe_sentinel, and k_payload_sentinel_value.
|
extern |
Initial-MSP symbol, defined by payload.ld at the top of the run region.
|
static |
2-entry vector table: initial MSP + reset, at the image base.
The launcher reads [0] as the initial MSP and branches to [1]; the reset entry keeps its Thumb bit because it is a function address.