Armando Montanez | fd5de70 | 2020-06-10 16:51:01 -0700 | [diff] [blame] | 1 | # Copyright 2020 The Pigweed Authors |
| 2 | # |
| 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 |
| 5 | # the License at |
| 6 | # |
| 7 | # https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 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 |
| 13 | # the License. |
| 14 | |
Armando Montanez | fd5de70 | 2020-06-10 16:51:01 -0700 | [diff] [blame] | 15 | import("//build_overrides/pigweed.gni") |
| 16 | |
Wyatt Hepler | ae93f42 | 2020-12-14 11:46:19 -0800 | [diff] [blame] | 17 | import("$dir_pw_rpc/system_server/backend.gni") |
Wyatt Hepler | cb9a892 | 2020-12-16 10:19:41 -0800 | [diff] [blame] | 18 | import("$dir_pw_sys_io/backend.gni") |
Armando Montanez | fd5de70 | 2020-06-10 16:51:01 -0700 | [diff] [blame] | 19 | import("$dir_pw_toolchain/arm_gcc/toolchains.gni") |
Wyatt Hepler | d49f8fe | 2020-10-15 10:13:47 -0700 | [diff] [blame] | 20 | |
Armando Montanez | fd5de70 | 2020-06-10 16:51:01 -0700 | [diff] [blame] | 21 | declare_args() { |
| 22 | # Enable the pw_target_runner for on-device testing. |
| 23 | pw_use_test_server = false |
| 24 | } |
| 25 | |
| 26 | _target_config = { |
| 27 | # Use the logging main. |
| 28 | pw_unit_test_MAIN = "$dir_pw_unit_test:logging_main" |
| 29 | |
| 30 | # Configuration options for Pigweed executable targets. |
| 31 | pw_build_EXECUTABLE_TARGET_TYPE = "stm32f429i_executable" |
| 32 | |
| 33 | pw_build_EXECUTABLE_TARGET_TYPE_FILE = |
| 34 | get_path_info("stm32f429i_executable.gni", "abspath") |
| 35 | |
| 36 | # Path to the bloaty config file for the output binaries. |
| 37 | pw_bloat_BLOATY_CONFIG = "$dir_pw_boot_armv7m/bloaty_config.bloaty" |
| 38 | |
| 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") |
| 43 | } |
| 44 | |
| 45 | # Facade backends |
| 46 | pw_assert_BACKEND = dir_pw_assert_basic |
| 47 | pw_boot_BACKEND = dir_pw_boot_armv7m |
Armando Montanez | 356bf97 | 2020-06-04 10:35:55 -0700 | [diff] [blame] | 48 | pw_cpu_exception_ENTRY_BACKEND = dir_pw_cpu_exception_armv7m |
| 49 | pw_cpu_exception_HANDLER_BACKEND = "$dir_pw_cpu_exception:basic_handler" |
| 50 | pw_cpu_exception_SUPPORT_BACKEND = "$dir_pw_cpu_exception_armv7m:support" |
Prashanth Swaminathan | acbd070 | 2021-01-22 11:58:15 -0800 | [diff] [blame^] | 51 | pw_sync_SPIN_LOCK_BACKEND = "$dir_pw_sync_baremetal:spin_lock_backend" |
Armando Montanez | fd5de70 | 2020-06-10 16:51:01 -0700 | [diff] [blame] | 52 | pw_log_BACKEND = dir_pw_log_basic |
| 53 | pw_sys_io_BACKEND = dir_pw_sys_io_baremetal_stm32f429 |
Alexei Frolov | eb94e96 | 2020-12-29 16:15:40 -0800 | [diff] [blame] | 54 | pw_rpc_system_server_BACKEND = |
| 55 | "$dir_pigweed/targets/stm32f429i-disc1:system_rpc_server" |
Chenghan Zhou | d4f44d2 | 2020-06-18 15:42:06 -0400 | [diff] [blame] | 56 | pw_malloc_BACKEND = dir_pw_malloc_freelist |
Armando Montanez | fd5de70 | 2020-06-10 16:51:01 -0700 | [diff] [blame] | 57 | |
| 58 | pw_boot_armv7m_LINK_CONFIG_DEFINES = [ |
| 59 | "PW_BOOT_FLASH_BEGIN=0x08000200", |
| 60 | "PW_BOOT_FLASH_SIZE=512K", |
Chenghan Zhou | d4f44d2 | 2020-06-18 15:42:06 -0400 | [diff] [blame] | 61 | |
| 62 | # TODO(pwbug/219): Currently "pw_tokenizer/detokenize_test" requires at |
| 63 | # least 6K bytes in heap when using pw_malloc_freelist. The heap size |
| 64 | # required for tests should be investigated. |
Chenghan Zhou | ea0f7ad | 2020-07-29 18:20:37 -0400 | [diff] [blame] | 65 | "PW_BOOT_HEAP_SIZE=7K", |
Armando Montanez | fd5de70 | 2020-06-10 16:51:01 -0700 | [diff] [blame] | 66 | "PW_BOOT_MIN_STACK_SIZE=1K", |
| 67 | "PW_BOOT_RAM_BEGIN=0x20000000", |
| 68 | "PW_BOOT_RAM_SIZE=192K", |
| 69 | "PW_BOOT_VECTOR_TABLE_BEGIN=0x08000000", |
| 70 | "PW_BOOT_VECTOR_TABLE_SIZE=512", |
| 71 | ] |
Michael Spang | 6a84595 | 2020-08-13 19:04:19 -0400 | [diff] [blame] | 72 | |
| 73 | current_cpu = "arm" |
| 74 | current_os = "" |
Armando Montanez | fd5de70 | 2020-06-10 16:51:01 -0700 | [diff] [blame] | 75 | } |
| 76 | |
Armando Montanez | 8600320 | 2020-06-16 18:00:06 -0700 | [diff] [blame] | 77 | _toolchain_properties = { |
| 78 | final_binary_extension = ".elf" |
| 79 | } |
| 80 | |
Ewout van Bekkum | fa1fc66 | 2020-10-16 16:11:13 -0700 | [diff] [blame] | 81 | _target_default_configs = [ |
| 82 | "$dir_pw_build:extra_strict_warnings", |
| 83 | "$dir_pw_toolchain/arm_gcc:enable_float_printf", |
| 84 | ] |
Armando Montanez | 71b1fa3 | 2020-06-19 12:03:29 -0700 | [diff] [blame] | 85 | |
Armando Montanez | fd5de70 | 2020-06-10 16:51:01 -0700 | [diff] [blame] | 86 | pw_target_toolchain_stm32f429i_disc1 = { |
| 87 | _excluded_members = [ |
| 88 | "defaults", |
| 89 | "name", |
| 90 | ] |
| 91 | |
| 92 | debug = { |
| 93 | name = "stm32f429i_disc1_debug" |
| 94 | _toolchain_base = pw_toolchain_arm_gcc.cortex_m4f_debug |
| 95 | forward_variables_from(_toolchain_base, "*", _excluded_members) |
Armando Montanez | 8600320 | 2020-06-16 18:00:06 -0700 | [diff] [blame] | 96 | forward_variables_from(_toolchain_properties, "*") |
Armando Montanez | fd5de70 | 2020-06-10 16:51:01 -0700 | [diff] [blame] | 97 | defaults = { |
| 98 | forward_variables_from(_toolchain_base.defaults, "*") |
| 99 | forward_variables_from(_target_config, "*") |
Armando Montanez | 71b1fa3 | 2020-06-19 12:03:29 -0700 | [diff] [blame] | 100 | default_configs += _target_default_configs |
Armando Montanez | fd5de70 | 2020-06-10 16:51:01 -0700 | [diff] [blame] | 101 | } |
| 102 | } |
| 103 | |
| 104 | speed_optimized = { |
| 105 | name = "stm32f429i_disc1_speed_optimized" |
| 106 | _toolchain_base = pw_toolchain_arm_gcc.cortex_m4f_speed_optimized |
| 107 | forward_variables_from(_toolchain_base, "*", _excluded_members) |
Armando Montanez | 8600320 | 2020-06-16 18:00:06 -0700 | [diff] [blame] | 108 | forward_variables_from(_toolchain_properties, "*") |
Armando Montanez | fd5de70 | 2020-06-10 16:51:01 -0700 | [diff] [blame] | 109 | defaults = { |
| 110 | forward_variables_from(_toolchain_base.defaults, "*") |
| 111 | forward_variables_from(_target_config, "*") |
Armando Montanez | 71b1fa3 | 2020-06-19 12:03:29 -0700 | [diff] [blame] | 112 | default_configs += _target_default_configs |
Armando Montanez | fd5de70 | 2020-06-10 16:51:01 -0700 | [diff] [blame] | 113 | } |
| 114 | } |
| 115 | |
| 116 | size_optimized = { |
| 117 | name = "stm32f429i_disc1_size_optimized" |
| 118 | _toolchain_base = pw_toolchain_arm_gcc.cortex_m4f_size_optimized |
| 119 | forward_variables_from(_toolchain_base, "*", _excluded_members) |
Armando Montanez | 8600320 | 2020-06-16 18:00:06 -0700 | [diff] [blame] | 120 | forward_variables_from(_toolchain_properties, "*") |
Armando Montanez | fd5de70 | 2020-06-10 16:51:01 -0700 | [diff] [blame] | 121 | defaults = { |
| 122 | forward_variables_from(_toolchain_base.defaults, "*") |
| 123 | forward_variables_from(_target_config, "*") |
Armando Montanez | 71b1fa3 | 2020-06-19 12:03:29 -0700 | [diff] [blame] | 124 | default_configs += _target_default_configs |
Armando Montanez | fd5de70 | 2020-06-10 16:51:01 -0700 | [diff] [blame] | 125 | } |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | # This list just contains the members of the above scope for convenience to make |
| 130 | # it trivial to generate all the toolchains in this file via a |
| 131 | # `generate_toolchains` target. |
| 132 | pw_target_toolchain_stm32f429i_disc1_list = [ |
| 133 | pw_target_toolchain_stm32f429i_disc1.debug, |
| 134 | pw_target_toolchain_stm32f429i_disc1.speed_optimized, |
| 135 | pw_target_toolchain_stm32f429i_disc1.size_optimized, |
| 136 | ] |