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