Skip to content

Commit a116293

Browse files
committed
XXX Add TF-M secure prints
1 parent 663ce2f commit a116293

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/secure_utilities.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
#define EXC_NUM_PENDSV (14)
2626
#define EXC_NUM_SYSTICK (15)
2727

28-
#define printf(...)
29-
3028
/* Disable NS exceptions by setting NS PRIMASK to 1 */
3129
#define TFM_NS_EXC_DISABLE() __TZ_set_PRIMASK_NS(1)
3230
/* Enable NS exceptions by setting NS PRIMASK to 0 */

components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/tfm_core.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#include <stdio.h>
9+
#include "hal/serial_api.h"
910
#include "region_defs.h"
1011
#include "tfm_core.h"
1112
#include "tfm_internal.h"
@@ -76,6 +77,11 @@ void configure_ns_code(void)
7677
ns_entry = (nsfptr_t) cmse_nsfptr_create(entry_ptr);
7778
}
7879

80+
#if DEVICE_SERIAL
81+
extern int stdio_uart_inited;
82+
extern serial_t stdio_uart;
83+
#endif
84+
7985
int32_t tfm_core_init(void)
8086
{
8187
/* Enables fault handlers */
@@ -89,7 +95,12 @@ int32_t tfm_core_init(void)
8995

9096
__enable_irq();
9197

92-
LOG_MSG("Secure image initializing!");
98+
#if DEVICE_SERIAL
99+
serial_init(&stdio_uart, STDIO_UART_TX, STDIO_UART_RX);
100+
serial_baud(&stdio_uart, MBED_CONF_PLATFORM_STDIO_BAUD_RATE);
101+
#endif
102+
103+
LOG_MSG("Secure image initializing!\r\n");
93104

94105
#ifdef TFM_CORE_DEBUG
95106
printf("TFM level is: %d\r\n", TFM_LVL);

targets/targets.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,6 +2144,7 @@
21442144
],
21452145
"device_has_add": [
21462146
"FLASH",
2147+
"SERIAL",
21472148
"TRNG"
21482149
],
21492150
"deliver_to_target": "LPC55S69_NS",

0 commit comments

Comments
 (0)