From c61afc6042bc312f05896cf8e7f600aab34b5870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 26 Nov 2026 11:26:49 +0100 Subject: [PATCH] Define NRFX_CLZ/NRFX_CTZ and NRFY_CACHE_* in nrfx_glue.h nrfx expects the glue layer to provide these. Without them nrfx_timer.c and nrfx_gppi_dppi.c call NRFX_CTZ/NRFX_CLZ as undeclared functions (-Wimplicit-function-declaration), and the empty NRFY_CACHE_* fallbacks in nrf_common.h leave the locals passed to them unused in nrfy_nfct.h, nrfy_saadc.h, nrfy_spim.h and nrfy_uarte.h (-Wunused-variable). NRFX_CLZ/NRFX_CTZ map to the GCC builtins. nRF54L has an instruction cache only, so the cache macros stay no-ops that consume their arguments. --- cores/nRF5/nordic/nrfx_glue.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cores/nRF5/nordic/nrfx_glue.h b/cores/nRF5/nordic/nrfx_glue.h index a407215..28b58aa 100644 --- a/cores/nRF5/nordic/nrfx_glue.h +++ b/cores/nRF5/nordic/nrfx_glue.h @@ -160,6 +160,22 @@ static inline bool _NRFX_IRQ_IS_PENDING(IRQn_Type irq_number) #include #define NRFX_DELAY_US(us_time) nrfx_coredep_delay_us(us_time) +// --------------------------------------------------------------------------- +// Bit operations +// --------------------------------------------------------------------------- + +#define NRFX_CLZ(value) __builtin_clz(value) +#define NRFX_CTZ(value) __builtin_ctz(value) + +// --------------------------------------------------------------------------- +// Cache maintenance +// --------------------------------------------------------------------------- + +// nRF54L has an instruction cache only, so DMA buffers need no maintenance. +#define NRFY_CACHE_WB(p_buffer, size) do { (void)(p_buffer); (void)(size); } while (0) +#define NRFY_CACHE_INV(p_buffer, size) do { (void)(p_buffer); (void)(size); } while (0) +#define NRFY_CACHE_WBINV(p_buffer, size) do { (void)(p_buffer); (void)(size); } while (0) + // --------------------------------------------------------------------------- // Error codes // ---------------------------------------------------------------------------