From 7feb9cbf67a66ef6c6f02e80ab192029355022cb Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 16 Sep 2026 18:17:48 +0200 Subject: [PATCH] Mark wolfBoot_invalidate_hdr_cache RAMFUNCTION Called from the RAM-resident update path (update_ram.c) under EXT_FLASH; place the body in RAM so it runs after flash remap instead of faulting. Verification: built unit-custom-trailer-nopart (EXT_FLASH) - compiles clean; imx95_m7 (EXT_FLASH, CI repro) - compiles clean. --- include/image.h | 2 +- src/image.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/image.h b/include/image.h index 914d0d6c..ba55399d 100644 --- a/include/image.h +++ b/include/image.h @@ -1752,7 +1752,7 @@ uint16_t wolfBoot_get_header(struct wolfBoot_image *img, uint16_t type, uint8_t #ifdef EXT_FLASH /* Drop the cached external image header so the next open reloads it. */ -void wolfBoot_invalidate_hdr_cache(void); +void RAMFUNCTION wolfBoot_invalidate_hdr_cache(void); #endif /* Find the key slot ID based on the SHA hash of the key. */ diff --git a/src/image.c b/src/image.c index a028f2dc..dc48fc86 100644 --- a/src/image.c +++ b/src/image.c @@ -1097,7 +1097,7 @@ static uint8_t *fetch_hdr_cpy(struct wolfBoot_image *img) * it to every later get_header() call. Call this before opening a * different image so TLV lookups do not read the stale header. */ -void wolfBoot_invalidate_hdr_cache(void) +void RAMFUNCTION wolfBoot_invalidate_hdr_cache(void) { hdr_cpy_done = 0; }