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 | |
Pieter De Gendt | a2b866e6 | 2024-05-06 16:29:43 +0200 | [diff] [blame] | 319 | config LINKER_ITERABLE_SUBALIGN |
| 320 | int |
| 321 | default 8 if 64BIT |
| 322 | default 4 |
| 323 | help |
| 324 | Hidden option for the default subalignment of iterable sections. |
| 325 | |
Krzysztof Chruscinski | dfb3674 | 2022-04-22 11:36:05 +0200 | [diff] [blame] | 326 | config LINKER_DEVNULL_SUPPORT |
| 327 | bool |
| 328 | default y if CPU_CORTEX_M || (RISCV && !64BIT) |
| 329 | |
| 330 | config LINKER_DEVNULL_MEMORY |
| 331 | bool "Devnull region" |
| 332 | depends on LINKER_DEVNULL_SUPPORT |
| 333 | help |
| 334 | Devnull region is created. It is stripped from final binary but remains |
| 335 | in byproduct elf file. |
| 336 | |
| 337 | config LINKER_DEVNULL_MEMORY_SIZE |
| 338 | int "Devnull region size" |
| 339 | depends on LINKER_DEVNULL_MEMORY |
| 340 | default 262144 |
| 341 | help |
| 342 | Size can be adjusted so it fits all data placed in that region. |
| 343 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 344 | endmenu |
| 345 | |
| 346 | menu "Compiler Options" |
| 347 | |
Pieter De Gendt | 86b721c | 2024-04-03 09:32:10 +0200 | [diff] [blame] | 348 | config REQUIRES_STD_C99 |
| 349 | bool |
| 350 | help |
| 351 | Hidden option to select compiler support C99 standard or higher. |
| 352 | |
| 353 | config REQUIRES_STD_C11 |
| 354 | bool |
| 355 | select REQUIRES_STD_C99 |
| 356 | help |
| 357 | Hidden option to select compiler support C11 standard or higher. |
| 358 | |
| 359 | config REQUIRES_STD_C17 |
| 360 | bool |
| 361 | select REQUIRES_STD_C11 |
| 362 | help |
| 363 | Hidden option to select compiler support C17 standard or higher. |
| 364 | |
| 365 | config REQUIRES_STD_C23 |
| 366 | bool |
| 367 | select REQUIRES_STD_C17 |
| 368 | help |
| 369 | Hidden option to select compiler support C23 standard or higher. |
| 370 | |
| 371 | choice STD_C |
| 372 | prompt "C Standard" |
| 373 | default STD_C23 if REQUIRES_STD_C23 |
| 374 | default STD_C17 if REQUIRES_STD_C17 |
| 375 | default STD_C11 if REQUIRES_STD_C11 |
| 376 | default STD_C99 |
| 377 | help |
| 378 | C Standards. |
| 379 | |
| 380 | config STD_C90 |
| 381 | bool "C90" |
| 382 | depends on !REQUIRES_STD_C99 |
| 383 | help |
| 384 | 1989 C standard as completed in 1989 and ratified by ISO/IEC |
| 385 | as ISO/IEC 9899:1990. This version is known as "ANSI C". |
| 386 | |
| 387 | config STD_C99 |
| 388 | bool "C99" |
| 389 | depends on !REQUIRES_STD_C11 |
| 390 | help |
| 391 | 1999 C standard. |
| 392 | |
| 393 | config STD_C11 |
| 394 | bool "C11" |
| 395 | depends on !REQUIRES_STD_C17 |
| 396 | help |
| 397 | 2011 C standard. |
| 398 | |
| 399 | config STD_C17 |
| 400 | bool "C17" |
| 401 | depends on !REQUIRES_STD_C23 |
| 402 | help |
| 403 | 2017 C standard, addresses defects in C11 without introducing |
| 404 | new language features. |
| 405 | |
| 406 | config STD_C23 |
| 407 | bool "C23" |
| 408 | help |
| 409 | 2023 C standard. |
| 410 | |
| 411 | endchoice |
| 412 | |
Pieter De Gendt | a599ed1 | 2024-04-15 19:28:45 +0200 | [diff] [blame] | 413 | config TOOLCHAIN_SUPPORTS_GNU_EXTENSIONS |
| 414 | bool |
| 415 | default y if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr" |
| 416 | help |
| 417 | Hidden option to signal that toolchain supports GNU Extensions. |
| 418 | |
| 419 | config GNU_C_EXTENSIONS |
| 420 | bool "GNU C Extensions" |
| 421 | depends on TOOLCHAIN_SUPPORTS_GNU_EXTENSIONS |
| 422 | help |
| 423 | Enable GNU C Extensions. GNU C provides several language features |
| 424 | not found in ISO standard C. |
| 425 | |
Flavio Ceolin | b587e8d | 2020-08-26 09:48:33 -0700 | [diff] [blame] | 426 | config CODING_GUIDELINE_CHECK |
| 427 | bool "Enforce coding guideline rules" |
| 428 | help |
| 429 | Use available compiler flags to check coding guideline rules during |
| 430 | the build. |
| 431 | |
Keith Packard | be4b76f | 2023-10-12 11:55:04 -0700 | [diff] [blame] | 432 | config NATIVE_LIBC |
Alberto Escolar Piedras | 2eb14f1 | 2023-05-26 13:15:09 +0200 | [diff] [blame] | 433 | bool |
Keith Packard | 214a3c5 | 2023-02-08 13:44:39 -0800 | [diff] [blame] | 434 | select FULL_LIBC_SUPPORTED |
Keith Packard | be4b76f | 2023-10-12 11:55:04 -0700 | [diff] [blame] | 435 | help |
| 436 | Zephyr will use the host system C library. |
| 437 | |
| 438 | config NATIVE_LIBCPP |
| 439 | bool |
| 440 | select FULL_LIBCPP_SUPPORTED |
| 441 | help |
| 442 | Zephyr will use the host system C++ library |
| 443 | |
| 444 | config NATIVE_BUILD |
| 445 | bool |
| 446 | select NATIVE_LIBC if EXTERNAL_LIBC |
| 447 | select NATIVE_LIBCPP if EXTERNAL_LIBCPP |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 448 | help |
Alberto Escolar Piedras | 2eb14f1 | 2023-05-26 13:15:09 +0200 | [diff] [blame] | 449 | Zephyr will be built targeting the host system for debug and |
| 450 | development purposes. |
| 451 | |
| 452 | config NATIVE_APPLICATION |
| 453 | bool |
| 454 | default y if ARCH_POSIX |
| 455 | depends on !NATIVE_LIBRARY |
| 456 | select NATIVE_BUILD |
| 457 | help |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 458 | Build as a native application that can run on the host and using |
| 459 | resources and libraries provided by the host. |
| 460 | |
Alberto Escolar Piedras | 2eb14f1 | 2023-05-26 13:15:09 +0200 | [diff] [blame] | 461 | config NATIVE_LIBRARY |
| 462 | bool |
| 463 | select NATIVE_BUILD |
| 464 | help |
| 465 | Build as a prelinked library for the native host target. |
| 466 | This library can later be built into an executable for the host. |
| 467 | |
Keith Packard | 6c5d806 | 2023-02-08 14:56:50 -0800 | [diff] [blame] | 468 | config COMPILER_FREESTANDING |
| 469 | bool "Build in a freestanding compiler mode" |
| 470 | help |
| 471 | Configure the compiler to operate in freestanding mode according to |
| 472 | the C and C++ language specifications. Freestanding mode reduces the |
| 473 | requirements of the compiler and language environment, which can |
| 474 | negatively impact the ability for the compiler to detect errors and |
| 475 | perform optimizations. |
| 476 | |
Emil Lindqvist | f7dad07 | 2021-09-03 13:52:33 +0200 | [diff] [blame] | 477 | choice COMPILER_OPTIMIZATIONS |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 478 | prompt "Optimization level" |
| 479 | default NO_OPTIMIZATIONS if COVERAGE |
| 480 | default DEBUG_OPTIMIZATIONS if DEBUG |
| 481 | default SIZE_OPTIMIZATIONS |
| 482 | help |
| 483 | Note that these flags shall only control the compiler |
| 484 | optimization level, and that no extra debug code shall be |
| 485 | conditionally compiled based on them. |
| 486 | |
| 487 | config SIZE_OPTIMIZATIONS |
| 488 | bool "Optimize for size" |
| 489 | help |
| 490 | Compiler optimizations will be set to -Os independently of other |
| 491 | options. |
| 492 | |
| 493 | config SPEED_OPTIMIZATIONS |
| 494 | bool "Optimize for speed" |
| 495 | help |
| 496 | Compiler optimizations will be set to -O2 independently of other |
| 497 | options. |
| 498 | |
| 499 | config DEBUG_OPTIMIZATIONS |
| 500 | bool "Optimize debugging experience" |
| 501 | help |
| 502 | Compiler optimizations will be set to -Og independently of other |
| 503 | options. |
| 504 | |
| 505 | config NO_OPTIMIZATIONS |
| 506 | bool "Optimize nothing" |
| 507 | help |
| 508 | Compiler optimizations will be set to -O0 independently of other |
| 509 | options. |
Henrik Brix Andersen | 26ebcee | 2023-03-22 10:19:40 +0100 | [diff] [blame] | 510 | |
| 511 | Selecting this option will likely require manual tuning of the |
| 512 | default stack sizes in order to avoid stack overflows. |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 513 | endchoice |
| 514 | |
Radoslaw Koppel | 26c8776 | 2024-01-30 12:32:32 +0100 | [diff] [blame] | 515 | config LTO |
| 516 | bool "Link Time Optimization [EXPERIMENTAL]" |
Reto Schneider | 75a3805 | 2024-03-19 12:22:48 +0100 | [diff] [blame] | 517 | depends on !(GEN_ISR_TABLES || GEN_IRQ_VECTOR_TABLE) || ISR_TABLES_LOCAL_DECLARATION |
| 518 | depends on !NATIVE_LIBRARY |
| 519 | depends on !CODE_DATA_RELOCATION |
Radoslaw Koppel | 26c8776 | 2024-01-30 12:32:32 +0100 | [diff] [blame] | 520 | select EXPERIMENTAL |
| 521 | help |
| 522 | This option enables Link Time Optimization. |
| 523 | |
Nikolay Agishev | 0dec4cf | 2022-12-22 15:46:04 +0400 | [diff] [blame] | 524 | config COMPILER_WARNINGS_AS_ERRORS |
| 525 | bool "Treat warnings as errors" |
| 526 | help |
| 527 | Turn on "warning as error" toolchain flags |
| 528 | |
Fabio Baltieri | 3f8f713 | 2023-03-29 10:11:46 +0100 | [diff] [blame] | 529 | config COMPILER_SAVE_TEMPS |
| 530 | bool "Save temporary object files" |
| 531 | help |
| 532 | Instruct the compiler to save the temporary intermediate files |
| 533 | permanently. These can be useful for troubleshooting build issues. |
| 534 | |
Gerard Marull-Paretas | 99ebe39 | 2023-05-05 09:58:12 +0200 | [diff] [blame] | 535 | config COMPILER_TRACK_MACRO_EXPANSION |
| 536 | bool "Track macro expansion" |
| 537 | default y |
| 538 | help |
| 539 | When enabled, locations of tokens across macro expansions will be |
| 540 | tracked. Disabling this option may be useful to debug long macro |
| 541 | expansion chains. |
| 542 | |
Arvin Farahmand | e430b7b | 2021-04-15 11:20:10 -0400 | [diff] [blame] | 543 | config COMPILER_COLOR_DIAGNOSTICS |
Gerard Marull-Paretas | 95fb0de | 2022-03-09 12:05:12 +0100 | [diff] [blame] | 544 | bool "Colored diagnostics" |
Arvin Farahmand | e430b7b | 2021-04-15 11:20:10 -0400 | [diff] [blame] | 545 | default y |
| 546 | help |
| 547 | Compiler diagnostic messages are colorized. |
| 548 | |
Keith Packard | 62bc9bf | 2022-04-26 19:24:11 -0700 | [diff] [blame] | 549 | choice COMPILER_SECURITY_FORTIFY |
| 550 | prompt "Detect buffer overflows in libc calls" |
Alberto Escolar Piedras | 56dc20e | 2023-05-26 13:23:43 +0200 | [diff] [blame] | 551 | default FORTIFY_SOURCE_NONE if NO_OPTIMIZATIONS || MINIMAL_LIBC || NATIVE_BUILD |
Keith Packard | 62bc9bf | 2022-04-26 19:24:11 -0700 | [diff] [blame] | 552 | default FORTIFY_SOURCE_COMPILE_TIME |
| 553 | help |
| 554 | Buffer overflow checking in libc calls. Supported by Clang and |
| 555 | GCC when using Picolibc or Newlib. Requires compiler optimization |
| 556 | to be enabled. |
| 557 | |
| 558 | config FORTIFY_SOURCE_NONE |
| 559 | bool "No detection" |
| 560 | help |
| 561 | Disables both compile-time and run-time checking. |
| 562 | |
| 563 | config FORTIFY_SOURCE_COMPILE_TIME |
| 564 | bool "Compile-time detection" |
| 565 | help |
| 566 | Enables only compile-time checking. Compile-time checking |
| 567 | doesn't increase executable size or reduce performance, it |
| 568 | limits checking to what can be done with information available |
| 569 | at compile time. |
| 570 | |
| 571 | config FORTIFY_SOURCE_RUN_TIME |
| 572 | bool "Compile-time and run-time detection" |
| 573 | help |
| 574 | Enables both compile-time and run-time checking. Run-time |
| 575 | checking increases coverage at the expense of additional code, |
| 576 | and means that applications will raise a runtime exception |
| 577 | when buffer overflow is detected. |
| 578 | |
| 579 | endchoice |
| 580 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 581 | config COMPILER_OPT |
| 582 | string "Custom compiler options" |
| 583 | help |
| 584 | This option is a free-form string that is passed to the compiler |
| 585 | when building all parts of a project (i.e. kernel). |
| 586 | The compiler options specified by this string supplement the |
| 587 | predefined set of compiler supplied by the build system, |
| 588 | and can be used to change compiler optimization, warning and error |
| 589 | messages, and so on. |
| 590 | |
Martí Bolívar | e5cc854 | 2021-05-21 10:56:23 -0700 | [diff] [blame] | 591 | config MISRA_SANE |
| 592 | bool "MISRA standards compliance features" |
| 593 | help |
| 594 | Causes the source code to build in "MISRA" mode, which |
| 595 | disallows some otherwise-permitted features of the C |
| 596 | standard for safety reasons. Specifically variable length |
| 597 | arrays are not permitted (and gcc will enforce this). |
| 598 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 599 | endmenu |
| 600 | |
Anas Nashif | 22b95a2 | 2019-11-24 11:28:38 -0500 | [diff] [blame] | 601 | choice |
| 602 | prompt "Error checking behavior for CHECK macro" |
| 603 | default RUNTIME_ERROR_CHECKS |
| 604 | |
| 605 | config ASSERT_ON_ERRORS |
| 606 | bool "Assert on all errors" |
| 607 | help |
Henrik Brix Andersen | 8261a4b | 2024-04-16 19:03:45 +0000 | [diff] [blame] | 608 | Assert on errors covered with the CHECKIF() macro. |
Anas Nashif | 22b95a2 | 2019-11-24 11:28:38 -0500 | [diff] [blame] | 609 | |
| 610 | config NO_RUNTIME_CHECKS |
| 611 | bool "No runtime error checks" |
| 612 | help |
Henrik Brix Andersen | 8261a4b | 2024-04-16 19:03:45 +0000 | [diff] [blame] | 613 | Do not do any runtime checks or asserts when using the CHECKIF() macro. |
Anas Nashif | 22b95a2 | 2019-11-24 11:28:38 -0500 | [diff] [blame] | 614 | |
| 615 | config RUNTIME_ERROR_CHECKS |
Gerard Marull-Paretas | 95fb0de | 2022-03-09 12:05:12 +0100 | [diff] [blame] | 616 | bool "Runtime error checks" |
Anas Nashif | 22b95a2 | 2019-11-24 11:28:38 -0500 | [diff] [blame] | 617 | help |
Henrik Brix Andersen | 8261a4b | 2024-04-16 19:03:45 +0000 | [diff] [blame] | 618 | Always perform runtime checks covered with the CHECKIF() macro. This |
Anas Nashif | 22b95a2 | 2019-11-24 11:28:38 -0500 | [diff] [blame] | 619 | option is the default and the only option used during testing. |
| 620 | |
| 621 | endchoice |
| 622 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 623 | menu "Build Options" |
| 624 | |
| 625 | config KERNEL_BIN_NAME |
| 626 | string "The kernel binary name" |
| 627 | default "zephyr" |
| 628 | help |
| 629 | This option sets the name of the generated kernel binary. |
| 630 | |
| 631 | config OUTPUT_STAT |
| 632 | bool "Create a statistics file" |
| 633 | default y |
| 634 | help |
| 635 | Create a stat file using readelf -e <elf> |
| 636 | |
Anas Nashif | 47a673f | 2022-06-27 10:08:37 -0400 | [diff] [blame] | 637 | config OUTPUT_SYMBOLS |
| 638 | bool "Create a symbol file" |
| 639 | help |
| 640 | Create a symbol file using nm <elf> |
| 641 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 642 | config OUTPUT_DISASSEMBLY |
| 643 | bool "Create a disassembly file" |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 644 | help |
| 645 | Create an .lst file with the assembly listing of the firmware. |
| 646 | |
Rohit Gujarathi | 35713f2 | 2020-05-07 10:08:37 +0530 | [diff] [blame] | 647 | config OUTPUT_DISASSEMBLE_ALL |
| 648 | bool "Disassemble all sections with source. Fill zeros." |
| 649 | default n |
| 650 | depends on OUTPUT_DISASSEMBLY |
| 651 | help |
| 652 | The .lst file will contain complete disassembly of the firmware |
| 653 | not just those expected to contain instructions including zeros |
| 654 | |
Laurentiu Mihalcea | fb7e937 | 2024-04-16 11:26:01 +0300 | [diff] [blame] | 655 | config OUTPUT_DISASSEMBLY_WITH_SOURCE |
| 656 | bool "Include source code in output disassembly file" |
| 657 | default y |
| 658 | depends on OUTPUT_DISASSEMBLY && !OUTPUT_DISASSEMBLE_ALL |
| 659 | help |
| 660 | The .lst file will also contain the source code. Having |
| 661 | control over this can be useful for reproducible builds |
| 662 | since it can be used to remove one of the elements of |
| 663 | the .lst file that can vary across platforms because |
| 664 | of reasons such as having ".." include paths. |
| 665 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 666 | config OUTPUT_PRINT_MEMORY_USAGE |
| 667 | bool "Print memory usage to stdout" |
| 668 | default y |
| 669 | help |
| 670 | If the toolchain supports it, this option will pass |
| 671 | --print-memory-region to the linker when it is doing it's first |
| 672 | linker pass. Note that the memory regions are symbolic concepts |
| 673 | defined by the linker scripts and do not necessarily map |
| 674 | directly to the real physical address space. Take also note that |
| 675 | some platforms do two passes of the linker so the results do not |
| 676 | match exactly to the final elf file. See also rom_report, |
| 677 | ram_report and |
| 678 | https://sourceware.org/binutils/docs/ld/MEMORY.html |
| 679 | |
Anas Nashif | fdbf2db | 2020-10-20 14:31:56 -0400 | [diff] [blame] | 680 | config CLEANUP_INTERMEDIATE_FILES |
| 681 | bool "Remove all intermediate files" |
| 682 | help |
| 683 | Delete intermediate files to save space and cleanup clutter resulting |
Filip Kokosinski | 7388a07 | 2023-07-19 15:40:55 +0200 | [diff] [blame] | 684 | from the build process. Note this breaks incremental builds, west spdx |
| 685 | (Software Bill of Material generation), and maybe others. |
Anas Nashif | fdbf2db | 2020-10-20 14:31:56 -0400 | [diff] [blame] | 686 | |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 687 | config BUILD_NO_GAP_FILL |
| 688 | bool "Don't fill gaps in generated hex/bin/s19 files." |
| 689 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 690 | config BUILD_OUTPUT_HEX |
| 691 | bool "Build a binary in HEX format" |
| 692 | help |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 693 | Build an Intel HEX binary zephyr/zephyr.hex in the build directory. |
| 694 | 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] | 695 | |
| 696 | config BUILD_OUTPUT_BIN |
| 697 | bool "Build a binary in BIN format" |
| 698 | default y |
| 699 | help |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 700 | Build a "raw" binary zephyr/zephyr.bin in the build directory. |
| 701 | 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] | 702 | |
Anas Nashif | 51c34bb | 2021-01-26 06:58:30 -0500 | [diff] [blame] | 703 | config BUILD_OUTPUT_EFI |
| 704 | bool "Build as an EFI application" |
| 705 | default n |
| 706 | depends on X86_64 |
| 707 | help |
| 708 | Build as an EFI application. |
| 709 | |
| 710 | This works by creating a "zephyr.efi" EFI binary containing a zephyr |
| 711 | image extracted from a built zephyr.elf file. EFI applications are |
| 712 | relocatable, and cannot be placed at specific locations in memory. |
| 713 | Instead, the stub code will copy the embedded zephyr sections to the |
| 714 | appropriate locations at startup, clear any zero-filled (BSS, etc...) |
| 715 | areas, then jump into the 64 bit entry point. |
| 716 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 717 | config BUILD_OUTPUT_EXE |
| 718 | bool "Build a binary in ELF format with .exe extension" |
| 719 | help |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 720 | Build an ELF binary that can run in the host system at |
| 721 | zephyr/zephyr.exe in the build directory. |
| 722 | 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] | 723 | |
| 724 | config BUILD_OUTPUT_S19 |
| 725 | bool "Build a binary in S19 format" |
| 726 | help |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 727 | Build an S19 binary zephyr/zephyr.s19 in the build directory. |
| 728 | 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] | 729 | |
Pete Johanson | 310a464 | 2020-12-31 16:51:52 -0500 | [diff] [blame] | 730 | config BUILD_OUTPUT_UF2 |
| 731 | bool "Build a binary in UF2 format" |
| 732 | depends on BUILD_OUTPUT_BIN |
| 733 | help |
| 734 | Build a UF2 binary zephyr/zephyr.uf2 in the build directory. |
| 735 | The name of this file can be customized with CONFIG_KERNEL_BIN_NAME. |
| 736 | |
| 737 | if BUILD_OUTPUT_UF2 |
| 738 | |
| 739 | config BUILD_OUTPUT_UF2_FAMILY_ID |
Pete Johanson | ff01a00 | 2021-02-16 09:35:11 -0500 | [diff] [blame] | 740 | string "UF2 device family ID" |
Marek Matej | 6b57b3b | 2023-07-20 18:24:09 +0200 | [diff] [blame] | 741 | default "0x1c5f21b0" if SOC_SERIES_ESP32 |
Xudong Zheng | 8db9869 | 2022-03-22 12:15:50 -0400 | [diff] [blame] | 742 | default "0x621e937a" if SOC_NRF52833_QIAA |
Pete Johanson | ff01a00 | 2021-02-16 09:35:11 -0500 | [diff] [blame] | 743 | default "0xada52840" if SOC_NRF52840_QIAA |
Torsten Rasmussen | 8dc3f85 | 2022-09-14 22:23:15 +0200 | [diff] [blame] | 744 | default "0x4fb2d5bd" if SOC_SERIES_IMXRT10XX || SOC_SERIES_IMXRT11XX |
Pete Johanson | ff01a00 | 2021-02-16 09:35:11 -0500 | [diff] [blame] | 745 | default "0x2abc77ec" if SOC_SERIES_LPC55XXX |
Yonatan Schachter | efa170f | 2022-02-01 23:05:04 +0200 | [diff] [blame] | 746 | default "0xe48bff56" if SOC_SERIES_RP2XXX |
Pete Johanson | ff01a00 | 2021-02-16 09:35:11 -0500 | [diff] [blame] | 747 | default "0x68ed2b88" if SOC_SERIES_SAMD21 |
| 748 | default "0x55114460" if SOC_SERIES_SAMD51 |
| 749 | default "0x647824b6" if SOC_SERIES_STM32F0X |
| 750 | default "0x5d1a0a2e" if SOC_SERIES_STM32F2X |
| 751 | default "0x6b846188" if SOC_SERIES_STM32F3X |
| 752 | default "0x53b80f00" if SOC_SERIES_STM32F7X |
| 753 | default "0x300f5633" if SOC_SERIES_STM32G0X |
| 754 | default "0x4c71240a" if SOC_SERIES_STM32G4X |
| 755 | default "0x6db66082" if SOC_SERIES_STM32H7X |
| 756 | default "0x202e3a91" if SOC_SERIES_STM32L0X |
| 757 | default "0x1e1f432d" if SOC_SERIES_STM32L1X |
| 758 | default "0x00ff6919" if SOC_SERIES_STM32L4X |
| 759 | default "0x04240bdf" if SOC_SERIES_STM32L5X |
| 760 | default "0x70d16653" if SOC_SERIES_STM32WBX |
| 761 | default "0x5ee21072" if SOC_STM32F103XE |
Guillaume Gautier | 3d42322 | 2022-12-21 14:44:45 +0100 | [diff] [blame] | 762 | default "0x57755a57" if SOC_SERIES_STM32F4X && (!SOC_STM32F407XE) && (!SOC_STM32F407XG) |
Pete Johanson | ff01a00 | 2021-02-16 09:35:11 -0500 | [diff] [blame] | 763 | default "0x6d0922fa" if SOC_STM32F407XE |
| 764 | default "0x8fb060fe" if SOC_STM32F407XG |
Pete Johanson | 310a464 | 2020-12-31 16:51:52 -0500 | [diff] [blame] | 765 | help |
| 766 | UF2 bootloaders only accept UF2 files with a matching family ID. |
| 767 | 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] | 768 | name string. If the SoC in use is known by UF2, the Family ID will |
| 769 | be pre-filled with the known value. |
Pete Johanson | 310a464 | 2020-12-31 16:51:52 -0500 | [diff] [blame] | 770 | |
Peter Johanson | 3f33207 | 2022-01-27 00:45:27 -0500 | [diff] [blame] | 771 | config BUILD_OUTPUT_UF2_USE_FLASH_BASE |
| 772 | bool |
| 773 | default n |
| 774 | |
| 775 | config BUILD_OUTPUT_UF2_USE_FLASH_OFFSET |
| 776 | bool |
| 777 | default n |
| 778 | |
Pete Johanson | 310a464 | 2020-12-31 16:51:52 -0500 | [diff] [blame] | 779 | endif # BUILD_OUTPUT_UF2 |
| 780 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 781 | config BUILD_OUTPUT_STRIPPED |
| 782 | bool "Build a stripped binary" |
| 783 | help |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 784 | Build a stripped binary zephyr/zephyr.strip in the build directory. |
| 785 | 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] | 786 | |
Torsten Rasmussen | d51a67b | 2022-01-12 14:21:07 +0100 | [diff] [blame] | 787 | config BUILD_OUTPUT_ADJUST_LMA |
| 788 | string |
| 789 | help |
| 790 | This will adjust the LMA address in the final ELF and hex files with |
| 791 | the value provided. |
| 792 | This will not affect the internal address symbols inside the image but |
| 793 | can be useful when adjusting the LMA address for flash tools or multi |
| 794 | stage loaders where a pre-loader may copy image to a second location |
| 795 | before booting a second core. |
| 796 | The value will be evaluated as a math expression, this means that |
| 797 | following are valid expression |
| 798 | - 1024 |
| 799 | - 0x1000 |
| 800 | - -0x1000 |
| 801 | - 0x20000000 - 0x10000000 |
| 802 | Note: negative numbers are valid. |
| 803 | To adjust according to a chosen flash partition one can specify a |
| 804 | default as: |
| 805 | DT_CHOSEN_IMAGE_<name> := <name>,<name>-partition |
| 806 | DT_CHOSEN_Z_FLASH := zephyr,flash |
| 807 | config BUILD_OUTPUT_ADJUST_LMA |
| 808 | default "$(dt_chosen_reg_addr_hex,$(DT_CHOSEN_IMAGE_M4))-\ |
| 809 | $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))" |
| 810 | |
Torsten Rasmussen | c8ddc34 | 2022-01-10 11:02:26 +0100 | [diff] [blame] | 811 | config BUILD_OUTPUT_INFO_HEADER |
| 812 | bool "Create a image information header" |
| 813 | help |
| 814 | Create an image information header which will contain image |
| 815 | information from the Zephyr binary. |
| 816 | Example of information contained in the header file: |
| 817 | - Number of segments in the image |
| 818 | - LMA address of each segment |
| 819 | - VMA address of each segment |
| 820 | - Size of each segment |
| 821 | |
Daniel DeGrasse | d8bdddd | 2023-07-28 19:47:45 +0000 | [diff] [blame] | 822 | config BUILD_ALIGN_LMA |
| 823 | bool "Align LMA in output image" |
| 824 | default y if BUILD_OUTPUT_ADJUST_LMA!="" |
| 825 | help |
| 826 | Ensure that the LMA for each section in the output image respects |
| 827 | the alignment requirements of that section. This is required for |
| 828 | some tooling, such as objcopy, to be able to adjust the LMA of the |
| 829 | ELF file. |
| 830 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 831 | config APPLICATION_DEFINED_SYSCALL |
| 832 | bool "Scan application folder for any syscall definition" |
| 833 | help |
| 834 | Scan additional folders inside application source folder |
| 835 | for application defined syscalls. |
| 836 | |
Sebastian Bøe | d3a8fd4 | 2019-10-17 14:25:34 +0200 | [diff] [blame] | 837 | config MAKEFILE_EXPORTS |
| 838 | bool "Generate build metadata files named Makefile.exports" |
| 839 | help |
| 840 | Generates a file with build information that can be read by |
| 841 | third party Makefile-based build systems. |
| 842 | |
Torsten Rasmussen | fffaf05 | 2021-10-12 23:08:36 +0200 | [diff] [blame] | 843 | config BUILD_OUTPUT_META |
| 844 | bool "Create a build meta file" |
| 845 | help |
| 846 | Create a build meta file in the build directory containing lists of: |
| 847 | - Zephyr: path and revision (if git repo) |
| 848 | - Zephyr modules: name, path, and revision (if git repo) |
Torsten Rasmussen | 64ec6ee | 2021-11-04 14:28:21 +0100 | [diff] [blame] | 849 | - West: |
| 850 | - manifest: path and revision |
| 851 | - projects: path and revision |
| 852 | - Workspace: |
| 853 | - dirty: one or more repositories are marked dirty |
| 854 | - extra: extra Zephyr modules are manually included in the build |
| 855 | - off: the SHA of one or more west projects are not what the manifest |
| 856 | defined when `west update` was run the last time (`manifest-rev`). |
| 857 | The off state is only present if a west workspace is found. |
Torsten Rasmussen | fffaf05 | 2021-10-12 23:08:36 +0200 | [diff] [blame] | 858 | File extension is .meta |
| 859 | |
Torsten Rasmussen | 1a51993 | 2021-11-04 18:35:50 +0100 | [diff] [blame] | 860 | config BUILD_OUTPUT_META_STATE_PROPAGATE |
| 861 | bool "Propagate module and project state" |
| 862 | depends on BUILD_OUTPUT_META |
| 863 | help |
| 864 | Propagate to state of each module to the Zephyr revision field. |
| 865 | If west is used the state of each west project is also propagated to |
| 866 | the Zephyr revision field. |
| 867 | West manifest repo revision field will also |
| 868 | be marked with the same state as the Zephyr revision. |
| 869 | The final revision will become: <SHA>-<state1>-<state2>-<state3>... |
| 870 | If no states are appended to the SHA it means the build is of a clean |
| 871 | tree. |
| 872 | - dirty: one or more repositories are marked dirty |
| 873 | - extra: extra Zephyr modules are manually included in the build |
| 874 | - off: the SHA of one or more west projects are not what the manifest |
| 875 | defined when `west update` was run the last time (`manifest-rev`). |
| 876 | The off state is only present if a west workspace is found. |
| 877 | |
Martin Jäger | a0ffaa7 | 2023-03-29 16:06:30 +0200 | [diff] [blame] | 878 | config BUILD_OUTPUT_STRIP_PATHS |
| 879 | bool "Strip absolute paths from binaries" |
| 880 | default y |
| 881 | help |
| 882 | If the compiler supports it, strip the ${ZEPHYR_BASE} prefix from the |
| 883 | __FILE__ macro used in __ASSERT*, in the |
| 884 | .noinit."/home/joe/zephyr/fu/bar.c" section names and in any |
| 885 | application code. |
| 886 | This saves some memory, stops leaking user locations in binaries, makes |
| 887 | failure logs more deterministic and most importantly makes builds more |
| 888 | deterministic. |
| 889 | Debuggers usually have a path mapping feature to ensure the files are |
| 890 | still found. |
| 891 | |
Fabio Baltieri | 2264c14 | 2023-03-09 17:29:54 +0000 | [diff] [blame] | 892 | config CHECK_INIT_PRIORITIES |
| 893 | bool "Build time initialization priorities check" |
Fabio Baltieri | 058f256 | 2023-03-10 17:26:35 +0000 | [diff] [blame] | 894 | default y |
Alberto Escolar Piedras | 9bb708e | 2023-11-23 15:27:09 +0100 | [diff] [blame] | 895 | # If we are building a native_simulator target, we can only check the init priorities |
| 896 | # if we are building the final output but we are not assembling several images together |
| 897 | depends on !(NATIVE_LIBRARY && (!BUILD_OUTPUT_EXE || NATIVE_SIMULATOR_EXTRA_IMAGE_PATHS != "")) |
Fabio Baltieri | 4a556a9 | 2023-09-18 11:35:35 +0000 | [diff] [blame] | 898 | depends on "$(ZEPHYR_TOOLCHAIN_VARIANT)" != "armclang" |
Fabio Baltieri | 2264c14 | 2023-03-09 17:29:54 +0000 | [diff] [blame] | 899 | help |
| 900 | Check the build for initialization priority issues by comparing the |
| 901 | initialization priority in the build with the device dependency |
| 902 | derived from the devicetree definition. |
| 903 | |
| 904 | Fails the build on priority errors (dependent devices, inverted |
Fabio Baltieri | 2a70c31 | 2023-10-27 09:27:48 +0000 | [diff] [blame] | 905 | priority). |
Fabio Baltieri | 2264c14 | 2023-03-09 17:29:54 +0000 | [diff] [blame] | 906 | |
Daniel Leung | 80e7820 | 2023-05-25 11:41:48 -0700 | [diff] [blame] | 907 | config EMIT_ALL_SYSCALLS |
| 908 | bool "Emit all possible syscalls in the tree" |
| 909 | help |
| 910 | This tells the build system to emit all possible syscalls found |
| 911 | in the tree, instead of only those syscalls associated with enabled |
| 912 | drivers and subsystems. |
| 913 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 914 | endmenu |
Torsten Rasmussen | 1c91129 | 2021-03-22 14:29:38 +0100 | [diff] [blame] | 915 | |
Torsten Rasmussen | 6066ab4 | 2022-07-15 12:05:04 +0200 | [diff] [blame] | 916 | config DEPRECATED |
| 917 | bool |
| 918 | help |
| 919 | Symbol that must be selected by a feature or module if it is |
| 920 | considered to be deprecated. |
| 921 | |
| 922 | config WARN_DEPRECATED |
| 923 | bool |
| 924 | default y |
| 925 | prompt "Warn on deprecated usage" |
| 926 | help |
| 927 | Print a warning when the Kconfig tree is parsed if any deprecated |
| 928 | features are enabled. |
| 929 | |
Torsten Rasmussen | 1c91129 | 2021-03-22 14:29:38 +0100 | [diff] [blame] | 930 | config EXPERIMENTAL |
| 931 | bool |
| 932 | help |
| 933 | Symbol that must be selected by a feature if it is considered to be |
| 934 | at an experimental implementation stage. |
| 935 | |
| 936 | config WARN_EXPERIMENTAL |
| 937 | bool |
| 938 | prompt "Warn on experimental usage" |
| 939 | help |
| 940 | Print a warning when the Kconfig tree is parsed if any experimental |
| 941 | features are enabled. |
| 942 | |
Carles Cufi | d800ccc | 2022-08-22 18:38:16 +0200 | [diff] [blame] | 943 | config TAINT |
| 944 | bool |
| 945 | help |
| 946 | Symbol that must be selected by a feature or module if the Zephyr |
| 947 | build is considered tainted. |
| 948 | |
Nicolas Pitre | 0a386db | 2022-06-20 13:18:14 -0400 | [diff] [blame] | 949 | config ENFORCE_ZEPHYR_STDINT |
| 950 | bool |
| 951 | prompt "Enforce Zephyr convention for stdint" |
| 952 | depends on !ARCH_POSIX |
| 953 | default y |
| 954 | help |
| 955 | This enforces the Zephyr stdint convention where int32_t = int, |
| 956 | int64_t = long long, and intptr_t = long so that short string |
| 957 | format length modifiers can be used universally across ILP32 |
| 958 | and LP64 architectures. Sometimes this is not possible e.g. when |
| 959 | linking against a binary-only C++ library whose type mangling |
| 960 | is incompatible with the Zephyr convention, or if the build |
| 961 | environment doesn't allow such enforcement, in which case this |
| 962 | should be turned off with the caveat that argument type validation |
| 963 | on Zephyr code will be skipped. |
| 964 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 965 | endmenu |
| 966 | |
| 967 | |
| 968 | menu "Boot Options" |
| 969 | |
| 970 | config IS_BOOTLOADER |
| 971 | bool "Act as a bootloader" |
| 972 | depends on XIP |
| 973 | depends on ARM |
| 974 | help |
| 975 | This option indicates that Zephyr will act as a bootloader to execute |
| 976 | a separate Zephyr image payload. |
| 977 | |
| 978 | config BOOTLOADER_SRAM_SIZE |
Jamie McCrae | d548a7f | 2023-11-14 07:50:48 +0000 | [diff] [blame] | 979 | int "SRAM reserved for bootloader [DEPRECATED]" |
Kevin Townsend | f68cee9 | 2023-07-14 00:47:55 +0200 | [diff] [blame] | 980 | default 0 |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 981 | depends on !XIP || IS_BOOTLOADER |
Rajavardhan Gundi | e584b05 | 2018-12-14 16:55:43 +0530 | [diff] [blame] | 982 | depends on ARM || XTENSA |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 983 | help |
| 984 | This option specifies the amount of SRAM (measure in kB) reserved for |
| 985 | a bootloader image, when either: |
| 986 | - the Zephyr image itself is to act as the bootloader, or |
| 987 | - Zephyr is a !XIP image, which implicitly assumes existence of a |
| 988 | bootloader that loads the Zephyr !XIP image onto SRAM. |
| 989 | |
Jamie McCrae | d548a7f | 2023-11-14 07:50:48 +0000 | [diff] [blame] | 990 | This option is deprecated, users should transition to using DTS to set this, if needed. |
| 991 | To be removed after Zephyr 3.7 release. |
| 992 | |
| 993 | config BOOTLOADER_SRAM_SIZE_DEPRECATED |
| 994 | bool |
| 995 | default y |
| 996 | select DEPRECATED |
| 997 | depends on BOOTLOADER_SRAM_SIZE != 0 |
| 998 | depends on !XIP || IS_BOOTLOADER |
| 999 | depends on ARM || XTENSA |
| 1000 | help |
| 1001 | Non-prompt symbol to indicate that the deprecated BOOTLOADER_SRAM_SIZE Kconfig has a |
| 1002 | non-0 value. Please transition to using devicetree. |
| 1003 | |
Michael Hope | 8c1f186 | 2020-06-13 21:32:11 +0200 | [diff] [blame] | 1004 | config BOOTLOADER_BOSSA |
| 1005 | bool "BOSSA bootloader support" |
| 1006 | select USE_DT_CODE_PARTITION |
Michael Hope | 8c1f186 | 2020-06-13 21:32:11 +0200 | [diff] [blame] | 1007 | |
| 1008 | help |
| 1009 | Signifies that the target uses a BOSSA compatible bootloader. If CDC |
| 1010 | ACM USB support is also enabled then the board will reboot into the |
| 1011 | bootloader automatically when bossac is run. |
| 1012 | |
| 1013 | config BOOTLOADER_BOSSA_DEVICE_NAME |
| 1014 | string "BOSSA CDC ACM device name" |
| 1015 | depends on BOOTLOADER_BOSSA && CDC_ACM_DTE_RATE_CALLBACK_SUPPORT |
| 1016 | default "CDC_ACM_0" |
| 1017 | help |
| 1018 | Sets the CDC ACM port to watch for reboot commands. |
| 1019 | |
| 1020 | choice |
| 1021 | prompt "BOSSA bootloader variant" |
| 1022 | depends on BOOTLOADER_BOSSA |
| 1023 | |
Gerson Fernando Budke | f3a7f04 | 2021-05-06 21:20:11 -0300 | [diff] [blame] | 1024 | config BOOTLOADER_BOSSA_LEGACY |
| 1025 | bool "Legacy" |
| 1026 | help |
| 1027 | Select the Legacy variant of the BOSSA bootloader. This is defined |
| 1028 | for compatibility mode only. The recommendation is use newer |
| 1029 | versions like Arduino or Adafruit UF2. |
| 1030 | |
Michael Hope | 8c1f186 | 2020-06-13 21:32:11 +0200 | [diff] [blame] | 1031 | config BOOTLOADER_BOSSA_ARDUINO |
| 1032 | bool "Arduino" |
| 1033 | help |
| 1034 | Select the Arduino variant of the BOSSA bootloader. Uses 0x07738135 |
| 1035 | as the magic value to enter the bootloader. |
| 1036 | |
| 1037 | config BOOTLOADER_BOSSA_ADAFRUIT_UF2 |
| 1038 | bool "Adafruit UF2" |
| 1039 | help |
| 1040 | Select the Adafruit UF2 variant of the BOSSA bootloader. Uses |
| 1041 | 0xf01669ef as the magic value to enter the bootloader. |
| 1042 | |
| 1043 | endchoice |
| 1044 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 1045 | endmenu |