Mudr-209 [DIRECT]

static uint8_t record_buf[RECORD_MAX]; static uint32_t record_seq = 0;

/* 4. Write to flash (append‑only) ------------------------------------------*/ static void persist_record(void) MUDR-209

mudr209_hdr_t *hdr = (mudr209_hdr_t*)record_buf; uint8_t *data = record_buf + sizeof(mudr209_hdr_t); static uint8_t record_buf[RECORD_MAX]

hdr->magic = MUDR209_MAGIC; // 0x4D554452 (MUDR) hdr->seq = ++record_seq; hdr->ts = hw_get_secure_timestamp(); // signed by TPM hdr->src_id = DEVICE_ID; // 4‑byte unique ID hdr->payload_sz = payload_len; hdr->crc32 = 0; // filled later static uint32_t record_seq = 0