File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,13 @@ add_compile_definitions(
58
58
add_link_options (
59
59
-mcpu=${GCC_CPU}
60
60
-mthumb
61
- --specs=nosys.specs )
61
+ )
62
+
63
+ if (SEMIHOSTING )
64
+ add_link_options (--specs=rdimon.specs )
65
+ else ()
66
+ add_link_options (--specs=nosys.specs )
67
+ endif ()
62
68
63
69
# Set floating point unit
64
70
if (CMAKE_SYSTEM_PROCESSOR MATCHES "\\ +fp" )
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ if(NOT DEFINED ET_PTE_FILE_PATH)
12
12
"model is built into the binary." )
13
13
endif ()
14
14
15
+ option (SEMIHOSTING "Enable semihosting" OFF )
16
+
15
17
# Example ExecuTorch demo for bare metal Cortex-M based systems
16
18
set (ET_DIR_PATH "../../.." CACHE PATH
17
19
"Path to ExecuTorch dir" )
@@ -105,3 +107,17 @@ target_include_directories(arm_executor_runner PRIVATE
105
107
${CMAKE_CURRENT_BINARY_DIR} )
106
108
107
109
add_dependencies (arm_executor_runner gen_model_header )
110
+
111
+
112
+ if (SEMIHOSTING )
113
+ target_compile_definitions (arm_executor_runner PUBLIC SEMIHOSTING )
114
+ endif ()
115
+
116
+ # Fixup compilation of retarget.c
117
+ if (SEMIHOSTING )
118
+ # Remove this when MLBEDSW-8910 is closed.
119
+ set_source_files_properties (
120
+ ${ETHOS_SDK_PATH} /core_platform/targets/corstone-300/retarget.c
121
+ PROPERTIES HEADER_FILE_ONLY TRUE
122
+ )
123
+ endif ()
You can’t perform that action at this time.
0 commit comments