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