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" |
Ulf Magnusson | ec3eff5 | 2018-07-30 10:57:47 +0200 | [diff] [blame] | 30 | |
Ioannis Glaropoulos | c520385 | 2020-12-07 18:42:52 +0100 | [diff] [blame] | 31 | menu "Modules" |
| 32 | |
Ioannis Glaropoulos | c520385 | 2020-12-07 18:42:52 +0100 | [diff] [blame] | 33 | source "modules/Kconfig" |
| 34 | |
| 35 | endmenu |
| 36 | |
Anas Nashif | abcf2ad | 2018-09-04 08:32:07 -0500 | [diff] [blame] | 37 | source "boards/Kconfig" |
Torsten Rasmussen | 5f7cc8d | 2020-07-06 12:53:39 +0200 | [diff] [blame] | 38 | source "soc/Kconfig" |
Anas Nashif | 77ba3c3 | 2015-10-09 06:20:52 -0400 | [diff] [blame] | 39 | source "arch/Kconfig" |
Anas Nashif | 77ba3c3 | 2015-10-09 06:20:52 -0400 | [diff] [blame] | 40 | source "kernel/Kconfig" |
Anas Nashif | c6ba67f | 2017-08-03 07:47:44 -0400 | [diff] [blame] | 41 | source "dts/Kconfig" |
Anas Nashif | 77ba3c3 | 2015-10-09 06:20:52 -0400 | [diff] [blame] | 42 | source "drivers/Kconfig" |
Anas Nashif | 0b2c44a | 2016-05-14 23:10:51 -0400 | [diff] [blame] | 43 | source "lib/Kconfig" |
Ramesh Thomas | e354ad2 | 2016-10-29 04:10:36 -0700 | [diff] [blame] | 44 | source "subsys/Kconfig" |
Kumar Gala | 7584a12 | 2016-05-24 14:23:26 -0500 | [diff] [blame] | 45 | |
Kumar Gala | 2630fba | 2020-01-24 09:39:40 -0600 | [diff] [blame] | 46 | osource "$(TOOLCHAIN_KCONFIG_DIR)/Kconfig" |
Anas Nashif | 8017c59 | 2019-05-23 17:19:41 -0400 | [diff] [blame] | 47 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 48 | menu "Build and Link Features" |
| 49 | |
| 50 | menu "Linker Options" |
| 51 | |
Daniel Leung | 6600c64 | 2018-10-19 10:15:19 -0700 | [diff] [blame] | 52 | choice |
| 53 | prompt "Linker Orphan Section Handling" |
| 54 | default LINKER_ORPHAN_SECTION_WARN |
| 55 | |
| 56 | config LINKER_ORPHAN_SECTION_PLACE |
| 57 | bool "Place" |
| 58 | help |
| 59 | Linker puts orphan sections in place without warnings |
| 60 | or errors. |
| 61 | |
| 62 | config LINKER_ORPHAN_SECTION_WARN |
| 63 | bool "Warn" |
| 64 | help |
Anas Nashif | f2cb20c | 2019-06-18 14:45:40 -0400 | [diff] [blame] | 65 | Linker places the orphan sections in output and issues |
Daniel Leung | 6600c64 | 2018-10-19 10:15:19 -0700 | [diff] [blame] | 66 | warning about those sections. |
| 67 | |
| 68 | config LINKER_ORPHAN_SECTION_ERROR |
| 69 | bool "Error" |
| 70 | help |
| 71 | Linker exits with error when an orphan section is found. |
| 72 | |
| 73 | endchoice |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 74 | |
| 75 | config HAS_FLASH_LOAD_OFFSET |
| 76 | bool |
| 77 | help |
| 78 | This option is selected by targets having a FLASH_LOAD_OFFSET |
| 79 | and FLASH_LOAD_SIZE. |
| 80 | |
Ulf Magnusson | fd9981a | 2019-11-16 01:33:09 +0100 | [diff] [blame] | 81 | if HAS_FLASH_LOAD_OFFSET |
| 82 | |
Ulf Magnusson | 90b9eb3 | 2019-11-16 01:22:16 +0100 | [diff] [blame] | 83 | config USE_DT_CODE_PARTITION |
Ulf Magnusson | 1f9c5f1 | 2019-11-16 01:16:57 +0100 | [diff] [blame] | 84 | bool "Link application into /chosen/zephyr,code-partition from devicetree" |
Andrzej Puzdrowski | 2b1227f | 2019-03-18 14:02:11 +0100 | [diff] [blame] | 85 | help |
Ulf Magnusson | 1f9c5f1 | 2019-11-16 01:16:57 +0100 | [diff] [blame] | 86 | When enabled, the application will be linked into the flash partition |
| 87 | selected by the zephyr,code-partition property in /chosen in devicetree. |
| 88 | When this is disabled, the flash load offset and size can be set manually |
| 89 | below. |
Andrzej Puzdrowski | 2b1227f | 2019-03-18 14:02:11 +0100 | [diff] [blame] | 90 | |
Kumar Gala | 8ce0cf0 | 2019-08-28 09:29:26 -0500 | [diff] [blame] | 91 | # Workaround for not being able to have commas in macro arguments |
| 92 | DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition |
| 93 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 94 | config FLASH_LOAD_OFFSET |
Ulf Magnusson | 90b9eb3 | 2019-11-16 01:22:16 +0100 | [diff] [blame] | 95 | # Only user-configurable when USE_DT_CODE_PARTITION is disabled |
| 96 | hex "Kernel load offset" if !USE_DT_CODE_PARTITION |
| 97 | 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] | 98 | default 0 |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 99 | help |
| 100 | This option specifies the byte offset from the beginning of flash that |
| 101 | the kernel should be loaded into. Changing this value from zero will |
| 102 | affect the Zephyr image's link, and will decrease the total amount of |
| 103 | flash available for use by application code. |
| 104 | |
| 105 | If unsure, leave at the default value 0. |
| 106 | |
| 107 | config FLASH_LOAD_SIZE |
Ulf Magnusson | 90b9eb3 | 2019-11-16 01:22:16 +0100 | [diff] [blame] | 108 | # Only user-configurable when USE_DT_CODE_PARTITION is disabled |
| 109 | hex "Kernel load size" if !USE_DT_CODE_PARTITION |
| 110 | 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] | 111 | default 0 |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 112 | help |
| 113 | If non-zero, this option specifies the size, in bytes, of the flash |
| 114 | area that the Zephyr image will be allowed to occupy. If zero, the |
| 115 | image will be able to occupy from the FLASH_LOAD_OFFSET to the end of |
| 116 | the device. |
| 117 | |
| 118 | If unsure, leave at the default value 0. |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 119 | |
Ulf Magnusson | fd9981a | 2019-11-16 01:33:09 +0100 | [diff] [blame] | 120 | endif # HAS_FLASH_LOAD_OFFSET |
| 121 | |
Stephanos Ioannidis | 3322489 | 2020-02-10 16:37:24 +0900 | [diff] [blame] | 122 | config ROM_START_OFFSET |
Ole Sæther | 985446a | 2019-01-23 14:13:03 +0100 | [diff] [blame] | 123 | hex |
Stephanos Ioannidis | 3322489 | 2020-02-10 16:37:24 +0900 | [diff] [blame] | 124 | prompt "ROM start offset" if !BOOTLOADER_MCUBOOT |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 125 | default 0x200 if BOOTLOADER_MCUBOOT |
| 126 | default 0 |
| 127 | help |
| 128 | If the application is built for chain-loading by a bootloader this |
| 129 | variable is required to be set to value that leaves sufficient |
Stephanos Ioannidis | 3322489 | 2020-02-10 16:37:24 +0900 | [diff] [blame] | 130 | 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] | 131 | section to store an image header or any other metadata. |
| 132 | In the particular case of the MCUboot bootloader this reserves enough |
| 133 | space to store the image header, which should also meet vector table |
| 134 | alignment requirements on most ARM targets, although some targets |
| 135 | may require smaller or larger values. |
| 136 | |
Torsten Rasmussen | 761eada | 2021-06-09 11:22:07 +0200 | [diff] [blame] | 137 | config LD_LINKER_SCRIPT_SUPPORTED |
| 138 | bool |
| 139 | default y |
| 140 | |
| 141 | choice LINKER_SCRIPT |
| 142 | prompt "Linker script" |
| 143 | default LD_LINKER_TEMPLATE if LD_LINKER_SCRIPT_SUPPORTED |
| 144 | |
| 145 | config LD_LINKER_TEMPLATE |
| 146 | bool "LD template" |
| 147 | depends on LD_LINKER_SCRIPT_SUPPORTED |
| 148 | help |
| 149 | Select this option to use the LD linker script templates. |
| 150 | The templates are pre-processed by the C pre-processor to create the |
| 151 | final LD linker script. |
| 152 | |
| 153 | config CMAKE_LINKER_GENERATOR |
| 154 | bool "CMake generator" |
| 155 | depends on ARM |
| 156 | help |
| 157 | Select this option to use the Zephyr CMake linker script generator. |
| 158 | The linker configuration is written in CMake and the final linker |
| 159 | script will be generated by the toolchain specific linker generator. |
| 160 | For LD based linkers, this will be the ld generator, for ARMClang / |
| 161 | armlink based linkers it will be the scatter generator. |
| 162 | |
| 163 | endchoice |
| 164 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 165 | config HAVE_CUSTOM_LINKER_SCRIPT |
Torsten Rasmussen | 761eada | 2021-06-09 11:22:07 +0200 | [diff] [blame] | 166 | bool "Custom linker script provided" |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 167 | help |
| 168 | Set this option if you have a custom linker script which needed to |
| 169 | be define in CUSTOM_LINKER_SCRIPT. |
| 170 | |
| 171 | config CUSTOM_LINKER_SCRIPT |
| 172 | string "Path to custom linker script" |
| 173 | depends on HAVE_CUSTOM_LINKER_SCRIPT |
| 174 | help |
| 175 | Path to the linker script to be used instead of the one define by the |
| 176 | board. |
| 177 | |
| 178 | The linker script must be based on a version provided by Zephyr since |
| 179 | the kernel can expect a certain layout/certain regions. |
| 180 | |
| 181 | This is useful when an application needs to add sections into the |
| 182 | linker script and avoid having to change the script provided by |
| 183 | Zephyr. |
| 184 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 185 | config KERNEL_ENTRY |
| 186 | string "Kernel entry symbol" |
| 187 | default "__start" |
| 188 | help |
| 189 | Code entry symbol, to be set at linking phase. |
| 190 | |
Sebastian Bøe | 3a0597f | 2019-03-15 14:05:09 +0100 | [diff] [blame] | 191 | config LINKER_SORT_BY_ALIGNMENT |
| 192 | bool "Sort input sections by alignment" |
| 193 | default y |
| 194 | help |
| 195 | This turns on the linker flag to sort sections by alignment |
| 196 | in decreasing size of symbols. This helps to minimize |
| 197 | padding between symbols. |
| 198 | |
Jordan Yates | 318ee97 | 2021-04-17 20:04:33 +1000 | [diff] [blame] | 199 | config SRAM_VECTOR_TABLE |
| 200 | bool "Place the vector table in SRAM instead of flash" |
| 201 | help |
| 202 | The option specifies that the vector table should be placed at the |
| 203 | start of SRAM instead of the start of flash. |
| 204 | |
Daniel Leung | ece9cad | 2021-02-20 11:02:17 -0800 | [diff] [blame] | 205 | config HAS_SRAM_OFFSET |
| 206 | bool |
| 207 | help |
| 208 | This option is selected by targets that require SRAM_OFFSET. |
| 209 | |
| 210 | config SRAM_OFFSET |
| 211 | hex "Kernel SRAM offset" if HAS_SRAM_OFFSET |
| 212 | default 0 |
| 213 | help |
| 214 | This option specifies the byte offset from the beginning of SRAM |
| 215 | where the kernel begins. Changing this value from zero will affect |
| 216 | the Zephyr image's link, and will decrease the total amount of |
| 217 | SRAM available for use by application code. |
| 218 | |
| 219 | If unsure, leave at the default value 0. |
| 220 | |
Daniel Leung | d812728 | 2021-02-24 10:18:34 -0800 | [diff] [blame] | 221 | menu "Linker Sections" |
| 222 | |
| 223 | config LINKER_USE_BOOT_SECTION |
| 224 | bool "Enable Usage of Boot Linker Section" |
| 225 | help |
| 226 | If enabled, the symbols which are needed for the boot process |
| 227 | will be put into another linker section reserved for these |
| 228 | symbols. |
| 229 | |
| 230 | Requires that boot sections exist in the architecture, SoC, |
| 231 | board or custom linker script. |
| 232 | |
Daniel Leung | 1310ad6 | 2021-02-23 13:33:38 -0800 | [diff] [blame] | 233 | config LINKER_USE_PINNED_SECTION |
| 234 | bool "Enable Usage of Pinned Linker Section" |
| 235 | help |
| 236 | If enabled, the symbols which need to be pinned in memory |
| 237 | will be put into another linker section reserved for pinned |
| 238 | symbols. During boot, the corresponding memory will be marked |
| 239 | as pinned. |
| 240 | |
| 241 | Requires that pinned sections exist in the architecture, SoC, |
| 242 | board or custom linker script. |
| 243 | |
Daniel Leung | 6a006d7 | 2021-07-12 10:58:45 -0700 | [diff] [blame] | 244 | config LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT |
| 245 | bool "Generic sections are present at boot" if DEMAND_PAGING && LINKER_USE_PINNED_SECTION |
| 246 | default y |
| 247 | help |
| 248 | When disabled, the linker sections other than the boot and |
| 249 | pinned sections will be marked as not present in the page |
| 250 | tables. This allows kernel to pull in data pages on demand |
| 251 | as required by current execution context when demand paging |
| 252 | is enabled. There is no need to load all code and data into |
| 253 | memory at once. |
| 254 | |
| 255 | If unsure, say Y. |
| 256 | |
Daniel Leung | d812728 | 2021-02-24 10:18:34 -0800 | [diff] [blame] | 257 | endmenu # "Linker Sections" |
| 258 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 259 | endmenu |
| 260 | |
| 261 | menu "Compiler Options" |
| 262 | |
Flavio Ceolin | b587e8d | 2020-08-26 09:48:33 -0700 | [diff] [blame] | 263 | config CODING_GUIDELINE_CHECK |
| 264 | bool "Enforce coding guideline rules" |
| 265 | help |
| 266 | Use available compiler flags to check coding guideline rules during |
| 267 | the build. |
| 268 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 269 | config NATIVE_APPLICATION |
| 270 | bool "Build as a native host application" |
| 271 | help |
| 272 | Build as a native application that can run on the host and using |
| 273 | resources and libraries provided by the host. |
| 274 | |
Emil Lindqvist | f7dad07 | 2021-09-03 13:52:33 +0200 | [diff] [blame] | 275 | choice COMPILER_OPTIMIZATIONS |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 276 | prompt "Optimization level" |
| 277 | default NO_OPTIMIZATIONS if COVERAGE |
| 278 | default DEBUG_OPTIMIZATIONS if DEBUG |
| 279 | default SIZE_OPTIMIZATIONS |
| 280 | help |
| 281 | Note that these flags shall only control the compiler |
| 282 | optimization level, and that no extra debug code shall be |
| 283 | conditionally compiled based on them. |
| 284 | |
| 285 | config SIZE_OPTIMIZATIONS |
| 286 | bool "Optimize for size" |
| 287 | help |
| 288 | Compiler optimizations will be set to -Os independently of other |
| 289 | options. |
| 290 | |
| 291 | config SPEED_OPTIMIZATIONS |
| 292 | bool "Optimize for speed" |
| 293 | help |
| 294 | Compiler optimizations will be set to -O2 independently of other |
| 295 | options. |
| 296 | |
| 297 | config DEBUG_OPTIMIZATIONS |
| 298 | bool "Optimize debugging experience" |
| 299 | help |
| 300 | Compiler optimizations will be set to -Og independently of other |
| 301 | options. |
| 302 | |
| 303 | config NO_OPTIMIZATIONS |
| 304 | bool "Optimize nothing" |
| 305 | help |
| 306 | Compiler optimizations will be set to -O0 independently of other |
| 307 | options. |
| 308 | |
| 309 | endchoice |
| 310 | |
Arvin Farahmand | e430b7b | 2021-04-15 11:20:10 -0400 | [diff] [blame] | 311 | config COMPILER_COLOR_DIAGNOSTICS |
| 312 | bool "Enable colored diganostics" |
| 313 | default y |
| 314 | help |
| 315 | Compiler diagnostic messages are colorized. |
| 316 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 317 | config COMPILER_OPT |
| 318 | string "Custom compiler options" |
| 319 | help |
| 320 | This option is a free-form string that is passed to the compiler |
| 321 | when building all parts of a project (i.e. kernel). |
| 322 | The compiler options specified by this string supplement the |
| 323 | predefined set of compiler supplied by the build system, |
| 324 | and can be used to change compiler optimization, warning and error |
| 325 | messages, and so on. |
| 326 | |
Martí Bolívar | e5cc854 | 2021-05-21 10:56:23 -0700 | [diff] [blame] | 327 | config MISRA_SANE |
| 328 | bool "MISRA standards compliance features" |
| 329 | help |
| 330 | Causes the source code to build in "MISRA" mode, which |
| 331 | disallows some otherwise-permitted features of the C |
| 332 | standard for safety reasons. Specifically variable length |
| 333 | arrays are not permitted (and gcc will enforce this). |
| 334 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 335 | endmenu |
| 336 | |
Anas Nashif | 22b95a2 | 2019-11-24 11:28:38 -0500 | [diff] [blame] | 337 | choice |
| 338 | prompt "Error checking behavior for CHECK macro" |
| 339 | default RUNTIME_ERROR_CHECKS |
| 340 | |
| 341 | config ASSERT_ON_ERRORS |
| 342 | bool "Assert on all errors" |
| 343 | help |
| 344 | Assert on errors covered with the CHECK macro. |
| 345 | |
| 346 | config NO_RUNTIME_CHECKS |
| 347 | bool "No runtime error checks" |
| 348 | help |
| 349 | Do not do any runtime checks or asserts when using the CHECK macro. |
| 350 | |
| 351 | config RUNTIME_ERROR_CHECKS |
| 352 | bool "Enable runtime error checks" |
| 353 | help |
| 354 | Always perform runtime checks covered with the CHECK macro. This |
| 355 | option is the default and the only option used during testing. |
| 356 | |
| 357 | endchoice |
| 358 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 359 | menu "Build Options" |
| 360 | |
| 361 | config KERNEL_BIN_NAME |
| 362 | string "The kernel binary name" |
| 363 | default "zephyr" |
| 364 | help |
| 365 | This option sets the name of the generated kernel binary. |
| 366 | |
| 367 | config OUTPUT_STAT |
| 368 | bool "Create a statistics file" |
| 369 | default y |
| 370 | help |
| 371 | Create a stat file using readelf -e <elf> |
| 372 | |
| 373 | config OUTPUT_DISASSEMBLY |
| 374 | bool "Create a disassembly file" |
| 375 | default y |
| 376 | help |
| 377 | Create an .lst file with the assembly listing of the firmware. |
| 378 | |
Rohit Gujarathi | 35713f2 | 2020-05-07 10:08:37 +0530 | [diff] [blame] | 379 | config OUTPUT_DISASSEMBLE_ALL |
| 380 | bool "Disassemble all sections with source. Fill zeros." |
| 381 | default n |
| 382 | depends on OUTPUT_DISASSEMBLY |
| 383 | help |
| 384 | The .lst file will contain complete disassembly of the firmware |
| 385 | not just those expected to contain instructions including zeros |
| 386 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 387 | config OUTPUT_PRINT_MEMORY_USAGE |
| 388 | bool "Print memory usage to stdout" |
| 389 | default y |
| 390 | help |
| 391 | If the toolchain supports it, this option will pass |
| 392 | --print-memory-region to the linker when it is doing it's first |
| 393 | linker pass. Note that the memory regions are symbolic concepts |
| 394 | defined by the linker scripts and do not necessarily map |
| 395 | directly to the real physical address space. Take also note that |
| 396 | some platforms do two passes of the linker so the results do not |
| 397 | match exactly to the final elf file. See also rom_report, |
| 398 | ram_report and |
| 399 | https://sourceware.org/binutils/docs/ld/MEMORY.html |
| 400 | |
Anas Nashif | fdbf2db | 2020-10-20 14:31:56 -0400 | [diff] [blame] | 401 | config CLEANUP_INTERMEDIATE_FILES |
| 402 | bool "Remove all intermediate files" |
| 403 | help |
| 404 | Delete intermediate files to save space and cleanup clutter resulting |
| 405 | from the build process. |
| 406 | |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 407 | config BUILD_NO_GAP_FILL |
| 408 | bool "Don't fill gaps in generated hex/bin/s19 files." |
| 409 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 410 | config BUILD_OUTPUT_HEX |
| 411 | bool "Build a binary in HEX format" |
| 412 | help |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 413 | Build an Intel HEX binary zephyr/zephyr.hex in the build directory. |
| 414 | 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] | 415 | |
| 416 | config BUILD_OUTPUT_BIN |
| 417 | bool "Build a binary in BIN format" |
| 418 | default y |
| 419 | help |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 420 | Build a "raw" binary zephyr/zephyr.bin in the build directory. |
| 421 | 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] | 422 | |
Anas Nashif | 51c34bb | 2021-01-26 06:58:30 -0500 | [diff] [blame] | 423 | config BUILD_OUTPUT_EFI |
| 424 | bool "Build as an EFI application" |
| 425 | default n |
| 426 | depends on X86_64 |
| 427 | help |
| 428 | Build as an EFI application. |
| 429 | |
| 430 | This works by creating a "zephyr.efi" EFI binary containing a zephyr |
| 431 | image extracted from a built zephyr.elf file. EFI applications are |
| 432 | relocatable, and cannot be placed at specific locations in memory. |
| 433 | Instead, the stub code will copy the embedded zephyr sections to the |
| 434 | appropriate locations at startup, clear any zero-filled (BSS, etc...) |
| 435 | areas, then jump into the 64 bit entry point. |
| 436 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 437 | config BUILD_OUTPUT_EXE |
| 438 | bool "Build a binary in ELF format with .exe extension" |
| 439 | help |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 440 | Build an ELF binary that can run in the host system at |
| 441 | zephyr/zephyr.exe in the build directory. |
| 442 | 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] | 443 | |
| 444 | config BUILD_OUTPUT_S19 |
| 445 | bool "Build a binary in S19 format" |
| 446 | help |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 447 | Build an S19 binary zephyr/zephyr.s19 in the build directory. |
| 448 | 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] | 449 | |
Pete Johanson | 310a464 | 2020-12-31 16:51:52 -0500 | [diff] [blame] | 450 | config BUILD_OUTPUT_UF2 |
| 451 | bool "Build a binary in UF2 format" |
| 452 | depends on BUILD_OUTPUT_BIN |
| 453 | help |
| 454 | Build a UF2 binary zephyr/zephyr.uf2 in the build directory. |
| 455 | The name of this file can be customized with CONFIG_KERNEL_BIN_NAME. |
| 456 | |
| 457 | if BUILD_OUTPUT_UF2 |
| 458 | |
| 459 | config BUILD_OUTPUT_UF2_FAMILY_ID |
Pete Johanson | ff01a00 | 2021-02-16 09:35:11 -0500 | [diff] [blame] | 460 | string "UF2 device family ID" |
| 461 | default "0x1c5f21b0" if SOC_ESP32 |
| 462 | default "0xada52840" if SOC_NRF52840_QIAA |
| 463 | default "0x4fb2d5bd" if SOC_SERIES_IMX_RT |
| 464 | default "0x2abc77ec" if SOC_SERIES_LPC55XXX |
| 465 | default "0x68ed2b88" if SOC_SERIES_SAMD21 |
| 466 | default "0x55114460" if SOC_SERIES_SAMD51 |
| 467 | default "0x647824b6" if SOC_SERIES_STM32F0X |
| 468 | default "0x5d1a0a2e" if SOC_SERIES_STM32F2X |
| 469 | default "0x6b846188" if SOC_SERIES_STM32F3X |
| 470 | default "0x53b80f00" if SOC_SERIES_STM32F7X |
| 471 | default "0x300f5633" if SOC_SERIES_STM32G0X |
| 472 | default "0x4c71240a" if SOC_SERIES_STM32G4X |
| 473 | default "0x6db66082" if SOC_SERIES_STM32H7X |
| 474 | default "0x202e3a91" if SOC_SERIES_STM32L0X |
| 475 | default "0x1e1f432d" if SOC_SERIES_STM32L1X |
| 476 | default "0x00ff6919" if SOC_SERIES_STM32L4X |
| 477 | default "0x04240bdf" if SOC_SERIES_STM32L5X |
| 478 | default "0x70d16653" if SOC_SERIES_STM32WBX |
| 479 | default "0x5ee21072" if SOC_STM32F103XE |
| 480 | default "0x57755a57" if SOC_STM32F401XC || SOC_STM32F401XE |
| 481 | default "0x6d0922fa" if SOC_STM32F407XE |
| 482 | default "0x8fb060fe" if SOC_STM32F407XG |
Pete Johanson | 310a464 | 2020-12-31 16:51:52 -0500 | [diff] [blame] | 483 | help |
| 484 | UF2 bootloaders only accept UF2 files with a matching family ID. |
| 485 | 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] | 486 | name string. If the SoC in use is known by UF2, the Family ID will |
| 487 | be pre-filled with the known value. |
Pete Johanson | 310a464 | 2020-12-31 16:51:52 -0500 | [diff] [blame] | 488 | |
| 489 | endif # BUILD_OUTPUT_UF2 |
| 490 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 491 | config BUILD_OUTPUT_STRIPPED |
| 492 | bool "Build a stripped binary" |
| 493 | help |
Martí Bolívar | f39fdc4 | 2020-08-06 14:57:17 -0700 | [diff] [blame] | 494 | Build a stripped binary zephyr/zephyr.strip in the build directory. |
| 495 | 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] | 496 | |
| 497 | config APPLICATION_DEFINED_SYSCALL |
| 498 | bool "Scan application folder for any syscall definition" |
| 499 | help |
| 500 | Scan additional folders inside application source folder |
| 501 | for application defined syscalls. |
| 502 | |
Sebastian Bøe | d3a8fd4 | 2019-10-17 14:25:34 +0200 | [diff] [blame] | 503 | config MAKEFILE_EXPORTS |
| 504 | bool "Generate build metadata files named Makefile.exports" |
| 505 | help |
| 506 | Generates a file with build information that can be read by |
| 507 | third party Makefile-based build systems. |
| 508 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 509 | endmenu |
Torsten Rasmussen | 1c91129 | 2021-03-22 14:29:38 +0100 | [diff] [blame] | 510 | |
| 511 | config EXPERIMENTAL |
| 512 | bool |
| 513 | help |
| 514 | Symbol that must be selected by a feature if it is considered to be |
| 515 | at an experimental implementation stage. |
| 516 | |
| 517 | config WARN_EXPERIMENTAL |
| 518 | bool |
| 519 | prompt "Warn on experimental usage" |
| 520 | help |
| 521 | Print a warning when the Kconfig tree is parsed if any experimental |
| 522 | features are enabled. |
| 523 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 524 | endmenu |
| 525 | |
| 526 | |
| 527 | menu "Boot Options" |
| 528 | |
| 529 | config IS_BOOTLOADER |
| 530 | bool "Act as a bootloader" |
| 531 | depends on XIP |
| 532 | depends on ARM |
| 533 | help |
| 534 | This option indicates that Zephyr will act as a bootloader to execute |
| 535 | a separate Zephyr image payload. |
| 536 | |
| 537 | config BOOTLOADER_SRAM_SIZE |
| 538 | int "SRAM reserved for bootloader" |
| 539 | default 16 |
| 540 | depends on !XIP || IS_BOOTLOADER |
Rajavardhan Gundi | e584b05 | 2018-12-14 16:55:43 +0530 | [diff] [blame] | 541 | depends on ARM || XTENSA |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 542 | help |
| 543 | This option specifies the amount of SRAM (measure in kB) reserved for |
| 544 | a bootloader image, when either: |
| 545 | - the Zephyr image itself is to act as the bootloader, or |
| 546 | - Zephyr is a !XIP image, which implicitly assumes existence of a |
| 547 | bootloader that loads the Zephyr !XIP image onto SRAM. |
| 548 | |
Håkon Øye Amundsen | c92a60b | 2020-09-17 12:05:15 +0000 | [diff] [blame] | 549 | config MCUBOOT |
| 550 | bool |
| 551 | help |
| 552 | Hidden option used to indicate that the current image is MCUBoot |
| 553 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 554 | config BOOTLOADER_MCUBOOT |
| 555 | bool "MCUboot bootloader support" |
Ulf Magnusson | 90b9eb3 | 2019-11-16 01:22:16 +0100 | [diff] [blame] | 556 | select USE_DT_CODE_PARTITION |
Ioannis Glaropoulos | 071ab4a | 2020-10-21 15:56:38 +0200 | [diff] [blame] | 557 | 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] | 558 | depends on !MCUBOOT |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 559 | help |
| 560 | This option signifies that the target uses MCUboot as a bootloader, |
| 561 | or in other words that the image is to be chain-loaded by MCUboot. |
| 562 | This sets several required build system and Device Tree options in |
| 563 | order for the image generated to be bootable using the MCUboot open |
| 564 | source bootloader. Currently this includes: |
| 565 | |
Stephanos Ioannidis | 3322489 | 2020-02-10 16:37:24 +0900 | [diff] [blame] | 566 | * Setting ROM_START_OFFSET to a default value that allows space |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 567 | for the MCUboot image header |
Andrzej Puzdrowski | c7ab1a1 | 2020-07-03 16:01:33 +0200 | [diff] [blame] | 568 | * Activating SW_VECTOR_RELAY_CLIENT on Cortex-M0 |
| 569 | (or Armv8-M baseline) targets with no built-in vector relocation |
| 570 | mechanisms |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 571 | |
Ioannis Glaropoulos | 071ab4a | 2020-10-21 15:56:38 +0200 | [diff] [blame] | 572 | By default, this option instructs Zephyr to initialize the core |
| 573 | architecture HW registers during boot, when this is supported by |
| 574 | the application. This removes the need by MCUboot to reset |
| 575 | the core registers' state itself. |
| 576 | |
Martí Bolívar | f66a0c3 | 2020-08-18 11:28:04 -0700 | [diff] [blame] | 577 | if BOOTLOADER_MCUBOOT |
| 578 | |
| 579 | config MCUBOOT_SIGNATURE_KEY_FILE |
| 580 | string "Path to the mcuboot signing key file" |
| 581 | default "" |
| 582 | help |
| 583 | The file contains a key pair whose public half is verified |
| 584 | by your target's MCUboot image. The file is in PEM format. |
| 585 | |
| 586 | If set to a non-empty value, the build system tries to |
| 587 | sign the final binaries using a 'west sign -t imgtool' command. |
| 588 | The signed binaries are placed in the build directory |
| 589 | at zephyr/zephyr.signed.bin and zephyr/zephyr.signed.hex. |
| 590 | |
| 591 | The file names can be customized with CONFIG_KERNEL_BIN_NAME. |
| 592 | The existence of bin and hex files depends on CONFIG_BUILD_OUTPUT_BIN |
| 593 | and CONFIG_BUILD_OUTPUT_HEX. |
| 594 | |
Helge Juul | 8749cd4 | 2021-08-10 10:59:00 +0200 | [diff] [blame] | 595 | This option should contain a path to the same file as the |
| 596 | BOOT_SIGNATURE_KEY_FILE option in your MCUboot .config. The path |
| 597 | may be absolute or relative to the west workspace topdir. (The MCUboot |
| 598 | config option is used for the MCUboot bootloader image; this option is |
| 599 | for your application which is to be loaded by MCUboot. The MCUboot |
| 600 | config option can be a relative path from the MCUboot repository |
| 601 | root.) |
Martí Bolívar | f66a0c3 | 2020-08-18 11:28:04 -0700 | [diff] [blame] | 602 | |
| 603 | If left empty, you must sign the Zephyr binaries manually. |
| 604 | |
Helge Juul | 8749cd4 | 2021-08-10 10:59:00 +0200 | [diff] [blame] | 605 | config MCUBOOT_ENCRYPTION_KEY_FILE |
| 606 | string "Path to the mcuboot encryption key file" |
| 607 | default "" |
| 608 | depends on MCUBOOT_SIGNATURE_KEY_FILE != "" |
| 609 | help |
| 610 | The file contains the public key that is used to encrypt the |
| 611 | ephemeral key that encrypts the image. The corresponding |
| 612 | private key is hard coded in the MCUboot source code and is |
| 613 | used to decrypt the ephemeral key that is embedded in the |
| 614 | image. The file is in PEM format. |
| 615 | |
| 616 | If set to a non-empty value, the build system tries to |
| 617 | sign and encrypt the final binaries using a 'west sign -t imgtool' |
| 618 | command. The binaries are placed in the build directory at |
| 619 | zephyr/zephyr.signed.encrypted.bin and |
| 620 | zephyr/zephyr.signed.encrypted.hex. |
| 621 | |
| 622 | The file names can be customized with CONFIG_KERNEL_BIN_NAME. |
| 623 | The existence of bin and hex files depends on CONFIG_BUILD_OUTPUT_BIN |
| 624 | and CONFIG_BUILD_OUTPUT_HEX. |
| 625 | |
| 626 | This option should either be an absolute path or a path relative to |
| 627 | the west workspace topdir. |
| 628 | Example: './bootloader/mcuboot/enc-rsa2048-pub.pem' |
| 629 | |
| 630 | If left empty, you must encrypt the Zephyr binaries manually. |
| 631 | |
Martí Bolívar | f66a0c3 | 2020-08-18 11:28:04 -0700 | [diff] [blame] | 632 | config MCUBOOT_EXTRA_IMGTOOL_ARGS |
| 633 | string "Extra arguments to pass to imgtool" |
| 634 | default "" |
| 635 | help |
| 636 | If CONFIG_MCUBOOT_SIGNATURE_KEY_FILE is a non-empty string, |
| 637 | you can use this option to pass extra options to imgtool. |
| 638 | For example, you could set this to "--version 1.2". |
| 639 | |
| 640 | config MCUBOOT_GENERATE_CONFIRMED_IMAGE |
Henrik Brix Andersen | 7e39e1d | 2020-09-03 20:37:31 +0200 | [diff] [blame] | 641 | bool "Also generate a padded, confirmed image" |
Martí Bolívar | f66a0c3 | 2020-08-18 11:28:04 -0700 | [diff] [blame] | 642 | help |
Henrik Brix Andersen | 7e39e1d | 2020-09-03 20:37:31 +0200 | [diff] [blame] | 643 | The signed, padded, and confirmed binaries are placed in the build |
| 644 | directory at zephyr/zephyr.signed.confirmed.bin and |
Martí Bolívar | f66a0c3 | 2020-08-18 11:28:04 -0700 | [diff] [blame] | 645 | zephyr/zephyr.signed.confirmed.hex. |
| 646 | |
| 647 | The file names can be customized with CONFIG_KERNEL_BIN_NAME. |
| 648 | The existence of bin and hex files depends on CONFIG_BUILD_OUTPUT_BIN |
| 649 | and CONFIG_BUILD_OUTPUT_HEX. |
| 650 | |
| 651 | endif # BOOTLOADER_MCUBOOT |
| 652 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 653 | config BOOTLOADER_ESP_IDF |
| 654 | bool "ESP-IDF bootloader support" |
Glauber Maroto Ferreira | ed63e2a | 2021-07-09 18:26:11 -0300 | [diff] [blame] | 655 | depends on SOC_ESP32 || SOC_ESP32S2 |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 656 | help |
| 657 | This option will trigger the compilation of the ESP-IDF bootloader |
| 658 | inside the build folder. |
| 659 | At flash time, the bootloader will be flashed with the zephyr image |
| 660 | |
Michael Hope | 8c1f186 | 2020-06-13 21:32:11 +0200 | [diff] [blame] | 661 | config BOOTLOADER_BOSSA |
| 662 | bool "BOSSA bootloader support" |
| 663 | select USE_DT_CODE_PARTITION |
Michael Hope | 8c1f186 | 2020-06-13 21:32:11 +0200 | [diff] [blame] | 664 | |
| 665 | help |
| 666 | Signifies that the target uses a BOSSA compatible bootloader. If CDC |
| 667 | ACM USB support is also enabled then the board will reboot into the |
| 668 | bootloader automatically when bossac is run. |
| 669 | |
| 670 | config BOOTLOADER_BOSSA_DEVICE_NAME |
| 671 | string "BOSSA CDC ACM device name" |
| 672 | depends on BOOTLOADER_BOSSA && CDC_ACM_DTE_RATE_CALLBACK_SUPPORT |
| 673 | default "CDC_ACM_0" |
| 674 | help |
| 675 | Sets the CDC ACM port to watch for reboot commands. |
| 676 | |
| 677 | choice |
| 678 | prompt "BOSSA bootloader variant" |
| 679 | depends on BOOTLOADER_BOSSA |
| 680 | |
Gerson Fernando Budke | f3a7f04 | 2021-05-06 21:20:11 -0300 | [diff] [blame] | 681 | config BOOTLOADER_BOSSA_LEGACY |
| 682 | bool "Legacy" |
| 683 | help |
| 684 | Select the Legacy variant of the BOSSA bootloader. This is defined |
| 685 | for compatibility mode only. The recommendation is use newer |
| 686 | versions like Arduino or Adafruit UF2. |
| 687 | |
Michael Hope | 8c1f186 | 2020-06-13 21:32:11 +0200 | [diff] [blame] | 688 | config BOOTLOADER_BOSSA_ARDUINO |
| 689 | bool "Arduino" |
| 690 | help |
| 691 | Select the Arduino variant of the BOSSA bootloader. Uses 0x07738135 |
| 692 | as the magic value to enter the bootloader. |
| 693 | |
| 694 | config BOOTLOADER_BOSSA_ADAFRUIT_UF2 |
| 695 | bool "Adafruit UF2" |
| 696 | help |
| 697 | Select the Adafruit UF2 variant of the BOSSA bootloader. Uses |
| 698 | 0xf01669ef as the magic value to enter the bootloader. |
| 699 | |
| 700 | endchoice |
| 701 | |
Anas Nashif | 86ad37a | 2018-11-02 07:12:07 -0400 | [diff] [blame] | 702 | endmenu |
Carlo Caione | d048faa | 2019-12-17 17:13:47 +0000 | [diff] [blame] | 703 | |
| 704 | menu "Compatibility" |
| 705 | |
| 706 | config COMPAT_INCLUDES |
| 707 | bool "Suppress warnings when using header shims" |
| 708 | default y |
| 709 | help |
| 710 | Suppress any warnings from the pre-processor when including |
| 711 | deprecated header files. |
| 712 | |
| 713 | endmenu |