samples: tfm_ipc: Add reboot to sample

To test/showcase rebooting through TFM.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
This commit is contained in:
Øyvind Rønningstad 2021-04-20 08:54:46 +02:00 committed by Ioannis Glaropoulos
commit 02226e120e
4 changed files with 13 additions and 0 deletions

View file

@ -20,6 +20,10 @@ non-secure configuration.
The sample prints test info to the console either as a single-thread or The sample prints test info to the console either as a single-thread or
multi-thread application. multi-thread application.
The sample reboots after 5 seconds to demonstrate rebooting with TF-M.
The sys_reboot call is routed to TF-M, since the nonsecure app is not allowed
to perform the reboot directly.
Building and Running Building and Running
******************** ********************

View file

@ -2,6 +2,7 @@ CONFIG_BUILD_WITH_TFM=y
CONFIG_TFM_IPC=y CONFIG_TFM_IPC=y
CONFIG_TFM_REGRESSION_S=y CONFIG_TFM_REGRESSION_S=y
CONFIG_TFM_PARTITION_AUDIT_LOG=n CONFIG_TFM_PARTITION_AUDIT_LOG=n
CONFIG_REBOOT=y
# The Zephyr CMSIS emulation assumes that ticks are ms, currently # The Zephyr CMSIS emulation assumes that ticks are ms, currently
CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000

View file

@ -16,3 +16,7 @@ tests:
- "Connect success!" - "Connect success!"
- "Call success!" - "Call success!"
- "TF-M IPC on .*" - "TF-M IPC on .*"
- "The version of the PSA Framework API is"
- "Connect success!"
- "Call success!"
- "TF-M IPC on .*"

View file

@ -6,6 +6,7 @@
#include <zephyr.h> #include <zephyr.h>
#include <sys/printk.h> #include <sys/printk.h>
#include <power/reboot.h>
#include "tfm_api.h" #include "tfm_api.h"
#include "tfm_ns_interface.h" #include "tfm_ns_interface.h"
@ -185,4 +186,7 @@ void main(void)
tfm_ipc_test_1006(); tfm_ipc_test_1006();
printk("TF-M IPC on %s\n", CONFIG_BOARD); printk("TF-M IPC on %s\n", CONFIG_BOARD);
k_sleep(K_MSEC(5000));
sys_reboot(0);
} }