ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_dfu_img_hdr_t Struct Reference

32-byte application-image header at the base of each slot. More...

#include <ra8_dfu.h>

Data Fields

uint32_t magic
 Must equal k_ra8_dfu_hdr_magic.
uint32_t seq
 Monotonic sequence; higher valid slot wins.
uint32_t img_len
 Image body length in bytes (32-byte multiple).
uint32_t img_crc32
 CRC32 (IEEE) over the image body.
uint32_t entry
 SRAM run base (== k_ra8_dfu_run_base).
uint32_t rsv0
 Reserved; programmed 0.
uint32_t rsv1
 Reserved; programmed 0.
uint32_t rsv2
 Reserved; programmed 0.

Detailed Description

32-byte application-image header at the base of each slot.

Stored in the slot's LAST 32-byte page (slot_base + k_ra8_dfu_hdr_offset) and programmed last (after the image body) so a torn write leaves an invalid (CRC-mismatching) slot rather than a half-valid one. The image body starts at slot_base; img_crc32 covers exactly [slot_base, slot_base + img_len).

Invariant
img_len is a non-zero multiple of k_ra8_dfu_page_size and <= k_ra8_dfu_img_max for a valid image.
entry == k_ra8_dfu_run_base for a valid image (copy-to-run).
Example:
ra8_dfu_img_hdr_t h = { .magic = k_ra8_dfu_hdr_magic, .seq = 7,
.img_len = 0x4000, .img_crc32 = crc,
.entry = k_ra8_dfu_run_base };
@ k_ra8_dfu_hdr_magic
Valid-image header magic ("RA8D").
Definition ra8_dfu.h:105
@ k_ra8_dfu_run_base
SRAM copy-to-run / payload link base.
Definition ra8_dfu.h:126
32-byte application-image header at the base of each slot.
Definition ra8_dfu.h:174
See also
ra8_dfu_hdr_valid
ra8_dfu_run_target_valid

Definition at line 174 of file ra8_dfu.h.

Field Documentation

◆ entry

uint32_t ra8_dfu_img_hdr_t::entry

SRAM run base (== k_ra8_dfu_run_base).

Definition at line 179 of file ra8_dfu.h.

Referenced by blc_boot_slot(), and ra8_dfu_program_commit().

◆ img_crc32

uint32_t ra8_dfu_img_hdr_t::img_crc32

CRC32 (IEEE) over the image body.

Definition at line 178 of file ra8_dfu.h.

Referenced by ra8_dfu_hdr_valid(), and ra8_dfu_program_commit().

◆ img_len

uint32_t ra8_dfu_img_hdr_t::img_len

Image body length in bytes (32-byte multiple).

Definition at line 177 of file ra8_dfu.h.

Referenced by blc_boot_slot(), ra8_dfu_hdr_valid(), ra8_dfu_program_commit(), and ra8_dfu_slot_valid().

◆ magic

uint32_t ra8_dfu_img_hdr_t::magic

Must equal k_ra8_dfu_hdr_magic.

Definition at line 175 of file ra8_dfu.h.

Referenced by ra8_dfu_hdr_valid(), ra8_dfu_program_commit(), and ra8_dfu_slot_seq().

◆ rsv0

uint32_t ra8_dfu_img_hdr_t::rsv0

Reserved; programmed 0.

Definition at line 180 of file ra8_dfu.h.

◆ rsv1

uint32_t ra8_dfu_img_hdr_t::rsv1

Reserved; programmed 0.

Definition at line 181 of file ra8_dfu.h.

◆ rsv2

uint32_t ra8_dfu_img_hdr_t::rsv2

Reserved; programmed 0.

Definition at line 182 of file ra8_dfu.h.

◆ seq

uint32_t ra8_dfu_img_hdr_t::seq

Monotonic sequence; higher valid slot wins.

Definition at line 176 of file ra8_dfu.h.

Referenced by ra8_dfu_program_commit(), and ra8_dfu_slot_seq().


The documentation for this struct was generated from the following file: