Skip to content

Commit 0b00d0c

Browse files
committed
Allow non-secure main thread to call secure functions
1 parent 43b98cf commit 0b00d0c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rtos/TARGET_CORTEX/mbed_boot.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,12 @@ void mbed_start_main(void)
321321
_main_thread_attr.cb_mem = &_main_obj;
322322
_main_thread_attr.priority = osPriorityNormal;
323323
_main_thread_attr.name = "main_thread";
324+
325+
/* Allow non-secure main thread to call secure functions */
326+
#if defined(DOMAIN_NS) && (DOMAIN_NS == 1U)
327+
_main_thread_attr.tz_module = 1U;
328+
#endif
329+
324330
osThreadId_t result = osThreadNew((osThreadFunc_t)pre_main, NULL, &_main_thread_attr);
325331
if ((void *)result == NULL) {
326332
MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_INITIALIZATION_FAILED), "Pre main thread not created", &_main_thread_attr);

0 commit comments

Comments
 (0)