Skip to content

Commit 7773fe8

Browse files
pillo79fabiobaltieri
authored andcommitted
llext: hotfix: fix device API tests for platforms without console
LLEXT tests currently fail on platforms where a console was chosen but its underlying device is not enabled. This might happen for example on multicore SoCs, where the console is only enabled on the most powerful CPU. Fix this by only allowing testing the device API if the console device is both chosen and enabled in the final DT. Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
1 parent b43e738 commit 7773fe8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/subsys/llext/simple/src/test_llext_simple.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static void threads_objects_test_setup(struct llext *, struct k_thread *llext_th
109109
k_object_access_grant(&my_sem, llext_thread);
110110
k_object_access_grant(&my_thread, llext_thread);
111111
k_object_access_grant(&my_thread_stack, llext_thread);
112-
#if DT_HAS_CHOSEN(zephyr_console)
112+
#if DT_HAS_CHOSEN(zephyr_console) && DT_NODE_HAS_STATUS_OKAY(DT_CHOSEN(zephyr_console))
113113
k_object_access_grant(DEVICE_DT_GET(DT_CHOSEN(zephyr_console)), llext_thread);
114114
#endif
115115
}

tests/subsys/llext/simple/src/threads_kernel_objects_ext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* Some platforms do not define any usable DT devices (not even the console).
2323
* In those cases the device API test can't be executed.
2424
*/
25-
#if DT_HAS_CHOSEN(zephyr_console)
25+
#if DT_HAS_CHOSEN(zephyr_console) && DT_NODE_HAS_STATUS_OKAY(DT_CHOSEN(zephyr_console))
2626
#define CONSOLE_DT_NODE DT_CHOSEN(zephyr_console)
2727
#endif
2828

0 commit comments

Comments
 (0)