1 # Copyright 2020 The Pigweed Authors
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 # use this file except in compliance with the License. You may obtain a copy of
7 # https://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations under
15 import("//build_overrides/pigweed.gni")
17 import("$dir_pw_rpc/system_server/backend.gni")
18 import("$dir_pw_sys_io/backend.gni")
19 import("$dir_pw_toolchain/arm_gcc/toolchains.gni")
22 # Enable the pw_target_runner for on-device testing.
23 pw_use_test_server = false
27 # Use the logging main.
28 pw_unit_test_MAIN = "$dir_pw_unit_test:logging_main"
30 # Configuration options for Pigweed executable targets.
31 pw_build_EXECUTABLE_TARGET_TYPE = "stm32f429i_executable"
33 pw_build_EXECUTABLE_TARGET_TYPE_FILE =
34 get_path_info("stm32f429i_executable.gni", "abspath")
36 # Path to the bloaty config file for the output binaries.
37 pw_bloat_BLOATY_CONFIG = "$dir_pw_boot_armv7m/bloaty_config.bloaty"
39 if (pw_use_test_server) {
40 _test_runner_script = "py/stm32f429i_disc1_utils/unit_test_client.py"
41 pw_unit_test_AUTOMATIC_RUNNER =
42 get_path_info(_test_runner_script, "abspath")
46 pw_assert_BACKEND = dir_pw_assert_basic
47 pw_boot_BACKEND = dir_pw_boot_armv7m
48 pw_cpu_exception_ENTRY_BACKEND =
49 "$dir_pw_cpu_exception_cortex_m:cpu_exception_armv7m"
50 pw_cpu_exception_HANDLER_BACKEND = "$dir_pw_cpu_exception:basic_handler"
51 pw_cpu_exception_SUPPORT_BACKEND =
52 "$dir_pw_cpu_exception_cortex_m:support_armv7m"
53 pw_sync_SPIN_LOCK_BACKEND = "$dir_pw_sync_baremetal:spin_lock_backend"
54 pw_log_BACKEND = dir_pw_log_basic
55 pw_sys_io_BACKEND = dir_pw_sys_io_baremetal_stm32f429
56 pw_rpc_system_server_BACKEND =
57 "$dir_pigweed/targets/stm32f429i-disc1:system_rpc_server"
58 pw_malloc_BACKEND = dir_pw_malloc_freelist
60 pw_boot_armv7m_LINK_CONFIG_DEFINES = [
61 "PW_BOOT_FLASH_BEGIN=0x08000200",
62 "PW_BOOT_FLASH_SIZE=512K",
64 # TODO(pwbug/219): Currently "pw_tokenizer/detokenize_test" requires at
65 # least 6K bytes in heap when using pw_malloc_freelist. The heap size
66 # required for tests should be investigated.
67 "PW_BOOT_HEAP_SIZE=7K",
68 "PW_BOOT_MIN_STACK_SIZE=1K",
69 "PW_BOOT_RAM_BEGIN=0x20000000",
70 "PW_BOOT_RAM_SIZE=192K",
71 "PW_BOOT_VECTOR_TABLE_BEGIN=0x08000000",
72 "PW_BOOT_VECTOR_TABLE_SIZE=512",
79 _toolchain_properties = {
80 final_binary_extension = ".elf"
83 _target_default_configs = [
84 "$dir_pw_build:extra_strict_warnings",
85 "$dir_pw_toolchain/arm_gcc:enable_float_printf",
88 pw_target_toolchain_stm32f429i_disc1 = {
95 name = "stm32f429i_disc1_debug"
96 _toolchain_base = pw_toolchain_arm_gcc.cortex_m4f_debug
97 forward_variables_from(_toolchain_base, "*", _excluded_members)
98 forward_variables_from(_toolchain_properties, "*")
100 forward_variables_from(_toolchain_base.defaults, "*")
101 forward_variables_from(_target_config, "*")
102 default_configs += _target_default_configs
107 name = "stm32f429i_disc1_speed_optimized"
108 _toolchain_base = pw_toolchain_arm_gcc.cortex_m4f_speed_optimized
109 forward_variables_from(_toolchain_base, "*", _excluded_members)
110 forward_variables_from(_toolchain_properties, "*")
112 forward_variables_from(_toolchain_base.defaults, "*")
113 forward_variables_from(_target_config, "*")
114 default_configs += _target_default_configs
119 name = "stm32f429i_disc1_size_optimized"
120 _toolchain_base = pw_toolchain_arm_gcc.cortex_m4f_size_optimized
121 forward_variables_from(_toolchain_base, "*", _excluded_members)
122 forward_variables_from(_toolchain_properties, "*")
124 forward_variables_from(_toolchain_base.defaults, "*")
125 forward_variables_from(_target_config, "*")
126 default_configs += _target_default_configs
131 # This list just contains the members of the above scope for convenience to make
132 # it trivial to generate all the toolchains in this file via a
133 # `generate_toolchains` target.
134 pw_target_toolchain_stm32f429i_disc1_list = [
135 pw_target_toolchain_stm32f429i_disc1.debug,
136 pw_target_toolchain_stm32f429i_disc1.speed_optimized,
137 pw_target_toolchain_stm32f429i_disc1.size_optimized,