Skip to content

Commit

Permalink
llext: hotfix: fix device API tests for platforms without console
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pillo79 authored and fabiobaltieri committed Oct 3, 2024
1 parent b43e738 commit 7773fe8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/subsys/llext/simple/src/test_llext_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static void threads_objects_test_setup(struct llext *, struct k_thread *llext_th
k_object_access_grant(&my_sem, llext_thread);
k_object_access_grant(&my_thread, llext_thread);
k_object_access_grant(&my_thread_stack, llext_thread);
#if DT_HAS_CHOSEN(zephyr_console)
#if DT_HAS_CHOSEN(zephyr_console) && DT_NODE_HAS_STATUS_OKAY(DT_CHOSEN(zephyr_console))
k_object_access_grant(DEVICE_DT_GET(DT_CHOSEN(zephyr_console)), llext_thread);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion tests/subsys/llext/simple/src/threads_kernel_objects_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Some platforms do not define any usable DT devices (not even the console).
* In those cases the device API test can't be executed.
*/
#if DT_HAS_CHOSEN(zephyr_console)
#if DT_HAS_CHOSEN(zephyr_console) && DT_NODE_HAS_STATUS_OKAY(DT_CHOSEN(zephyr_console))
#define CONSOLE_DT_NODE DT_CHOSEN(zephyr_console)
#endif

Expand Down

0 comments on commit 7773fe8

Please sign in to comment.