samples: ipc: openamp_rsc_table: Add shell backend
Add an ipc shell to the open-amp resource table sample.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
diff --git a/samples/subsys/ipc/openamp_rsc_table/prj.conf b/samples/subsys/ipc/openamp_rsc_table/prj.conf
index eb0f063..2d86c8b 100644
--- a/samples/subsys/ipc/openamp_rsc_table/prj.conf
+++ b/samples/subsys/ipc/openamp_rsc_table/prj.conf
@@ -7,3 +7,6 @@
CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF=8
CONFIG_OPENAMP_RSC_TABLE=y
CONFIG_OPENAMP_MASTER=n
+
+CONFIG_SHELL=y
+CONFIG_SHELL_BACKEND_RPMSG=y
diff --git a/samples/subsys/ipc/openamp_rsc_table/src/main_remote.c b/samples/subsys/ipc/openamp_rsc_table/src/main_remote.c
index 50c93f3..14a89f0 100644
--- a/samples/subsys/ipc/openamp_rsc_table/src/main_remote.c
+++ b/samples/subsys/ipc/openamp_rsc_table/src/main_remote.c
@@ -17,6 +17,10 @@
#include <metal/device.h>
#include <resource_table.h>
+#ifdef CONFIG_SHELL_BACKEND_RPMSG
+#include <zephyr/shell/shell_rpmsg.h>
+#endif
+
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(openamp_rsc_table, LOG_LEVEL_DBG);
@@ -363,6 +367,10 @@
goto task_end;
}
+#ifdef CONFIG_SHELL_BACKEND_RPMSG
+ (void)shell_backend_rpmsg_init_transport(rpdev);
+#endif
+
/* start the rpmsg clients */
k_sem_give(&data_sc_sem);
k_sem_give(&data_tty_sem);