diff options
Diffstat (limited to 'pw_system/system_target.gni')
-rw-r--r-- | pw_system/system_target.gni | 64 |
1 files changed, 61 insertions, 3 deletions
diff --git a/pw_system/system_target.gni b/pw_system/system_target.gni index 6000f1c8c..55dbcf1b7 100644 --- a/pw_system/system_target.gni +++ b/pw_system/system_target.gni @@ -30,6 +30,8 @@ import("$dir_pw_toolchain/arm_gcc/toolchains.gni") import("$dir_pw_toolchain/generate_toolchain.gni") import("$dir_pw_toolchain/host_clang/toolchains.gni") import("$dir_pw_toolchain/host_gcc/toolchains.gni") +import("$dir_pw_trace/backend.gni") +import("$dir_pw_trace_tokenized/config.gni") import("$dir_pw_unit_test/test.gni") import("backend.gni") import("freertos_backends.gni") @@ -41,6 +43,7 @@ PW_SYSTEM_CPU = { CORTEX_M4F = "cortex-m4f" CORTEX_M3 = "cortex-m3" CORTEX_M7F = "cortex-m7f" + CORTEX_M33 = "cortex-m33" # Native builds for the host CPU. NATIVE = "native" @@ -56,12 +59,25 @@ PW_SYSTEM_SCHEDULER = { NATIVE = "native" } +declare_args() { + # This argument is intended to be user-facing and should NOT be set by a + # toolchain. This switches ALL pw_system_target toolchains to use the + # multi_endpoint_rpc_config config to illustrate a multi-endpoint mode that + # isolates logging and RPC traffic via HDLC multiplexing. + # + # If you would like to use this in production, it is strongly recommended that + # you instead just add the appropriate defines to your target's toolchain + # definition. + pw_system_USE_MULTI_ENDPOINT_CONFIG = false +} + # Defines a target toolchain, automatically setting many required build # arguments to simplify instantiation of a target. # # Args: # cpu: (required) The architecture to target. -# Supported choices: PW_SYSTEM_CPU.CORTEX_M7F, PW_SYSTEM_CPU.CORTEX_M4F, PW_SYSTEM_CPU.CORTEX_M3, PW_SYSTEM_CPU.NATIVE +# Supported choices: PW_SYSTEM_CPU.CORTEX_M7F, PW_SYSTEM_CPU.CORTEX_M4F, PW_SYSTEM_CPU.CORTEX_M3, +# PW_SYSTEM_CPU.CORTEX_M33, PW_SYSTEM_CPU.NATIVE # scheduler: (required) The scheduler implementation and API to use for this # target. # Supported choices: PW_SYSTEM_SCHEDULER.FREERTOS, PW_SYSTEM_SCHEDULER.NATIVE @@ -111,13 +127,51 @@ template("pw_system_target") { # TODO(amontanez): This should be set to a "$dir_pw_unit_test:rpc_main" # when RPC is working. pw_unit_test_MAIN = "$dir_pw_unit_test:logging_main" + + pw_trace_BACKEND = "$dir_pw_trace_tokenized" + + if (pw_system_USE_MULTI_ENDPOINT_CONFIG) { + pw_system_CONFIG = "$dir_pw_system:multi_endpoint_rpc_config" + } } # Populate architecture-specific build args. assert( defined(invoker.cpu), - "Please select a `cpu` for $target_name. Options: PW_SYSTEM_CPU.CORTEX_M7, PW_SYSTEM_CPU.CORTEX_M4F, PW_SYSTEM_CPU.CORTEX_M3, PW_SYSTEM_CPU.NATIVE") - if (invoker.cpu == PW_SYSTEM_CPU.CORTEX_M7F) { + "Please select a `cpu` for $target_name. Options: PW_SYSTEM_CPU.CORTEX_M7, PW_SYSTEM_CPU.CORTEX_M4F, PW_SYSTEM_CPU.CORTEX_M3, PW_SYSTEM_CPU.CORTEX_M33, PW_SYSTEM_CPU.NATIVE") + if (invoker.cpu == PW_SYSTEM_CPU.CORTEX_M33) { + _current_cpu = "arm" + _default_configs += [ "$dir_pw_toolchain/arm_gcc:enable_float_printf" ] + _arch_build_args = { + pw_bloat_BLOATY_CONFIG = "$dir_pw_boot_cortex_m/bloaty_config.bloaty" + pw_boot_BACKEND = "$dir_pw_boot_cortex_m:pw_boot_cortex_m" + pw_interrupt_CONTEXT_BACKEND = "$dir_pw_interrupt_cortex_m:context" + } + _link_deps += [ "$dir_pw_toolchain/arm_gcc:arm_none_eabi_gcc_support" ] + + if (defined(invoker.system_toolchain)) { + _system_toolchain = invoker.system_toolchain + } else { + _system_toolchain = pw_toolchain_arm_gcc + } + + _final_binary_extension = ".elf" + + _toolchains = [ + { + toolchain_base = _system_toolchain.cortex_m33_debug + level_name = _OPTIMIZATION_LEVELS.DEBUG + }, + { + toolchain_base = _system_toolchain.cortex_m33_size_optimized + level_name = _OPTIMIZATION_LEVELS.SIZE_OPTIMIZED + }, + { + toolchain_base = _system_toolchain.cortex_m33_speed_optimized + level_name = _OPTIMIZATION_LEVELS.SPEED_OPTIMIZED + }, + ] + } else if (invoker.cpu == PW_SYSTEM_CPU.CORTEX_M7F) { _current_cpu = "arm" _default_configs += [ "$dir_pw_toolchain/arm_gcc:enable_float_printf" ] _arch_build_args = { @@ -125,6 +179,7 @@ template("pw_system_target") { pw_boot_BACKEND = "$dir_pw_boot_cortex_m:armv7m" pw_interrupt_CONTEXT_BACKEND = "$dir_pw_interrupt_cortex_m:context_armv7m" } + _link_deps += [ "$dir_pw_toolchain/arm_gcc:arm_none_eabi_gcc_support" ] if (defined(invoker.system_toolchain)) { _system_toolchain = invoker.system_toolchain @@ -156,6 +211,7 @@ template("pw_system_target") { pw_boot_BACKEND = "$dir_pw_boot_cortex_m:armv7m" pw_interrupt_CONTEXT_BACKEND = "$dir_pw_interrupt_cortex_m:context_armv7m" } + _link_deps += [ "$dir_pw_toolchain/arm_gcc:arm_none_eabi_gcc_support" ] if (defined(invoker.system_toolchain)) { _system_toolchain = invoker.system_toolchain @@ -186,6 +242,7 @@ template("pw_system_target") { pw_boot_BACKEND = "$dir_pw_boot_cortex_m:armv7m" pw_interrupt_CONTEXT_BACKEND = "$dir_pw_interrupt_cortex_m:context_armv7m" } + _link_deps += [ "$dir_pw_toolchain/arm_gcc:arm_none_eabi_gcc_support" ] if (defined(invoker.system_toolchain)) { _system_toolchain = invoker.system_toolchain @@ -216,6 +273,7 @@ template("pw_system_target") { pw_boot_BACKEND = "$dir_pw_boot_cortex_m:armv7m" pw_interrupt_CONTEXT_BACKEND = "$dir_pw_interrupt_cortex_m:context_armv7m" } + _link_deps += [ "$dir_pw_toolchain/arm_gcc:arm_none_eabi_gcc_support" ] if (defined(invoker.system_toolchain)) { _system_toolchain = invoker.system_toolchain |