From f785bd3fb2ac1cce6f5fa9b3f2ed11e647501bde Mon Sep 17 00:00:00 2001 From: Adolfo Reyna Date: Wed, 19 Aug 2026 21:18:14 -0400 Subject: [PATCH] fix(bookplayer): use exported device_find_* API for audio stream lookup The flashed 0.8.0-dev firmware exports the legacy device_find_by_name / device_find_first_by_type lookup API, not the newer device_get_* out-param API. Switching to device_get_* (to match newer SDK headers) caused 'ELF: Can't find symbol device_get_by_name' at load on .129/.114. Revert to the exported legacy functions, declared locally since the newer SDK header dropped them. Verified on .129 via serial: elf entry resolves, app shows. --- Apps/BookPlayer/main/Source/main.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Apps/BookPlayer/main/Source/main.c b/Apps/BookPlayer/main/Source/main.c index 4f32b94..47133e4 100644 --- a/Apps/BookPlayer/main/Source/main.c +++ b/Apps/BookPlayer/main/Source/main.c @@ -125,14 +125,22 @@ static void play_wav(AppCtx* ctx); static void scan_books(AppCtx* ctx); /* ─── Audio-stream helpers ─── */ +// The flashed firmware exports the legacy device_find_* lookup API; the newer +// device_get_* (out-param) API is not yet exported on 0.8.0-dev, so calling it +// fails at load with "missing symbol". The newer SDK headers dropped the legacy +// declarations, so declare them here (symbols are resolved at runtime by the ELF +// loader against the flashed firmware). +extern struct Device* device_find_by_name(const char* name); +extern struct Device* device_find_first_by_type(const struct DeviceType* type); + static bool find_audio_stream_device(AppCtx* ctx) { - struct Device* dev = NULL; - if (device_get_by_name("audio-stream", &dev) == ERROR_NONE && dev) { + struct Device* dev = device_find_by_name("audio-stream"); + if (dev) { ctx->stream_dev = dev; return true; } - dev = NULL; - if (device_get_first_by_type(&AUDIO_STREAM_TYPE, &dev) == ERROR_NONE && dev) { + dev = device_find_first_by_type(&AUDIO_STREAM_TYPE); + if (dev) { ctx->stream_dev = dev; return true; }