Ulf Magnusson | bd6e044 | 2019-11-01 13:45:29 +0100 | [diff] [blame] | 1 | # General configuration options |
Anas Nashif | 7d4163d | 2015-08-22 14:43:07 -0400 | [diff] [blame] | 2 | |
Anas Nashif | 7d4163d | 2015-08-22 14:43:07 -0400 | [diff] [blame] | 3 | # Copyright (c) 2014-2015 Wind River Systems, Inc. |
Daniel Leung | 8df10d4 | 2016-03-25 14:30:50 -0700 | [diff] [blame] | 4 | # Copyright (c) 2016 Intel Corporation |
Dominik Ermel | 865f801 | 2023-05-11 11:47:21 +0000 | [diff] [blame] | 5 | # Copyright (c) 2023 Nordic Semiconductor ASA |
David B. Kinder | ac74d8b | 2017-01-18 17:01:01 -0800 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 |
Sebastian Bøe | 4b61bd1 | 2018-01-09 14:12:07 +0100 | [diff] [blame] | 7 | |
Torsten Rasmussen | 49389b5 | 2023-03-23 11:02:49 +0100 | [diff] [blame] | 8 | osource "${APPLICATION_SOURCE_DIR}/VERSION" |
Anas Nashif | 658f6bc | 2019-05-28 14:22:51 -0400 | [diff] [blame] | 9 | |
Ulf Magnusson | e63b652 | 2020-01-26 23:47:41 +0100 | [diff] [blame] | 10 | # Include Kconfig.defconfig files first so that they can override defaults and |
| 11 | # other symbol/choice properties by adding extra symbol/choice definitions. |
| 12 | # After merging all definitions for a symbol/choice, Kconfig picks the first |
| 13 | # property (e.g. the first default) with a satisfied condition. |
Ulf Magnusson | ec3eff5 | 2018-07-30 10:57:47 +0200 | [diff] [blame] | 14 | # |
Ulf Magnusson | e63b652 | 2020-01-26 23:47:41 +0100 | [diff] [blame] | 15 | # Shield defaults should have precedence over board defaults, which should have |
| 16 | # precedence over SoC defaults, so include them in that order. |
Ulf Magnusson | ec3eff5 | 2018-07-30 10:57:47 +0200 | [diff] [blame] | 17 | # |
Ulf Magnusson | e63b652 | 2020-01-26 23:47:41 +0100 | [diff] [blame] | 18 | # $ARCH and $BOARD_DIR will be glob patterns when building documentation. |
Torsten Rasmussen | 6be1b2a | 2021-06-02 08:47:21 +0200 | [diff] [blame] | 19 | # This loads custom shields defconfigs (from BOARD_ROOT) |
| 20 | osource "$(KCONFIG_BINARY_DIR)/Kconfig.shield.defconfig" |
| 21 | # This loads Zephyr base shield defconfigs |
| 22 | source "boards/shields/*/Kconfig.defconfig" |
| 23 | |
Ulf Magnusson | d713033 | 2018-09-05 13:10:19 +0200 | [diff] [blame] | 24 | source "$(BOARD_DIR)/Kconfig.defconfig" |
Torsten Rasmussen | 6be1b2a | 2021-06-02 08:47:21 +0200 | [diff] [blame] | 25 | |
| 26 | # This loads custom SoC root defconfigs |
| 27 | osource "$(KCONFIG_BINARY_DIR)/Kconfig.soc.defconfig" |
| 28 | # This loads Zephyr base SoC root defconfigs |
| 29 | osource "soc/$(ARCH)/*/Kconfig.defconfig" |
Torsten Rasmussen | 36bb00d | 2021-08-15 23:14:21 +0200 | [diff] [blame] | 30 | # This loads the toolchain defconfigs |
| 31 | osource "$(TOOLCHAIN_KCONFIG_DIR)/Kconfig.defconfig" |
Krzysztof Chruscinski | 2735a3a | 2022-09-06 12:50:10 +0200 | [diff] [blame] | 32 | # This loads the testsuite defconfig |
| 33 | source "subsys/testsuite/Kconfig.defconfig" |
Ulf Magnusson | ec3eff5 | 2018-07-30 10:57:47 +0200 | [diff] [blame] | 34 | |
Kumar Gala | 52a3ec9 | 2022-08-12 10:00:38 -0500 | [diff] [blame] | 35 | # This should be early since the autogen Kconfig.dts symbols may get |
| 36 | # used by modules |
| 37 | source "dts/Kconfig" |
| 38 | |
Ioannis Glaropoulos | c520385 | 2020-12-07 18:42:52 +0100 | [diff] [blame] | 39 | menu "Modules" |
| 40 | |
Ioannis Glaropoulos | c520385 | 2020-12-07 18:42:52 +0100 | [diff] [blame] | 41 | source "modules/Kconfig" |
| 42 | |
| 43 | endmenu |
| 44 | |
Anas Nashif | abcf2ad | 2018-09-04 08:32:07 -0500 | [diff] [blame] | 45 | source "boards/Kconfig" |
Torsten Rasmussen | 5f7cc8d | 2020-07-06 12:53:39 +0200 | [diff] [blame] | 46 | source "soc/Kconfig" |
Anas Nashif | 77ba3c3 | 2015-10-09 06:20:52 -0400 | [diff] [blame] | 47 | source "arch/Kconfig" |
Anas Nashif | 77ba3c3 | 2015-10-09 06:20:52 -0400 | [diff] [blame] | 48 | source "kernel/Kconfig" |
Anas Nashif | 77ba3c3 | 2015-10-09 06:20:52 -0400 | [diff] [blame] | 49 | source "drivers/Kconfig" |
Anas Nashif | 0b2c44a | 2016-05-14 23:10:51 -0400 | [diff] [blame] | 50 | source "lib/Kconfig" |
Ramesh Thomas | e354ad2 | 2016-10-29 04:10:36 -0700 | [diff] [blame] | 51 | source "subsys/Kconfig" |
Kumar Gala | 7584a12 | 2016-05-24 14:23:26 -0500 | [diff] [blame] | 52 | |
Kumar Gala | 2630fba | 2020-01-24 09:39:40 -0600 | [diff] [blame] | 53 | osource "$(TOOLCHAIN_KCONFIG_DIR)/Kconfig" |
Anas Nashif | 8017c59 | 2019-05-23 17:19:41 -0400 | [diff] [blame] | 54 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 55 | menu "Build and Link Features" |
| 56 | |
| 57 | menu "Linker Options" |
| 58 | |
Erwan Gouriou | 16d9d4d | 2023-03-22 15:09:48 +0100 | [diff] [blame] | 59 | choice LINKER_ORPHAN_CONFIGURATION |
Daniel Leung | 6600c64 | 2018-10-19 10:15:19 -0700 | [diff] [blame] | 60 | prompt "Linker Orphan Section Handling" |
| 61 | default LINKER_ORPHAN_SECTION_WARN |
| 62 | |
| 63 | config LINKER_ORPHAN_SECTION_PLACE |
| 64 | bool "Place" |
| 65 | help |
| 66 | Linker puts orphan sections in place without warnings |
| 67 | or errors. |
| 68 | |
| 69 | config LINKER_ORPHAN_SECTION_WARN |
| 70 | bool "Warn" |
| 71 | help |
Anas Nashif | f2cb20c | 2019-06-18 14:45:40 -0400 | [diff] [blame] | 72 | Linker places the orphan sections in output and issues |
Daniel Leung | 6600c64 | 2018-10-19 10:15:19 -0700 | [diff] [blame] | 73 | warning about those sections. |
| 74 | |
| 75 | config LINKER_ORPHAN_SECTION_ERROR |
| 76 | bool "Error" |
| 77 | help |
| 78 | Linker exits with error when an orphan section is found. |
| 79 | |
| 80 | endchoice |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 81 | |
| 82 | config HAS_FLASH_LOAD_OFFSET |
| 83 | bool |
| 84 | help |
| 85 | This option is selected by targets having a FLASH_LOAD_OFFSET |
| 86 | and FLASH_LOAD_SIZE. |
| 87 | |
Ulf Magnusson | fd9981a | 2019-11-16 01:33:09 +0100 | [diff] [blame] | 88 | if HAS_FLASH_LOAD_OFFSET |
| 89 | |
Ulf Magnusson | 90b9eb3 | 2019-11-16 01:22:16 +0100 | [diff] [blame] | 90 | config USE_DT_CODE_PARTITION |
Ulf Magnusson | 1f9c5f1 | 2019-11-16 01:16:57 +0100 | [diff] [blame] | 91 | bool "Link application into /chosen/zephyr,code-partition from devicetree" |
Andrzej Puzdrowski | 2b1227f | 2019-03-18 14:02:11 +0100 | [diff] [blame] | 92 | help |
Ulf Magnusson | 1f9c5f1 | 2019-11-16 01:16:57 +0100 | [diff] [blame] | 93 | When enabled, the application will be linked into the flash partition |
| 94 | selected by the zephyr,code-partition property in /chosen in devicetree. |
| 95 | When this is disabled, the flash load offset and size can be set manually |
| 96 | below. |
Andrzej Puzdrowski | 2b1227f | 2019-03-18 14:02:11 +0100 | [diff] [blame] | 97 | |
Kumar Gala | 8ce0cf0 | 2019-08-28 09:29:26 -0500 | [diff] [blame] | 98 | # Workaround for not being able to have commas in macro arguments |
| 99 | DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition |
| 100 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 101 | config FLASH_LOAD_OFFSET |
Ulf Magnusson | 90b9eb3 | 2019-11-16 01:22:16 +0100 | [diff] [blame] | 102 | # Only user-configurable when USE_DT_CODE_PARTITION is disabled |
| 103 | hex "Kernel load offset" if !USE_DT_CODE_PARTITION |
| 104 | default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 105 | default 0 |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 106 | help |
| 107 | This option specifies the byte offset from the beginning of flash that |
| 108 | the kernel should be loaded into. Changing this value from zero will |
| 109 | affect the Zephyr image's link, and will decrease the total amount of |
| 110 | flash available for use by application code. |
| 111 | |
| 112 | If unsure, leave at the default value 0. |
| 113 | |
| 114 | config FLASH_LOAD_SIZE |
Ulf Magnusson | 90b9eb3 | 2019-11-16 01:22:16 +0100 | [diff] [blame] | 115 | # Only user-configurable when USE_DT_CODE_PARTITION is disabled |
| 116 | hex "Kernel load size" if !USE_DT_CODE_PARTITION |
| 117 | default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 118 | default 0 |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 119 | help |
| 120 | If non-zero, this option specifies the size, in bytes, of the flash |
| 121 | area that the Zephyr image will be allowed to occupy. If zero, the |
| 122 | image will be able to occupy from the FLASH_LOAD_OFFSET to the end of |
| 123 | the device. |
| 124 | |
| 125 | If unsure, leave at the default value 0. |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 126 | |
Ulf Magnusson | fd9981a | 2019-11-16 01:33:09 +0100 | [diff] [blame] | 127 | endif # HAS_FLASH_LOAD_OFFSET |
| 128 | |
Stephanos Ioannidis | 3322489 | 2020-02-10 16:37:24 +0900 | [diff] [blame] | 129 | config ROM_START_OFFSET |
Ole Sæther | 985446a | 2019-01-23 14:13:03 +0100 | [diff] [blame] | 130 | hex |
Stephanos Ioannidis | 3322489 | 2020-02-10 16:37:24 +0900 | [diff] [blame] | 131 | prompt "ROM start offset" if !BOOTLOADER_MCUBOOT |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 132 | default 0x200 if BOOTLOADER_MCUBOOT |
| 133 | default 0 |
| 134 | help |
| 135 | If the application is built for chain-loading by a bootloader this |
| 136 | variable is required to be set to value that leaves sufficient |
Stephanos Ioannidis | 3322489 | 2020-02-10 16:37:24 +0900 | [diff] [blame] | 137 | space between the beginning of the image and the start of the first |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 138 | section to store an image header or any other metadata. |
| 139 | In the particular case of the MCUboot bootloader this reserves enough |
| 140 | space to store the image header, which should also meet vector table |
| 141 | alignment requirements on most ARM targets, although some targets |
| 142 | may require smaller or larger values. |
| 143 | |
Torsten Rasmussen | 761eada | 2021-06-09 11:22:07 +0200 | [diff] [blame] | 144 | config LD_LINKER_SCRIPT_SUPPORTED |
| 145 | bool |
| 146 | default y |
| 147 | |
| 148 | choice LINKER_SCRIPT |
| 149 | prompt "Linker script" |
| 150 | default LD_LINKER_TEMPLATE if LD_LINKER_SCRIPT_SUPPORTED |
| 151 | |
| 152 | config LD_LINKER_TEMPLATE |
| 153 | bool "LD template" |
| 154 | depends on LD_LINKER_SCRIPT_SUPPORTED |
| 155 | help |
| 156 | Select this option to use the LD linker script templates. |
| 157 | The templates are pre-processed by the C pre-processor to create the |
| 158 | final LD linker script. |
| 159 | |
| 160 | config CMAKE_LINKER_GENERATOR |
| 161 | bool "CMake generator" |
| 162 | depends on ARM |
| 163 | help |
| 164 | Select this option to use the Zephyr CMake linker script generator. |
| 165 | The linker configuration is written in CMake and the final linker |
| 166 | script will be generated by the toolchain specific linker generator. |
| 167 | For LD based linkers, this will be the ld generator, for ARMClang / |
| 168 | armlink based linkers it will be the scatter generator. |
| 169 | |
| 170 | endchoice |
| 171 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 172 | config HAVE_CUSTOM_LINKER_SCRIPT |
Torsten Rasmussen | 761eada | 2021-06-09 11:22:07 +0200 | [diff] [blame] | 173 | bool "Custom linker script provided" |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 174 | help |
| 175 | Set this option if you have a custom linker script which needed to |
| 176 | be define in CUSTOM_LINKER_SCRIPT. |
| 177 | |
| 178 | config CUSTOM_LINKER_SCRIPT |
| 179 | string "Path to custom linker script" |
| 180 | depends on HAVE_CUSTOM_LINKER_SCRIPT |
| 181 | help |
| 182 | Path to the linker script to be used instead of the one define by the |
| 183 | board. |
| 184 | |
| 185 | The linker script must be based on a version provided by Zephyr since |
| 186 | the kernel can expect a certain layout/certain regions. |
| 187 | |
| 188 | This is useful when an application needs to add sections into the |
| 189 | linker script and avoid having to change the script provided by |
| 190 | Zephyr. |
| 191 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 192 | config KERNEL_ENTRY |
| 193 | string "Kernel entry symbol" |
| 194 | default "__start" |
| 195 | help |
| 196 | Code entry symbol, to be set at linking phase. |
| 197 | |
Sebastian Bøe | 3a0597f | 2019-03-15 14:05:09 +0100 | [diff] [blame] | 198 | config LINKER_SORT_BY_ALIGNMENT |
| 199 | bool "Sort input sections by alignment" |
| 200 | default y |
| 201 | help |
| 202 | This turns on the linker flag to sort sections by alignment |
| 203 | in decreasing size of symbols. This helps to minimize |
| 204 | padding between symbols. |
| 205 | |
Jordan Yates | 318ee97 | 2021-04-17 20:04:33 +1000 | [diff] [blame] | 206 | config SRAM_VECTOR_TABLE |
| 207 | bool "Place the vector table in SRAM instead of flash" |
| 208 | help |
| 209 | The option specifies that the vector table should be placed at the |
| 210 | start of SRAM instead of the start of flash. |
| 211 | |
Daniel Leung | ece9cad | 2021-02-20 11:02:17 -0800 | [diff] [blame] | 212 | config HAS_SRAM_OFFSET |
| 213 | bool |
| 214 | help |
| 215 | This option is selected by targets that require SRAM_OFFSET. |
| 216 | |
| 217 | config SRAM_OFFSET |
| 218 | hex "Kernel SRAM offset" if HAS_SRAM_OFFSET |
| 219 | default 0 |
| 220 | help |
| 221 | This option specifies the byte offset from the beginning of SRAM |
| 222 | where the kernel begins. Changing this value from zero will affect |
| 223 | the Zephyr image's link, and will decrease the total amount of |
| 224 | SRAM available for use by application code. |
| 225 | |
| 226 | If unsure, leave at the default value 0. |
| 227 | |
Daniel Leung | d812728 | 2021-02-24 10:18:34 -0800 | [diff] [blame] | 228 | menu "Linker Sections" |
| 229 | |
| 230 | config LINKER_USE_BOOT_SECTION |
Gerard Marull-Paretas | dffaf53 | 2022-03-09 12:31:16 +0100 | [diff] [blame] | 231 | bool "Use Boot Linker Section" |
Daniel Leung | d812728 | 2021-02-24 10:18:34 -0800 | [diff] [blame] | 232 | help |
| 233 | If enabled, the symbols which are needed for the boot process |
| 234 | will be put into another linker section reserved for these |
| 235 | symbols. |
| 236 | |
| 237 | Requires that boot sections exist in the architecture, SoC, |
| 238 | board or custom linker script. |
| 239 | |
Daniel Leung | 1310ad6 | 2021-02-23 13:33:38 -0800 | [diff] [blame] | 240 | config LINKER_USE_PINNED_SECTION |
Gerard Marull-Paretas | dffaf53 | 2022-03-09 12:31:16 +0100 | [diff] [blame] | 241 | bool "Use Pinned Linker Section" |
Daniel Leung | 1310ad6 | 2021-02-23 13:33:38 -0800 | [diff] [blame] | 242 | help |
| 243 | If enabled, the symbols which need to be pinned in memory |
| 244 | will be put into another linker section reserved for pinned |
| 245 | symbols. During boot, the corresponding memory will be marked |
| 246 | as pinned. |
| 247 | |
| 248 | Requires that pinned sections exist in the architecture, SoC, |
| 249 | board or custom linker script. |
| 250 | |
Daniel Leung | 6a006d7 | 2021-07-12 10:58:45 -0700 | [diff] [blame] | 251 | config LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT |
| 252 | bool "Generic sections are present at boot" if DEMAND_PAGING && LINKER_USE_PINNED_SECTION |
| 253 | default y |
| 254 | help |
| 255 | When disabled, the linker sections other than the boot and |
| 256 | pinned sections will be marked as not present in the page |
| 257 | tables. This allows kernel to pull in data pages on demand |
| 258 | as required by current execution context when demand paging |
| 259 | is enabled. There is no need to load all code and data into |
| 260 | memory at once. |
| 261 | |
| 262 | If unsure, say Y. |
| 263 | |
Torsten Rasmussen | c107827 | 2022-09-27 12:34:36 +0200 | [diff] [blame] | 264 | config LINKER_LAST_SECTION_ID |
| 265 | bool "Last section identifier" |
| 266 | default y |
| 267 | depends on ARM || ARM64 || RISCV |
| 268 | help |
| 269 | If enabled, the last section will contain an identifier. |
| 270 | This ensures that the '_flash_used' linker symbol will always be |
| 271 | correctly calculated, even in cases where the location counter may |
| 272 | have been incremented for alignment purposes but no data is placed |
| 273 | after alignment. |
| 274 | |
| 275 | Note: in cases where the flash is fully used, for example application |
| 276 | specific data is written at the end of the flash area, then writing a |
| 277 | last section identifier may cause rom region overflow. |
| 278 | In such cases this setting should be disabled. |
| 279 | |
| 280 | config LINKER_LAST_SECTION_ID_PATTERN |
| 281 | hex "Last section identifier pattern" |
| 282 | default "0xE015E015" |
| 283 | depends on LINKER_LAST_SECTION_ID |
| 284 | help |
| 285 | Pattern to fill into last section as identifier. |
| 286 | Default pattern is 0xE015 (end of last section), but any pattern can |
| 287 | be used. |
| 288 | The size of the pattern must not exceed 4 bytes. |
| 289 | |
Flavio Ceolin | 56ec06f | 2022-12-20 10:36:34 -0800 | [diff] [blame] | 290 | config LINKER_USE_NO_RELAX |
| 291 | bool |
| 292 | help |
| 293 | Hidden symbol to allow features to force the use of no relax. |
| 294 | |
| 295 | config LINKER_USE_RELAX |
| 296 | bool "Linker optimization of call addressing" |
| 297 | depends on !LINKER_USE_NO_RELAX |
| 298 | default y |
| 299 | help |
| 300 | This option performs global optimizations that become possible when the linker resolves |
| 301 | addressing in the program, such as relaxing address modes and synthesizing new |
| 302 | instructions in the output object file. For ld and lld, this enables `--relax`. |
| 303 | On platforms where this is not supported, `--relax' is accepted, but ignored. |
| 304 | Disabling it can reduce performance, as the linker is no longer able to substiture long / |
| 305 | in-effective jump calls to shorter / more effective instructions. |
| 306 | |
Daniel Leung | d812728 | 2021-02-24 10:18:34 -0800 | [diff] [blame] | 307 | endmenu # "Linker Sections" |
| 308 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 309 | endmenu |
| 310 | |
| 311 | menu "Compiler Options" |
| 312 | |
Flavio Ceolin | b587e8d | 2020-08-26 09:48:33 -0700 | [diff] [blame] | 313 | config CODING_GUIDELINE_CHECK |
| 314 | bool "Enforce coding guideline rules" |
| 315 | help |
| 316 | Use available compiler flags to check coding guideline rules during |
| 317 | the build. |
| 318 | |
Alberto Escolar Piedras | 2eb14f1 | 2023-05-26 13:15:09 +0200 | [diff] [blame] | 319 | config NATIVE_BUILD |
| 320 | bool |
Keith Packard | 214a3c5 | 2023-02-08 13:44:39 -0800 | [diff] [blame] | 321 | select FULL_LIBC_SUPPORTED |
Kumar Gala | e268f8e | 2023-05-01 10:59:35 -0500 | [diff] [blame] | 322 | select FULL_LIBCPP_SUPPORTED if CPP |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 323 | help |
Alberto Escolar Piedras | 2eb14f1 | 2023-05-26 13:15:09 +0200 | [diff] [blame] | 324 | Zephyr will be built targeting the host system for debug and |
| 325 | development purposes. |
| 326 | |
| 327 | config NATIVE_APPLICATION |
| 328 | bool |
| 329 | default y if ARCH_POSIX |
| 330 | depends on !NATIVE_LIBRARY |
| 331 | select NATIVE_BUILD |
| 332 | help |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 333 | Build as a native application that can run on the host and using |
| 334 | resources and libraries provided by the host. |
| 335 | |
Alberto Escolar Piedras | 2eb14f1 | 2023-05-26 13:15:09 +0200 | [diff] [blame] | 336 | config NATIVE_LIBRARY |
| 337 | bool |
| 338 | select NATIVE_BUILD |
| 339 | help |
| 340 | Build as a prelinked library for the native host target. |
| 341 | This library can later be built into an executable for the host. |
| 342 | |
Keith Packard | 6c5d806 | 2023-02-08 14:56:50 -0800 | [diff] [blame] | 343 | config COMPILER_FREESTANDING |
| 344 | bool "Build in a freestanding compiler mode" |
| 345 | help |
| 346 | Configure the compiler to operate in freestanding mode according to |
| 347 | the C and C++ language specifications. Freestanding mode reduces the |
| 348 | requirements of the compiler and language environment, which can |
| 349 | negatively impact the ability for the compiler to detect errors and |
| 350 | perform optimizations. |
| 351 | |
Emil Lindqvist | f7dad07 | 2021-09-03 13:52:33 +0200 | [diff] [blame] | 352 | choice COMPILER_OPTIMIZATIONS |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 353 | prompt "Optimization level" |
| 354 | default NO_OPTIMIZATIONS if COVERAGE |
| 355 | default DEBUG_OPTIMIZATIONS if DEBUG |
| 356 | default SIZE_OPTIMIZATIONS |
| 357 | help |
| 358 | Note that these flags shall only control the compiler |
| 359 | optimization level, and that no extra debug code shall be |
| 360 | conditionally compiled based on them. |
| 361 | |
| 362 | config SIZE_OPTIMIZATIONS |
| 363 | bool "Optimize for size" |
| 364 | help |
| 365 | Compiler optimizations will be set to -Os independently of other |
| 366 | options. |
| 367 | |
| 368 | config SPEED_OPTIMIZATIONS |
| 369 | bool "Optimize for speed" |
| 370 | help |
| 371 | Compiler optimizations will be set to -O2 independently of other |
| 372 | options. |
| 373 | |
| 374 | config DEBUG_OPTIMIZATIONS |
| 375 | bool "Optimize debugging experience" |
| 376 | help |
| 377 | Compiler optimizations will be set to -Og independently of other |
| 378 | options. |
| 379 | |
| 380 | config NO_OPTIMIZATIONS |
| 381 | bool "Optimize nothing" |
| 382 | help |
| 383 | Compiler optimizations will be set to -O0 independently of other |
| 384 | options. |
Henrik Brix Andersen | 26ebcee | 2023-03-22 10:19:40 +0100 | [diff] [blame] | 385 | |
| 386 | Selecting this option will likely require manual tuning of the |
| 387 | default stack sizes in order to avoid stack overflows. |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 388 | endchoice |
| 389 | |
Nikolay Agishev | 0dec4cf | 2022-12-22 15:46:04 +0400 | [diff] [blame] | 390 | config COMPILER_WARNINGS_AS_ERRORS |
| 391 | bool "Treat warnings as errors" |
| 392 | help |
| 393 | Turn on "warning as error" toolchain flags |
| 394 | |
Fabio Baltieri | 3f8f713 | 2023-03-29 10:11:46 +0100 | [diff] [blame] | 395 | config COMPILER_SAVE_TEMPS |
| 396 | bool "Save temporary object files" |
| 397 | help |
| 398 | Instruct the compiler to save the temporary intermediate files |
| 399 | permanently. These can be useful for troubleshooting build issues. |
| 400 | |
Gerard Marull-Paretas | 99ebe39 | 2023-05-05 09:58:12 +0200 | [diff] [blame] | 401 | config COMPILER_TRACK_MACRO_EXPANSION |
| 402 | bool "Track macro expansion" |
| 403 | default y |
| 404 | help |
| 405 | When enabled, locations of tokens across macro expansions will be |
| 406 | tracked. Disabling this option may be useful to debug long macro |
| 407 | expansion chains. |
| 408 | |
Arvin Farahmand | e430b7b | 2021-04-15 11:20:10 -0400 | [diff] [blame] | 409 | config COMPILER_COLOR_DIAGNOSTICS |
Gerard Marull-Paretas | 95fb0de | 2022-03-09 12:05:12 +0100 | [diff] [blame] | 410 | bool "Colored diagnostics" |
Arvin Farahmand | e430b7b | 2021-04-15 11:20:10 -0400 | [diff] [blame] | 411 | default y |
| 412 | help |
| 413 | Compiler diagnostic messages are colorized. |
| 414 | |
Keith Packard | 62bc9bf | 2022-04-26 19:24:11 -0700 | [diff] [blame] | 415 | choice COMPILER_SECURITY_FORTIFY |
| 416 | prompt "Detect buffer overflows in libc calls" |
Alberto Escolar Piedras | 56dc20e | 2023-05-26 13:23:43 +0200 | [diff] [blame] | 417 | default FORTIFY_SOURCE_NONE if NO_OPTIMIZATIONS || MINIMAL_LIBC || NATIVE_BUILD |
Keith Packard | 62bc9bf | 2022-04-26 19:24:11 -0700 | [diff] [blame] | 418 | default FORTIFY_SOURCE_COMPILE_TIME |
| 419 | help |
| 420 | Buffer overflow checking in libc calls. Supported by Clang and |
| 421 | GCC when using Picolibc or Newlib. Requires compiler optimization |
| 422 | to be enabled. |
| 423 | |
| 424 | config FORTIFY_SOURCE_NONE |
| 425 | bool "No detection" |
| 426 | help |
| 427 | Disables both compile-time and run-time checking. |
| 428 | |
| 429 | config FORTIFY_SOURCE_COMPILE_TIME |
| 430 | bool "Compile-time detection" |
| 431 | help |
| 432 | Enables only compile-time checking. Compile-time checking |
| 433 | doesn't increase executable size or reduce performance, it |
| 434 | limits checking to what can be done with information available |
| 435 | at compile time. |
| 436 | |
| 437 | config FORTIFY_SOURCE_RUN_TIME |
| 438 | bool "Compile-time and run-time detection" |
| 439 | help |
| 440 | Enables both compile-time and run-time checking. Run-time |
| 441 | checking increases coverage at the expense of additional code, |
| 442 | and means that applications will raise a runtime exception |
| 443 | when buffer overflow is detected. |
| 444 | |
| 445 | endchoice |
| 446 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 447 | config COMPILER_OPT |
| 448 | string "Custom compiler options" |
| 449 | help |
| 450 | This option is a free-form string that is passed to the compiler |
| 451 | when building all parts of a project (i.e. kernel). |
| 452 | The compiler options specified by this string supplement the |
| 453 | predefined set of compiler supplied by the build system, |
| 454 | and can be used to change compiler optimization, warning and error |
| 455 | messages, and so on. |
| 456 | |
Martí Bolívar | e5cc854 | 2021-05-21 10:56:23 -0700 | [diff] [blame] | 457 | config MISRA_SANE |
| 458 | bool "MISRA standards compliance features" |
| 459 | help |
| 460 | Causes the source code to build in "MISRA" mode, which |
| 461 | disallows some otherwise-permitted features of the C |
| 462 | standard for safety reasons. Specifically variable length |
| 463 | arrays are not permitted (and gcc will enforce this). |
| 464 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 465 | endmenu |
| 466 | |
Anas Nashif | 22b95a2 | 2019-11-24 11:28:38 -0500 | [diff] [blame] | 467 | choice |
| 468 | prompt "Error checking behavior for CHECK macro" |
| 469 | default RUNTIME_ERROR_CHECKS |
| 470 | |
| 471 | config ASSERT_ON_ERRORS |
| 472 | bool "Assert on all errors" |
| 473 | help |
| 474 | Assert on errors covered with the CHECK macro. |
| 475 | |
| 476 | config NO_RUNTIME_CHECKS |
| 477 | bool "No runtime error checks" |
| 478 | help |
| 479 | Do not do any runtime checks or asserts when using the CHECK macro. |
| 480 | |
| 481 | config RUNTIME_ERROR_CHECKS |
Gerard Marull-Paretas | 95fb0de | 2022-03-09 12:05:12 +0100 | [diff] [blame] | 482 | bool "Runtime error checks" |
Anas Nashif | 22b95a2 | 2019-11-24 11:28:38 -0500 | [diff] [blame] | 483 | help |
| 484 | Always perform runtime checks covered with the CHECK macro. This |
| 485 | option is the default and the only option used during testing. |
| 486 | |
| 487 | endchoice |
| 488 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 489 | menu "Build Options" |
| 490 | |
| 491 | config KERNEL_BIN_NAME |
| 492 | string "The kernel binary name" |
| 493 | default "zephyr" |
| 494 | help |
| 495 | This option sets the name of the generated kernel binary. |
| 496 | |
| 497 | config OUTPUT_STAT |
| 498 | bool "Create a statistics file" |
| 499 | default y |
| 500 | help |
| 501 | Create a stat file using readelf -e <elf> |
| 502 | |
Anas Nashif | 47a673f | 2022-06-27 10:08:37 -0400 | [diff] [blame] | 503 | config OUTPUT_SYMBOLS |
| 504 | bool "Create a symbol file" |
| 505 | help |
| 506 | Create a symbol file using nm <elf> |
| 507 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 508 | config OUTPUT_DISASSEMBLY |
| 509 | bool "Create a disassembly file" |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 510 | help |
| 511 | Create an .lst file with the assembly listing of the firmware. |
| 512 | |
Rohit Gujarathi | 35713f2 | 2020-05-07 10:08:37 +0530 | [diff] [blame] | 513 | config OUTPUT_DISASSEMBLE_ALL |
| 514 | bool "Disassemble all sections with source. Fill zeros." |
| 515 | default n |
| 516 | depends on OUTPUT_DISASSEMBLY |
| 517 | help |
| 518 | The .lst file will contain complete disassembly of the firmware |
| 519 | not just those expected to contain instructions including zeros |
| 520 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 521 | config OUTPUT_PRINT_MEMORY_USAGE |
| 522 | bool "Print memory usage to stdout" |
| 523 | default y |
| 524 | help |
| 525 | If the toolchain supports it, this option will pass |
| 526 | --print-memory-region to the linker when it is doing it's first |
| 527 | linker pass. Note that the memory regions are symbolic concepts |
| 528 | defined by the linker scripts and do not necessarily map |
| 529 | directly to the real physical address space. Take also note that |
| 530 | some platforms do two passes of the linker so the results do not |
| 531 | match exactly to the final elf file. See also rom_report, |
| 532 | ram_report and |
| 533 | https://sourceware.org/binutils/docs/ld/MEMORY.html |
| 534 | |
Anas Nashif | fdbf2db | 2020-10-20 14:31:56 -0400 | [diff] [blame] | 535 | config CLEANUP_INTERMEDIATE_FILES |
| 536 | bool "Remove all intermediate files" |
| 537 | help |
| 538 | Delete intermediate files to save space and cleanup clutter resulting |
Filip Kokosinski | 7388a07 | 2023-07-19 15:40:55 +0200 | [diff] [blame] | 539 | from the build process. Note this breaks incremental builds, west spdx |
| 540 | (Software Bill of Material generation), and maybe others. |
Anas Nashif | fdbf2db | 2020-10-20 14:31:56 -0400 | [diff] [blame] | 541 | |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 542 | config BUILD_NO_GAP_FILL |
| 543 | bool "Don't fill gaps in generated hex/bin/s19 files." |
| 544 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 545 | config BUILD_OUTPUT_HEX |
| 546 | bool "Build a binary in HEX format" |
| 547 | help |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 548 | Build an Intel HEX binary zephyr/zephyr.hex in the build directory. |
| 549 | The name of this file can be customized with CONFIG_KERNEL_BIN_NAME. |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 550 | |
| 551 | config BUILD_OUTPUT_BIN |
| 552 | bool "Build a binary in BIN format" |
| 553 | default y |
| 554 | help |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 555 | Build a "raw" binary zephyr/zephyr.bin in the build directory. |
| 556 | The name of this file can be customized with CONFIG_KERNEL_BIN_NAME. |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 557 | |
Anas Nashif | 51c34bb | 2021-01-26 06:58:30 -0500 | [diff] [blame] | 558 | config BUILD_OUTPUT_EFI |
| 559 | bool "Build as an EFI application" |
| 560 | default n |
| 561 | depends on X86_64 |
| 562 | help |
| 563 | Build as an EFI application. |
| 564 | |
| 565 | This works by creating a "zephyr.efi" EFI binary containing a zephyr |
| 566 | image extracted from a built zephyr.elf file. EFI applications are |
| 567 | relocatable, and cannot be placed at specific locations in memory. |
| 568 | Instead, the stub code will copy the embedded zephyr sections to the |
| 569 | appropriate locations at startup, clear any zero-filled (BSS, etc...) |
| 570 | areas, then jump into the 64 bit entry point. |
| 571 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 572 | config BUILD_OUTPUT_EXE |
| 573 | bool "Build a binary in ELF format with .exe extension" |
| 574 | help |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 575 | Build an ELF binary that can run in the host system at |
| 576 | zephyr/zephyr.exe in the build directory. |
| 577 | The name of this file can be customized with CONFIG_KERNEL_BIN_NAME. |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 578 | |
| 579 | config BUILD_OUTPUT_S19 |
| 580 | bool "Build a binary in S19 format" |
| 581 | help |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 582 | Build an S19 binary zephyr/zephyr.s19 in the build directory. |
| 583 | The name of this file can be customized with CONFIG_KERNEL_BIN_NAME. |
Håkon Øye Amundsen | c086b93 | 2018-11-26 09:47:16 +0000 | [diff] [blame] | 584 | |
Pete Johanson | 310a464 | 2020-12-31 16:51:52 -0500 | [diff] [blame] | 585 | config BUILD_OUTPUT_UF2 |
| 586 | bool "Build a binary in UF2 format" |
| 587 | depends on BUILD_OUTPUT_BIN |
| 588 | help |
| 589 | Build a UF2 binary zephyr/zephyr.uf2 in the build directory. |
| 590 | The name of this file can be customized with CONFIG_KERNEL_BIN_NAME. |
| 591 | |
| 592 | if BUILD_OUTPUT_UF2 |
| 593 | |
| 594 | config BUILD_OUTPUT_UF2_FAMILY_ID |
Pete Johanson | ff01a00 | 2021-02-16 09:35:11 -0500 | [diff] [blame] | 595 | string "UF2 device family ID" |
Marek Matej | 6b57b3b | 2023-07-20 18:24:09 +0200 | [diff] [blame] | 596 | default "0x1c5f21b0" if SOC_SERIES_ESP32 |
Xudong Zheng | 8db9869 | 2022-03-22 12:15:50 -0400 | [diff] [blame] | 597 | default "0x621e937a" if SOC_NRF52833_QIAA |
Pete Johanson | ff01a00 | 2021-02-16 09:35:11 -0500 | [diff] [blame] | 598 | default "0xada52840" if SOC_NRF52840_QIAA |
| 599 | default "0x4fb2d5bd" if SOC_SERIES_IMX_RT |
| 600 | default "0x2abc77ec" if SOC_SERIES_LPC55XXX |
Yonatan Schachter | efa170f | 2022-02-01 23:05:04 +0200 | [diff] [blame] | 601 | default "0xe48bff56" if SOC_SERIES_RP2XXX |
Pete Johanson | ff01a00 | 2021-02-16 09:35:11 -0500 | [diff] [blame] | 602 | default "0x68ed2b88" if SOC_SERIES_SAMD21 |
| 603 | default "0x55114460" if SOC_SERIES_SAMD51 |
| 604 | default "0x647824b6" if SOC_SERIES_STM32F0X |
| 605 | default "0x5d1a0a2e" if SOC_SERIES_STM32F2X |
| 606 | default "0x6b846188" if SOC_SERIES_STM32F3X |
| 607 | default "0x53b80f00" if SOC_SERIES_STM32F7X |
| 608 | default "0x300f5633" if SOC_SERIES_STM32G0X |
| 609 | default "0x4c71240a" if SOC_SERIES_STM32G4X |
| 610 | default "0x6db66082" if SOC_SERIES_STM32H7X |
| 611 | default "0x202e3a91" if SOC_SERIES_STM32L0X |
| 612 | default "0x1e1f432d" if SOC_SERIES_STM32L1X |
| 613 | default "0x00ff6919" if SOC_SERIES_STM32L4X |
| 614 | default "0x04240bdf" if SOC_SERIES_STM32L5X |
| 615 | default "0x70d16653" if SOC_SERIES_STM32WBX |
| 616 | default "0x5ee21072" if SOC_STM32F103XE |
Guillaume Gautier | 3d42322 | 2022-12-21 14:44:45 +0100 | [diff] [blame] | 617 | default "0x57755a57" if SOC_SERIES_STM32F4X && (!SOC_STM32F407XE) && (!SOC_STM32F407XG) |
Pete Johanson | ff01a00 | 2021-02-16 09:35:11 -0500 | [diff] [blame] | 618 | default "0x6d0922fa" if SOC_STM32F407XE |
| 619 | default "0x8fb060fe" if SOC_STM32F407XG |
Pete Johanson | 310a464 | 2020-12-31 16:51:52 -0500 | [diff] [blame] | 620 | help |
| 621 | UF2 bootloaders only accept UF2 files with a matching family ID. |
| 622 | This can be either a hex, e.g. 0x68ed2b88, or well-known family |
Pete Johanson | ff01a00 | 2021-02-16 09:35:11 -0500 | [diff] [blame] | 623 | name string. If the SoC in use is known by UF2, the Family ID will |
| 624 | be pre-filled with the known value. |
Pete Johanson | 310a464 | 2020-12-31 16:51:52 -0500 | [diff] [blame] | 625 | |
Peter Johanson | 3f33207 | 2022-01-27 00:45:27 -0500 | [diff] [blame] | 626 | config BUILD_OUTPUT_UF2_USE_FLASH_BASE |
| 627 | bool |
| 628 | default n |
| 629 | |
| 630 | config BUILD_OUTPUT_UF2_USE_FLASH_OFFSET |
| 631 | bool |
| 632 | default n |
| 633 | |
Pete Johanson | 310a464 | 2020-12-31 16:51:52 -0500 | [diff] [blame] | 634 | endif # BUILD_OUTPUT_UF2 |
| 635 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 636 | config BUILD_OUTPUT_STRIPPED |
| 637 | bool "Build a stripped binary" |
| 638 | help |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 639 | Build a stripped binary zephyr/zephyr.strip in the build directory. |
| 640 | The name of this file can be customized with CONFIG_KERNEL_BIN_NAME. |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 641 | |
Torsten Rasmussen | d51a67b | 2022-01-12 14:21:07 +0100 | [diff] [blame] | 642 | config BUILD_OUTPUT_ADJUST_LMA |
| 643 | string |
| 644 | help |
| 645 | This will adjust the LMA address in the final ELF and hex files with |
| 646 | the value provided. |
| 647 | This will not affect the internal address symbols inside the image but |
| 648 | can be useful when adjusting the LMA address for flash tools or multi |
| 649 | stage loaders where a pre-loader may copy image to a second location |
| 650 | before booting a second core. |
| 651 | The value will be evaluated as a math expression, this means that |
| 652 | following are valid expression |
| 653 | - 1024 |
| 654 | - 0x1000 |
| 655 | - -0x1000 |
| 656 | - 0x20000000 - 0x10000000 |
| 657 | Note: negative numbers are valid. |
| 658 | To adjust according to a chosen flash partition one can specify a |
| 659 | default as: |
| 660 | DT_CHOSEN_IMAGE_<name> := <name>,<name>-partition |
| 661 | DT_CHOSEN_Z_FLASH := zephyr,flash |
| 662 | config BUILD_OUTPUT_ADJUST_LMA |
| 663 | default "$(dt_chosen_reg_addr_hex,$(DT_CHOSEN_IMAGE_M4))-\ |
| 664 | $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))" |
| 665 | |
Torsten Rasmussen | c8ddc34 | 2022-01-10 11:02:26 +0100 | [diff] [blame] | 666 | config BUILD_OUTPUT_INFO_HEADER |
| 667 | bool "Create a image information header" |
| 668 | help |
| 669 | Create an image information header which will contain image |
| 670 | information from the Zephyr binary. |
| 671 | Example of information contained in the header file: |
| 672 | - Number of segments in the image |
| 673 | - LMA address of each segment |
| 674 | - VMA address of each segment |
| 675 | - Size of each segment |
| 676 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 677 | config APPLICATION_DEFINED_SYSCALL |
| 678 | bool "Scan application folder for any syscall definition" |
| 679 | help |
| 680 | Scan additional folders inside application source folder |
| 681 | for application defined syscalls. |
| 682 | |
Sebastian Bøe | d3a8fd4 | 2019-10-17 14:25:34 +0200 | [diff] [blame] | 683 | config MAKEFILE_EXPORTS |
| 684 | bool "Generate build metadata files named Makefile.exports" |
| 685 | help |
| 686 | Generates a file with build information that can be read by |
| 687 | third party Makefile-based build systems. |
| 688 | |
Torsten Rasmussen | fffaf05 | 2021-10-12 23:08:36 +0200 | [diff] [blame] | 689 | config BUILD_OUTPUT_META |
| 690 | bool "Create a build meta file" |
| 691 | help |
| 692 | Create a build meta file in the build directory containing lists of: |
| 693 | - Zephyr: path and revision (if git repo) |
| 694 | - Zephyr modules: name, path, and revision (if git repo) |
Torsten Rasmussen | 64ec6ee | 2021-11-04 14:28:21 +0100 | [diff] [blame] | 695 | - West: |
| 696 | - manifest: path and revision |
| 697 | - projects: path and revision |
| 698 | - Workspace: |
| 699 | - dirty: one or more repositories are marked dirty |
| 700 | - extra: extra Zephyr modules are manually included in the build |
| 701 | - off: the SHA of one or more west projects are not what the manifest |
| 702 | defined when `west update` was run the last time (`manifest-rev`). |
| 703 | The off state is only present if a west workspace is found. |
Torsten Rasmussen | fffaf05 | 2021-10-12 23:08:36 +0200 | [diff] [blame] | 704 | File extension is .meta |
| 705 | |
Torsten Rasmussen | 1a51993 | 2021-11-04 18:35:50 +0100 | [diff] [blame] | 706 | config BUILD_OUTPUT_META_STATE_PROPAGATE |
| 707 | bool "Propagate module and project state" |
| 708 | depends on BUILD_OUTPUT_META |
| 709 | help |
| 710 | Propagate to state of each module to the Zephyr revision field. |
| 711 | If west is used the state of each west project is also propagated to |
| 712 | the Zephyr revision field. |
| 713 | West manifest repo revision field will also |
| 714 | be marked with the same state as the Zephyr revision. |
| 715 | The final revision will become: <SHA>-<state1>-<state2>-<state3>... |
| 716 | If no states are appended to the SHA it means the build is of a clean |
| 717 | tree. |
| 718 | - dirty: one or more repositories are marked dirty |
| 719 | - extra: extra Zephyr modules are manually included in the build |
| 720 | - off: the SHA of one or more west projects are not what the manifest |
| 721 | defined when `west update` was run the last time (`manifest-rev`). |
| 722 | The off state is only present if a west workspace is found. |
| 723 | |
Martin Jäger | a0ffaa7 | 2023-03-29 16:06:30 +0200 | [diff] [blame] | 724 | config BUILD_OUTPUT_STRIP_PATHS |
| 725 | bool "Strip absolute paths from binaries" |
| 726 | default y |
| 727 | help |
| 728 | If the compiler supports it, strip the ${ZEPHYR_BASE} prefix from the |
| 729 | __FILE__ macro used in __ASSERT*, in the |
| 730 | .noinit."/home/joe/zephyr/fu/bar.c" section names and in any |
| 731 | application code. |
| 732 | This saves some memory, stops leaking user locations in binaries, makes |
| 733 | failure logs more deterministic and most importantly makes builds more |
| 734 | deterministic. |
| 735 | Debuggers usually have a path mapping feature to ensure the files are |
| 736 | still found. |
| 737 | |
Fabio Baltieri | 2264c14 | 2023-03-09 17:29:54 +0000 | [diff] [blame] | 738 | config CHECK_INIT_PRIORITIES |
| 739 | bool "Build time initialization priorities check" |
| 740 | help |
| 741 | Check the build for initialization priority issues by comparing the |
| 742 | initialization priority in the build with the device dependency |
| 743 | derived from the devicetree definition. |
| 744 | |
| 745 | Fails the build on priority errors (dependent devices, inverted |
| 746 | priority), see CHECK_INIT_PRIORITIES_FAIL_ON_WARNING to fail on |
| 747 | warnings (dependent devices, same priority) as well. |
| 748 | |
| 749 | config CHECK_INIT_PRIORITIES_FAIL_ON_WARNING |
| 750 | bool "Fail the build on priority check warnings" |
| 751 | depends on CHECK_INIT_PRIORITIES |
| 752 | help |
| 753 | Fail the build if the dependency check script identifies any pair of |
| 754 | devices depending on each other but initialized with the same |
| 755 | priority. |
| 756 | |
Daniel Leung | 80e7820 | 2023-05-25 11:41:48 -0700 | [diff] [blame] | 757 | config EMIT_ALL_SYSCALLS |
| 758 | bool "Emit all possible syscalls in the tree" |
| 759 | help |
| 760 | This tells the build system to emit all possible syscalls found |
| 761 | in the tree, instead of only those syscalls associated with enabled |
| 762 | drivers and subsystems. |
| 763 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 764 | endmenu |
Torsten Rasmussen | 1c91129 | 2021-03-22 14:29:38 +0100 | [diff] [blame] | 765 | |
Torsten Rasmussen | 6066ab4 | 2022-07-15 12:05:04 +0200 | [diff] [blame] | 766 | config DEPRECATED |
| 767 | bool |
| 768 | help |
| 769 | Symbol that must be selected by a feature or module if it is |
| 770 | considered to be deprecated. |
| 771 | |
| 772 | config WARN_DEPRECATED |
| 773 | bool |
| 774 | default y |
| 775 | prompt "Warn on deprecated usage" |
| 776 | help |
| 777 | Print a warning when the Kconfig tree is parsed if any deprecated |
| 778 | features are enabled. |
| 779 | |
Torsten Rasmussen | 1c91129 | 2021-03-22 14:29:38 +0100 | [diff] [blame] | 780 | config EXPERIMENTAL |
| 781 | bool |
| 782 | help |
| 783 | Symbol that must be selected by a feature if it is considered to be |
| 784 | at an experimental implementation stage. |
| 785 | |
| 786 | config WARN_EXPERIMENTAL |
| 787 | bool |
| 788 | prompt "Warn on experimental usage" |
| 789 | help |
| 790 | Print a warning when the Kconfig tree is parsed if any experimental |
| 791 | features are enabled. |
| 792 | |
Carles Cufi | d800ccc | 2022-08-22 18:38:16 +0200 | [diff] [blame] | 793 | config TAINT |
| 794 | bool |
| 795 | help |
| 796 | Symbol that must be selected by a feature or module if the Zephyr |
| 797 | build is considered tainted. |
| 798 | |
Nicolas Pitre | 0a386db | 2022-06-20 13:18:14 -0400 | [diff] [blame] | 799 | config ENFORCE_ZEPHYR_STDINT |
| 800 | bool |
| 801 | prompt "Enforce Zephyr convention for stdint" |
| 802 | depends on !ARCH_POSIX |
| 803 | default y |
| 804 | help |
| 805 | This enforces the Zephyr stdint convention where int32_t = int, |
| 806 | int64_t = long long, and intptr_t = long so that short string |
| 807 | format length modifiers can be used universally across ILP32 |
| 808 | and LP64 architectures. Sometimes this is not possible e.g. when |
| 809 | linking against a binary-only C++ library whose type mangling |
| 810 | is incompatible with the Zephyr convention, or if the build |
| 811 | environment doesn't allow such enforcement, in which case this |
| 812 | should be turned off with the caveat that argument type validation |
| 813 | on Zephyr code will be skipped. |
| 814 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 815 | endmenu |
| 816 | |
| 817 | |
| 818 | menu "Boot Options" |
| 819 | |
| 820 | config IS_BOOTLOADER |
| 821 | bool "Act as a bootloader" |
| 822 | depends on XIP |
| 823 | depends on ARM |
| 824 | help |
| 825 | This option indicates that Zephyr will act as a bootloader to execute |
| 826 | a separate Zephyr image payload. |
| 827 | |
| 828 | config BOOTLOADER_SRAM_SIZE |
| 829 | int "SRAM reserved for bootloader" |
Kevin Townsend | f68cee9 | 2023-07-14 00:47:55 +0200 | [diff] [blame] | 830 | default 0 |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 831 | depends on !XIP || IS_BOOTLOADER |
Rajavardhan Gundi | e584b05 | 2018-12-14 16:55:43 +0530 | [diff] [blame] | 832 | depends on ARM || XTENSA |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 833 | help |
| 834 | This option specifies the amount of SRAM (measure in kB) reserved for |
| 835 | a bootloader image, when either: |
| 836 | - the Zephyr image itself is to act as the bootloader, or |
| 837 | - Zephyr is a !XIP image, which implicitly assumes existence of a |
| 838 | bootloader that loads the Zephyr !XIP image onto SRAM. |
| 839 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 840 | config BOOTLOADER_ESP_IDF |
| 841 | bool "ESP-IDF bootloader support" |
Marek Matej | 4796746 | 2023-05-09 11:10:05 +0200 | [diff] [blame] | 842 | depends on SOC_FAMILY_ESP32 && !BOOTLOADER_MCUBOOT && !MCUBOOT |
| 843 | default y |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 844 | help |
| 845 | This option will trigger the compilation of the ESP-IDF bootloader |
| 846 | inside the build folder. |
| 847 | At flash time, the bootloader will be flashed with the zephyr image |
| 848 | |
Michael Hope | 8c1f186 | 2020-06-13 21:32:11 +0200 | [diff] [blame] | 849 | config BOOTLOADER_BOSSA |
| 850 | bool "BOSSA bootloader support" |
| 851 | select USE_DT_CODE_PARTITION |
Michael Hope | 8c1f186 | 2020-06-13 21:32:11 +0200 | [diff] [blame] | 852 | |
| 853 | help |
| 854 | Signifies that the target uses a BOSSA compatible bootloader. If CDC |
| 855 | ACM USB support is also enabled then the board will reboot into the |
| 856 | bootloader automatically when bossac is run. |
| 857 | |
| 858 | config BOOTLOADER_BOSSA_DEVICE_NAME |
| 859 | string "BOSSA CDC ACM device name" |
| 860 | depends on BOOTLOADER_BOSSA && CDC_ACM_DTE_RATE_CALLBACK_SUPPORT |
| 861 | default "CDC_ACM_0" |
| 862 | help |
| 863 | Sets the CDC ACM port to watch for reboot commands. |
| 864 | |
| 865 | choice |
| 866 | prompt "BOSSA bootloader variant" |
| 867 | depends on BOOTLOADER_BOSSA |
| 868 | |
Gerson Fernando Budke | f3a7f04 | 2021-05-06 21:20:11 -0300 | [diff] [blame] | 869 | config BOOTLOADER_BOSSA_LEGACY |
| 870 | bool "Legacy" |
| 871 | help |
| 872 | Select the Legacy variant of the BOSSA bootloader. This is defined |
| 873 | for compatibility mode only. The recommendation is use newer |
| 874 | versions like Arduino or Adafruit UF2. |
| 875 | |
Michael Hope | 8c1f186 | 2020-06-13 21:32:11 +0200 | [diff] [blame] | 876 | config BOOTLOADER_BOSSA_ARDUINO |
| 877 | bool "Arduino" |
| 878 | help |
| 879 | Select the Arduino variant of the BOSSA bootloader. Uses 0x07738135 |
| 880 | as the magic value to enter the bootloader. |
| 881 | |
| 882 | config BOOTLOADER_BOSSA_ADAFRUIT_UF2 |
| 883 | bool "Adafruit UF2" |
| 884 | help |
| 885 | Select the Adafruit UF2 variant of the BOSSA bootloader. Uses |
| 886 | 0xf01669ef as the magic value to enter the bootloader. |
| 887 | |
| 888 | endchoice |
| 889 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 890 | endmenu |
Carlo Caione | d048faa | 2019-12-17 17:13:47 +0000 | [diff] [blame] | 891 | |
| 892 | menu "Compatibility" |
| 893 | |
| 894 | config COMPAT_INCLUDES |
| 895 | bool "Suppress warnings when using header shims" |
| 896 | default y |
| 897 | help |
| 898 | Suppress any warnings from the pre-processor when including |
| 899 | deprecated header files. |
| 900 | |
| 901 | endmenu |