blob: bf202081e7065439f07f2aae1d856f6e62e56f1c [file] [log] [blame]
Ulf Magnussonbd6e0442019-11-01 13:45:29 +01001# General configuration options
Anas Nashif7d4163d2015-08-22 14:43:07 -04002
Anas Nashif7d4163d2015-08-22 14:43:07 -04003# Copyright (c) 2014-2015 Wind River Systems, Inc.
Daniel Leung8df10d42016-03-25 14:30:50 -07004# Copyright (c) 2016 Intel Corporation
Dominik Ermel865f8012023-05-11 11:47:21 +00005# Copyright (c) 2023 Nordic Semiconductor ASA
David B. Kinderac74d8b2017-01-18 17:01:01 -08006# SPDX-License-Identifier: Apache-2.0
Sebastian Bøe4b61bd12018-01-09 14:12:07 +01007
Pieter De Gendtdfdebc92024-07-05 15:44:06 +02008source "Kconfig.constants"
9
Torsten Rasmussen49389b52023-03-23 11:02:49 +010010osource "${APPLICATION_SOURCE_DIR}/VERSION"
Anas Nashif658f6bc2019-05-28 14:22:51 -040011
Ulf Magnussone63b6522020-01-26 23:47:41 +010012# Include Kconfig.defconfig files first so that they can override defaults and
13# other symbol/choice properties by adding extra symbol/choice definitions.
14# After merging all definitions for a symbol/choice, Kconfig picks the first
15# property (e.g. the first default) with a satisfied condition.
Ulf Magnussonec3eff52018-07-30 10:57:47 +020016#
Ulf Magnussone63b6522020-01-26 23:47:41 +010017# Shield defaults should have precedence over board defaults, which should have
18# precedence over SoC defaults, so include them in that order.
Ulf Magnussonec3eff52018-07-30 10:57:47 +020019#
Torsten Rasmussen536d34f2024-05-08 13:10:48 +020020# $ARCH and $KCONFIG_BOARD_DIR will be glob patterns when building documentation.
Torsten Rasmussen6be1b2a2021-06-02 08:47:21 +020021# This loads custom shields defconfigs (from BOARD_ROOT)
22osource "$(KCONFIG_BINARY_DIR)/Kconfig.shield.defconfig"
23# This loads Zephyr base shield defconfigs
24source "boards/shields/*/Kconfig.defconfig"
25
Torsten Rasmussen536d34f2024-05-08 13:10:48 +020026osource "$(KCONFIG_BOARD_DIR)/Kconfig.defconfig"
Torsten Rasmussen6be1b2a2021-06-02 08:47:21 +020027
Torsten Rasmussen8dc3f852022-09-14 22:23:15 +020028# This loads Zephyr specific SoC root defconfigs
29source "$(KCONFIG_BINARY_DIR)/soc/Kconfig.defconfig"
30
Torsten Rasmussen36bb00d2021-08-15 23:14:21 +020031# This loads the toolchain defconfigs
32osource "$(TOOLCHAIN_KCONFIG_DIR)/Kconfig.defconfig"
Krzysztof Chruscinski2735a3a2022-09-06 12:50:10 +020033# This loads the testsuite defconfig
34source "subsys/testsuite/Kconfig.defconfig"
Ulf Magnussonec3eff52018-07-30 10:57:47 +020035
Kumar Gala52a3ec92022-08-12 10:00:38 -050036# This should be early since the autogen Kconfig.dts symbols may get
37# used by modules
38source "dts/Kconfig"
39
Ioannis Glaropoulosc5203852020-12-07 18:42:52 +010040menu "Modules"
41
Ioannis Glaropoulosc5203852020-12-07 18:42:52 +010042source "modules/Kconfig"
43
44endmenu
45
Anas Nashifabcf2ad2018-09-04 08:32:07 -050046source "boards/Kconfig"
Torsten Rasmussen5f7cc8d2020-07-06 12:53:39 +020047source "soc/Kconfig"
Anas Nashif77ba3c32015-10-09 06:20:52 -040048source "arch/Kconfig"
Anas Nashif77ba3c32015-10-09 06:20:52 -040049source "kernel/Kconfig"
Anas Nashif77ba3c32015-10-09 06:20:52 -040050source "drivers/Kconfig"
Anas Nashif0b2c44a2016-05-14 23:10:51 -040051source "lib/Kconfig"
Ramesh Thomase354ad22016-10-29 04:10:36 -070052source "subsys/Kconfig"
Kumar Gala7584a122016-05-24 14:23:26 -050053
Kumar Gala2630fba2020-01-24 09:39:40 -060054osource "$(TOOLCHAIN_KCONFIG_DIR)/Kconfig"
Anas Nashif8017c592019-05-23 17:19:41 -040055
Anas Nashif86ad37a2018-11-02 07:12:07 -040056menu "Build and Link Features"
57
58menu "Linker Options"
59
Erwan Gouriou16d9d4d2023-03-22 15:09:48 +010060choice LINKER_ORPHAN_CONFIGURATION
Daniel Leung6600c642018-10-19 10:15:19 -070061 prompt "Linker Orphan Section Handling"
62 default LINKER_ORPHAN_SECTION_WARN
63
64config LINKER_ORPHAN_SECTION_PLACE
65 bool "Place"
66 help
67 Linker puts orphan sections in place without warnings
68 or errors.
69
70config LINKER_ORPHAN_SECTION_WARN
71 bool "Warn"
72 help
Anas Nashiff2cb20c2019-06-18 14:45:40 -040073 Linker places the orphan sections in output and issues
Daniel Leung6600c642018-10-19 10:15:19 -070074 warning about those sections.
75
76config LINKER_ORPHAN_SECTION_ERROR
77 bool "Error"
78 help
79 Linker exits with error when an orphan section is found.
80
81endchoice
Anas Nashif86ad37a2018-11-02 07:12:07 -040082
83config HAS_FLASH_LOAD_OFFSET
84 bool
85 help
86 This option is selected by targets having a FLASH_LOAD_OFFSET
87 and FLASH_LOAD_SIZE.
88
Ulf Magnussonfd9981a2019-11-16 01:33:09 +010089if HAS_FLASH_LOAD_OFFSET
90
Ulf Magnusson90b9eb32019-11-16 01:22:16 +010091config USE_DT_CODE_PARTITION
Ulf Magnusson1f9c5f12019-11-16 01:16:57 +010092 bool "Link application into /chosen/zephyr,code-partition from devicetree"
Andrzej Puzdrowski2b1227f2019-03-18 14:02:11 +010093 help
Ulf Magnusson1f9c5f12019-11-16 01:16:57 +010094 When enabled, the application will be linked into the flash partition
95 selected by the zephyr,code-partition property in /chosen in devicetree.
96 When this is disabled, the flash load offset and size can be set manually
97 below.
Andrzej Puzdrowski2b1227f2019-03-18 14:02:11 +010098
Kumar Gala8ce0cf02019-08-28 09:29:26 -050099# Workaround for not being able to have commas in macro arguments
100DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
101
Anas Nashif86ad37a2018-11-02 07:12:07 -0400102config FLASH_LOAD_OFFSET
Ulf Magnusson90b9eb32019-11-16 01:22:16 +0100103 # Only user-configurable when USE_DT_CODE_PARTITION is disabled
104 hex "Kernel load offset" if !USE_DT_CODE_PARTITION
105 default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION
Anas Nashif86ad37a2018-11-02 07:12:07 -0400106 default 0
Anas Nashif86ad37a2018-11-02 07:12:07 -0400107 help
108 This option specifies the byte offset from the beginning of flash that
109 the kernel should be loaded into. Changing this value from zero will
110 affect the Zephyr image's link, and will decrease the total amount of
111 flash available for use by application code.
112
113 If unsure, leave at the default value 0.
114
115config FLASH_LOAD_SIZE
Ulf Magnusson90b9eb32019-11-16 01:22:16 +0100116 # Only user-configurable when USE_DT_CODE_PARTITION is disabled
117 hex "Kernel load size" if !USE_DT_CODE_PARTITION
118 default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION
Anas Nashif86ad37a2018-11-02 07:12:07 -0400119 default 0
Anas Nashif86ad37a2018-11-02 07:12:07 -0400120 help
121 If non-zero, this option specifies the size, in bytes, of the flash
122 area that the Zephyr image will be allowed to occupy. If zero, the
123 image will be able to occupy from the FLASH_LOAD_OFFSET to the end of
124 the device.
125
126 If unsure, leave at the default value 0.
Anas Nashif86ad37a2018-11-02 07:12:07 -0400127
Ulf Magnussonfd9981a2019-11-16 01:33:09 +0100128endif # HAS_FLASH_LOAD_OFFSET
129
Stephanos Ioannidis33224892020-02-10 16:37:24 +0900130config ROM_START_OFFSET
Ole Sæther985446a2019-01-23 14:13:03 +0100131 hex
Stephanos Ioannidis33224892020-02-10 16:37:24 +0900132 prompt "ROM start offset" if !BOOTLOADER_MCUBOOT
Anas Nashif86ad37a2018-11-02 07:12:07 -0400133 default 0x200 if BOOTLOADER_MCUBOOT
134 default 0
135 help
136 If the application is built for chain-loading by a bootloader this
137 variable is required to be set to value that leaves sufficient
Stephanos Ioannidis33224892020-02-10 16:37:24 +0900138 space between the beginning of the image and the start of the first
Anas Nashif86ad37a2018-11-02 07:12:07 -0400139 section to store an image header or any other metadata.
140 In the particular case of the MCUboot bootloader this reserves enough
141 space to store the image header, which should also meet vector table
142 alignment requirements on most ARM targets, although some targets
143 may require smaller or larger values.
144
Jamie McCrae7c631f02023-10-30 17:16:31 +0000145config ROM_END_OFFSET
146 hex "ROM end offset"
147 default 0
148 help
149 If non-zero, this option reduces the maximum size that the Zephyr image is allowed to
150 occupy, this is to allow for additional image storage which can be created and used by
151 other systems such as bootloaders (for MCUboot, this would include the image swap
152 fields and TLV storage at the end of the image).
153
154 If unsure, leave at the default value 0.
155
Torsten Rasmussen761eada2021-06-09 11:22:07 +0200156config LD_LINKER_SCRIPT_SUPPORTED
157 bool
158 default y
159
160choice LINKER_SCRIPT
161 prompt "Linker script"
162 default LD_LINKER_TEMPLATE if LD_LINKER_SCRIPT_SUPPORTED
163
164config LD_LINKER_TEMPLATE
165 bool "LD template"
166 depends on LD_LINKER_SCRIPT_SUPPORTED
167 help
168 Select this option to use the LD linker script templates.
169 The templates are pre-processed by the C pre-processor to create the
170 final LD linker script.
171
172config CMAKE_LINKER_GENERATOR
173 bool "CMake generator"
174 depends on ARM
175 help
176 Select this option to use the Zephyr CMake linker script generator.
177 The linker configuration is written in CMake and the final linker
178 script will be generated by the toolchain specific linker generator.
179 For LD based linkers, this will be the ld generator, for ARMClang /
180 armlink based linkers it will be the scatter generator.
181
182endchoice
183
Anas Nashif86ad37a2018-11-02 07:12:07 -0400184config HAVE_CUSTOM_LINKER_SCRIPT
Torsten Rasmussen761eada2021-06-09 11:22:07 +0200185 bool "Custom linker script provided"
Anas Nashif86ad37a2018-11-02 07:12:07 -0400186 help
187 Set this option if you have a custom linker script which needed to
188 be define in CUSTOM_LINKER_SCRIPT.
189
190config CUSTOM_LINKER_SCRIPT
191 string "Path to custom linker script"
192 depends on HAVE_CUSTOM_LINKER_SCRIPT
193 help
194 Path to the linker script to be used instead of the one define by the
195 board.
196
197 The linker script must be based on a version provided by Zephyr since
198 the kernel can expect a certain layout/certain regions.
199
200 This is useful when an application needs to add sections into the
201 linker script and avoid having to change the script provided by
202 Zephyr.
203
Anas Nashif86ad37a2018-11-02 07:12:07 -0400204config KERNEL_ENTRY
205 string "Kernel entry symbol"
206 default "__start"
207 help
208 Code entry symbol, to be set at linking phase.
209
Sebastian Bøe3a0597f2019-03-15 14:05:09 +0100210config LINKER_SORT_BY_ALIGNMENT
211 bool "Sort input sections by alignment"
212 default y
213 help
214 This turns on the linker flag to sort sections by alignment
215 in decreasing size of symbols. This helps to minimize
216 padding between symbols.
217
Jordan Yates318ee972021-04-17 20:04:33 +1000218config SRAM_VECTOR_TABLE
219 bool "Place the vector table in SRAM instead of flash"
220 help
221 The option specifies that the vector table should be placed at the
222 start of SRAM instead of the start of flash.
223
Daniel Leungece9cad2021-02-20 11:02:17 -0800224config HAS_SRAM_OFFSET
225 bool
226 help
227 This option is selected by targets that require SRAM_OFFSET.
228
229config SRAM_OFFSET
230 hex "Kernel SRAM offset" if HAS_SRAM_OFFSET
231 default 0
232 help
233 This option specifies the byte offset from the beginning of SRAM
234 where the kernel begins. Changing this value from zero will affect
235 the Zephyr image's link, and will decrease the total amount of
236 SRAM available for use by application code.
237
238 If unsure, leave at the default value 0.
239
Daniel Leungd8127282021-02-24 10:18:34 -0800240menu "Linker Sections"
241
242config LINKER_USE_BOOT_SECTION
Gerard Marull-Paretasdffaf532022-03-09 12:31:16 +0100243 bool "Use Boot Linker Section"
Daniel Leungd8127282021-02-24 10:18:34 -0800244 help
245 If enabled, the symbols which are needed for the boot process
246 will be put into another linker section reserved for these
247 symbols.
248
249 Requires that boot sections exist in the architecture, SoC,
250 board or custom linker script.
251
Daniel Leung1310ad62021-02-23 13:33:38 -0800252config LINKER_USE_PINNED_SECTION
Gerard Marull-Paretasdffaf532022-03-09 12:31:16 +0100253 bool "Use Pinned Linker Section"
Daniel Leung1310ad62021-02-23 13:33:38 -0800254 help
255 If enabled, the symbols which need to be pinned in memory
256 will be put into another linker section reserved for pinned
257 symbols. During boot, the corresponding memory will be marked
258 as pinned.
259
260 Requires that pinned sections exist in the architecture, SoC,
261 board or custom linker script.
262
Nicolas Pitrecbbd8572024-07-22 16:19:51 -0400263config LINKER_USE_ONDEMAND_SECTION
264 bool "Use Evictable Linker Section"
Nicolas Pitre1e4fd232024-07-30 14:58:17 -0400265 depends on DEMAND_MAPPING
Nicolas Pitrecbbd8572024-07-22 16:19:51 -0400266 depends on !LINKER_USE_PINNED_SECTION
267 depends on !ARCH_MAPS_ALL_RAM
268 help
269 If enabled, the symbols which may be evicted from memory
270 will be put into a linker section reserved for on-demand symbols.
271 During boot, the corresponding memory will be mapped as paged out.
272 This is conceptually the opposite of CONFIG_LINKER_USE_PINNED_SECTION.
273
274 Requires that on-demand sections exist in the architecture, SoC,
275 board or custom linker script.
276
Daniel Leung6a006d72021-07-12 10:58:45 -0700277config LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT
278 bool "Generic sections are present at boot" if DEMAND_PAGING && LINKER_USE_PINNED_SECTION
279 default y
280 help
281 When disabled, the linker sections other than the boot and
282 pinned sections will be marked as not present in the page
283 tables. This allows kernel to pull in data pages on demand
284 as required by current execution context when demand paging
285 is enabled. There is no need to load all code and data into
286 memory at once.
287
288 If unsure, say Y.
289
Torsten Rasmussenc1078272022-09-27 12:34:36 +0200290config LINKER_LAST_SECTION_ID
291 bool "Last section identifier"
Nicolas Pitre87f68b42024-07-30 01:28:27 -0400292 default y if !ARM64
Torsten Rasmussenc1078272022-09-27 12:34:36 +0200293 depends on ARM || ARM64 || RISCV
294 help
295 If enabled, the last section will contain an identifier.
296 This ensures that the '_flash_used' linker symbol will always be
297 correctly calculated, even in cases where the location counter may
298 have been incremented for alignment purposes but no data is placed
299 after alignment.
300
301 Note: in cases where the flash is fully used, for example application
302 specific data is written at the end of the flash area, then writing a
303 last section identifier may cause rom region overflow.
304 In such cases this setting should be disabled.
305
306config LINKER_LAST_SECTION_ID_PATTERN
307 hex "Last section identifier pattern"
308 default "0xE015E015"
309 depends on LINKER_LAST_SECTION_ID
310 help
311 Pattern to fill into last section as identifier.
312 Default pattern is 0xE015 (end of last section), but any pattern can
313 be used.
314 The size of the pattern must not exceed 4 bytes.
315
Flavio Ceolin56ec06f2022-12-20 10:36:34 -0800316config LINKER_USE_NO_RELAX
317 bool
318 help
319 Hidden symbol to allow features to force the use of no relax.
320
321config LINKER_USE_RELAX
322 bool "Linker optimization of call addressing"
323 depends on !LINKER_USE_NO_RELAX
324 default y
325 help
326 This option performs global optimizations that become possible when the linker resolves
327 addressing in the program, such as relaxing address modes and synthesizing new
328 instructions in the output object file. For ld and lld, this enables `--relax`.
329 On platforms where this is not supported, `--relax' is accepted, but ignored.
330 Disabling it can reduce performance, as the linker is no longer able to substiture long /
331 in-effective jump calls to shorter / more effective instructions.
332
Daniel Leungd8127282021-02-24 10:18:34 -0800333endmenu # "Linker Sections"
334
Pieter De Gendta2b866e62024-05-06 16:29:43 +0200335config LINKER_ITERABLE_SUBALIGN
336 int
337 default 8 if 64BIT
338 default 4
339 help
340 Hidden option for the default subalignment of iterable sections.
341
Krzysztof Chruscinskidfb36742022-04-22 11:36:05 +0200342config LINKER_DEVNULL_SUPPORT
343 bool
344 default y if CPU_CORTEX_M || (RISCV && !64BIT)
345
346config LINKER_DEVNULL_MEMORY
347 bool "Devnull region"
348 depends on LINKER_DEVNULL_SUPPORT
349 help
350 Devnull region is created. It is stripped from final binary but remains
351 in byproduct elf file.
352
353config LINKER_DEVNULL_MEMORY_SIZE
354 int "Devnull region size"
355 depends on LINKER_DEVNULL_MEMORY
356 default 262144
357 help
358 Size can be adjusted so it fits all data placed in that region.
359
Anas Nashif86ad37a2018-11-02 07:12:07 -0400360endmenu
361
362menu "Compiler Options"
363
Pieter De Gendt86b721c2024-04-03 09:32:10 +0200364config REQUIRES_STD_C99
365 bool
366 help
367 Hidden option to select compiler support C99 standard or higher.
368
369config REQUIRES_STD_C11
370 bool
371 select REQUIRES_STD_C99
372 help
373 Hidden option to select compiler support C11 standard or higher.
374
375config REQUIRES_STD_C17
376 bool
377 select REQUIRES_STD_C11
378 help
379 Hidden option to select compiler support C17 standard or higher.
380
381config REQUIRES_STD_C23
382 bool
383 select REQUIRES_STD_C17
384 help
385 Hidden option to select compiler support C23 standard or higher.
386
387choice STD_C
388 prompt "C Standard"
389 default STD_C23 if REQUIRES_STD_C23
390 default STD_C17 if REQUIRES_STD_C17
391 default STD_C11 if REQUIRES_STD_C11
392 default STD_C99
393 help
394 C Standards.
395
396config STD_C90
397 bool "C90"
398 depends on !REQUIRES_STD_C99
399 help
400 1989 C standard as completed in 1989 and ratified by ISO/IEC
401 as ISO/IEC 9899:1990. This version is known as "ANSI C".
402
403config STD_C99
404 bool "C99"
405 depends on !REQUIRES_STD_C11
406 help
407 1999 C standard.
408
409config STD_C11
410 bool "C11"
411 depends on !REQUIRES_STD_C17
412 help
413 2011 C standard.
414
415config STD_C17
416 bool "C17"
417 depends on !REQUIRES_STD_C23
418 help
419 2017 C standard, addresses defects in C11 without introducing
420 new language features.
421
422config STD_C23
423 bool "C23"
424 help
425 2023 C standard.
426
427endchoice
428
Pieter De Gendta599ed12024-04-15 19:28:45 +0200429config TOOLCHAIN_SUPPORTS_GNU_EXTENSIONS
430 bool
431 default y if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr"
432 help
433 Hidden option to signal that toolchain supports GNU Extensions.
434
435config GNU_C_EXTENSIONS
436 bool "GNU C Extensions"
437 depends on TOOLCHAIN_SUPPORTS_GNU_EXTENSIONS
438 help
439 Enable GNU C Extensions. GNU C provides several language features
440 not found in ISO standard C.
441
Flavio Ceolinb587e8d2020-08-26 09:48:33 -0700442config CODING_GUIDELINE_CHECK
443 bool "Enforce coding guideline rules"
444 help
445 Use available compiler flags to check coding guideline rules during
446 the build.
447
Keith Packardbe4b76f2023-10-12 11:55:04 -0700448config NATIVE_LIBC
Alberto Escolar Piedras2eb14f12023-05-26 13:15:09 +0200449 bool
Keith Packard214a3c52023-02-08 13:44:39 -0800450 select FULL_LIBC_SUPPORTED
Ilya Tagunov1f5fbe22024-11-13 16:11:25 +0000451 select TC_PROVIDES_POSIX_C_LANG_SUPPORT_R
Keith Packardbe4b76f2023-10-12 11:55:04 -0700452 help
453 Zephyr will use the host system C library.
454
455config NATIVE_LIBCPP
456 bool
457 select FULL_LIBCPP_SUPPORTED
458 help
459 Zephyr will use the host system C++ library
460
461config NATIVE_BUILD
462 bool
463 select NATIVE_LIBC if EXTERNAL_LIBC
464 select NATIVE_LIBCPP if EXTERNAL_LIBCPP
Anas Nashif86ad37a2018-11-02 07:12:07 -0400465 help
Alberto Escolar Piedras2eb14f12023-05-26 13:15:09 +0200466 Zephyr will be built targeting the host system for debug and
467 development purposes.
468
469config NATIVE_APPLICATION
470 bool
471 default y if ARCH_POSIX
472 depends on !NATIVE_LIBRARY
473 select NATIVE_BUILD
Alberto Escolar Piedrasc4b7b682024-11-11 16:17:01 +0100474 select DEPRECATED
Alberto Escolar Piedras2eb14f12023-05-26 13:15:09 +0200475 help
Anas Nashif86ad37a2018-11-02 07:12:07 -0400476 Build as a native application that can run on the host and using
Alberto Escolar Piedrasc4b7b682024-11-11 16:17:01 +0100477 resources and libraries provided by the host. This option is deprecated
478 and will be removed in Zephyr v4.3
Anas Nashif86ad37a2018-11-02 07:12:07 -0400479
Alberto Escolar Piedras2eb14f12023-05-26 13:15:09 +0200480config NATIVE_LIBRARY
481 bool
482 select NATIVE_BUILD
483 help
484 Build as a prelinked library for the native host target.
485 This library can later be built into an executable for the host.
486
Keith Packard6c5d8062023-02-08 14:56:50 -0800487config COMPILER_FREESTANDING
488 bool "Build in a freestanding compiler mode"
489 help
490 Configure the compiler to operate in freestanding mode according to
491 the C and C++ language specifications. Freestanding mode reduces the
492 requirements of the compiler and language environment, which can
493 negatively impact the ability for the compiler to detect errors and
494 perform optimizations.
495
Emil Lindqvistf7dad072021-09-03 13:52:33 +0200496choice COMPILER_OPTIMIZATIONS
Anas Nashif86ad37a2018-11-02 07:12:07 -0400497 prompt "Optimization level"
498 default NO_OPTIMIZATIONS if COVERAGE
499 default DEBUG_OPTIMIZATIONS if DEBUG
Jonathon Penixeaa903d2024-03-20 10:45:29 -0700500 default SIZE_OPTIMIZATIONS_AGGRESSIVE if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "llvm"
Anas Nashif86ad37a2018-11-02 07:12:07 -0400501 default SIZE_OPTIMIZATIONS
502 help
503 Note that these flags shall only control the compiler
504 optimization level, and that no extra debug code shall be
505 conditionally compiled based on them.
506
507config SIZE_OPTIMIZATIONS
508 bool "Optimize for size"
509 help
510 Compiler optimizations will be set to -Os independently of other
511 options.
512
Jonathon Penixd6041d62024-03-20 10:29:51 -0700513config SIZE_OPTIMIZATIONS_AGGRESSIVE
514 bool "Aggressively optimize for size"
515 help
516 Compiler optimizations wil be set to -Oz independently of other
517 options.
518
Anas Nashif86ad37a2018-11-02 07:12:07 -0400519config SPEED_OPTIMIZATIONS
520 bool "Optimize for speed"
521 help
522 Compiler optimizations will be set to -O2 independently of other
523 options.
524
525config DEBUG_OPTIMIZATIONS
526 bool "Optimize debugging experience"
527 help
528 Compiler optimizations will be set to -Og independently of other
529 options.
530
531config NO_OPTIMIZATIONS
532 bool "Optimize nothing"
533 help
534 Compiler optimizations will be set to -O0 independently of other
535 options.
Henrik Brix Andersen26ebcee2023-03-22 10:19:40 +0100536
537 Selecting this option will likely require manual tuning of the
538 default stack sizes in order to avoid stack overflows.
Anas Nashif86ad37a2018-11-02 07:12:07 -0400539endchoice
540
Radoslaw Koppel26c87762024-01-30 12:32:32 +0100541config LTO
Carles Cufi2fd8cc82024-10-28 12:58:49 +0100542 bool "Link Time Optimization"
Reto Schneider75a38052024-03-19 12:22:48 +0100543 depends on !(GEN_ISR_TABLES || GEN_IRQ_VECTOR_TABLE) || ISR_TABLES_LOCAL_DECLARATION
544 depends on !NATIVE_LIBRARY
545 depends on !CODE_DATA_RELOCATION
Radoslaw Koppel26c87762024-01-30 12:32:32 +0100546 help
547 This option enables Link Time Optimization.
548
Nikolay Agishev0dec4cf2022-12-22 15:46:04 +0400549config COMPILER_WARNINGS_AS_ERRORS
550 bool "Treat warnings as errors"
551 help
552 Turn on "warning as error" toolchain flags
553
Fabio Baltieri3f8f7132023-03-29 10:11:46 +0100554config COMPILER_SAVE_TEMPS
555 bool "Save temporary object files"
556 help
557 Instruct the compiler to save the temporary intermediate files
558 permanently. These can be useful for troubleshooting build issues.
559
Gerard Marull-Paretas99ebe392023-05-05 09:58:12 +0200560config COMPILER_TRACK_MACRO_EXPANSION
561 bool "Track macro expansion"
562 default y
563 help
564 When enabled, locations of tokens across macro expansions will be
565 tracked. Disabling this option may be useful to debug long macro
566 expansion chains.
567
Arvin Farahmande430b7b2021-04-15 11:20:10 -0400568config COMPILER_COLOR_DIAGNOSTICS
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +0100569 bool "Colored diagnostics"
Arvin Farahmande430b7b2021-04-15 11:20:10 -0400570 default y
571 help
572 Compiler diagnostic messages are colorized.
573
Keith Packard62bc9bf2022-04-26 19:24:11 -0700574choice COMPILER_SECURITY_FORTIFY
575 prompt "Detect buffer overflows in libc calls"
Alberto Escolar Piedras56dc20e2023-05-26 13:23:43 +0200576 default FORTIFY_SOURCE_NONE if NO_OPTIMIZATIONS || MINIMAL_LIBC || NATIVE_BUILD
Keith Packard62bc9bf2022-04-26 19:24:11 -0700577 default FORTIFY_SOURCE_COMPILE_TIME
578 help
579 Buffer overflow checking in libc calls. Supported by Clang and
580 GCC when using Picolibc or Newlib. Requires compiler optimization
581 to be enabled.
582
583config FORTIFY_SOURCE_NONE
584 bool "No detection"
585 help
586 Disables both compile-time and run-time checking.
587
588config FORTIFY_SOURCE_COMPILE_TIME
589 bool "Compile-time detection"
590 help
591 Enables only compile-time checking. Compile-time checking
592 doesn't increase executable size or reduce performance, it
593 limits checking to what can be done with information available
594 at compile time.
595
596config FORTIFY_SOURCE_RUN_TIME
597 bool "Compile-time and run-time detection"
598 help
599 Enables both compile-time and run-time checking. Run-time
600 checking increases coverage at the expense of additional code,
601 and means that applications will raise a runtime exception
602 when buffer overflow is detected.
603
604endchoice
605
Anas Nashif86ad37a2018-11-02 07:12:07 -0400606config COMPILER_OPT
607 string "Custom compiler options"
608 help
609 This option is a free-form string that is passed to the compiler
610 when building all parts of a project (i.e. kernel).
611 The compiler options specified by this string supplement the
612 predefined set of compiler supplied by the build system,
613 and can be used to change compiler optimization, warning and error
614 messages, and so on.
615
Martí Bolívare5cc8542021-05-21 10:56:23 -0700616config MISRA_SANE
617 bool "MISRA standards compliance features"
618 help
619 Causes the source code to build in "MISRA" mode, which
620 disallows some otherwise-permitted features of the C
621 standard for safety reasons. Specifically variable length
622 arrays are not permitted (and gcc will enforce this).
623
Anas Nashif86ad37a2018-11-02 07:12:07 -0400624endmenu
625
Anas Nashif22b95a22019-11-24 11:28:38 -0500626choice
627 prompt "Error checking behavior for CHECK macro"
628 default RUNTIME_ERROR_CHECKS
629
630config ASSERT_ON_ERRORS
631 bool "Assert on all errors"
632 help
Henrik Brix Andersen8261a4b2024-04-16 19:03:45 +0000633 Assert on errors covered with the CHECKIF() macro.
Anas Nashif22b95a22019-11-24 11:28:38 -0500634
635config NO_RUNTIME_CHECKS
636 bool "No runtime error checks"
637 help
Henrik Brix Andersen8261a4b2024-04-16 19:03:45 +0000638 Do not do any runtime checks or asserts when using the CHECKIF() macro.
Anas Nashif22b95a22019-11-24 11:28:38 -0500639
640config RUNTIME_ERROR_CHECKS
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +0100641 bool "Runtime error checks"
Anas Nashif22b95a22019-11-24 11:28:38 -0500642 help
Henrik Brix Andersen8261a4b2024-04-16 19:03:45 +0000643 Always perform runtime checks covered with the CHECKIF() macro. This
Anas Nashif22b95a22019-11-24 11:28:38 -0500644 option is the default and the only option used during testing.
645
646endchoice
647
Anas Nashif86ad37a2018-11-02 07:12:07 -0400648menu "Build Options"
649
650config KERNEL_BIN_NAME
651 string "The kernel binary name"
652 default "zephyr"
653 help
654 This option sets the name of the generated kernel binary.
655
656config OUTPUT_STAT
657 bool "Create a statistics file"
658 default y
659 help
660 Create a stat file using readelf -e <elf>
661
Anas Nashif47a673f2022-06-27 10:08:37 -0400662config OUTPUT_SYMBOLS
663 bool "Create a symbol file"
664 help
665 Create a symbol file using nm <elf>
666
Anas Nashif86ad37a2018-11-02 07:12:07 -0400667config OUTPUT_DISASSEMBLY
668 bool "Create a disassembly file"
Anas Nashif86ad37a2018-11-02 07:12:07 -0400669 help
670 Create an .lst file with the assembly listing of the firmware.
671
Rohit Gujarathi35713f22020-05-07 10:08:37 +0530672config OUTPUT_DISASSEMBLE_ALL
673 bool "Disassemble all sections with source. Fill zeros."
674 default n
675 depends on OUTPUT_DISASSEMBLY
676 help
677 The .lst file will contain complete disassembly of the firmware
678 not just those expected to contain instructions including zeros
679
Laurentiu Mihalceafb7e9372024-04-16 11:26:01 +0300680config OUTPUT_DISASSEMBLY_WITH_SOURCE
681 bool "Include source code in output disassembly file"
682 default y
683 depends on OUTPUT_DISASSEMBLY && !OUTPUT_DISASSEMBLE_ALL
684 help
685 The .lst file will also contain the source code. Having
686 control over this can be useful for reproducible builds
687 since it can be used to remove one of the elements of
688 the .lst file that can vary across platforms because
689 of reasons such as having ".." include paths.
690
Anas Nashif86ad37a2018-11-02 07:12:07 -0400691config OUTPUT_PRINT_MEMORY_USAGE
692 bool "Print memory usage to stdout"
693 default y
694 help
695 If the toolchain supports it, this option will pass
696 --print-memory-region to the linker when it is doing it's first
697 linker pass. Note that the memory regions are symbolic concepts
698 defined by the linker scripts and do not necessarily map
699 directly to the real physical address space. Take also note that
700 some platforms do two passes of the linker so the results do not
701 match exactly to the final elf file. See also rom_report,
702 ram_report and
703 https://sourceware.org/binutils/docs/ld/MEMORY.html
704
Anas Nashiffdbf2db2020-10-20 14:31:56 -0400705config CLEANUP_INTERMEDIATE_FILES
706 bool "Remove all intermediate files"
707 help
708 Delete intermediate files to save space and cleanup clutter resulting
Filip Kokosinski7388a072023-07-19 15:40:55 +0200709 from the build process. Note this breaks incremental builds, west spdx
710 (Software Bill of Material generation), and maybe others.
Anas Nashiffdbf2db2020-10-20 14:31:56 -0400711
Torsten Rasmussen2e8868c2024-11-28 09:07:00 +0100712config BUILD_GAP_FILL_PATTERN
713 hex "Gap fill pattern"
714 default 0xFF
715 help
716 Pattern used for gap filling of output files.
717 This value should be set to the value of a clean flash as this can
718 significantly reduce flash write times.
719 This setting only defines the gap fill pattern and doesn't enable gap
720 filling.
721 Note: binary files are always gap filled as they contain no address
722 information.
723
Martí Bolívarf39fdc42020-08-06 14:57:17 -0700724config BUILD_NO_GAP_FILL
Torsten Rasmussen2e8868c2024-11-28 09:07:00 +0100725 bool "Don't fill gaps in generated hex/s19 files [DEPRECATED]."
726 select DEPRECATED
Martí Bolívarf39fdc42020-08-06 14:57:17 -0700727
Anas Nashif86ad37a2018-11-02 07:12:07 -0400728config BUILD_OUTPUT_HEX
729 bool "Build a binary in HEX format"
730 help
Martí Bolívarf39fdc42020-08-06 14:57:17 -0700731 Build an Intel HEX binary zephyr/zephyr.hex in the build directory.
732 The name of this file can be customized with CONFIG_KERNEL_BIN_NAME.
Anas Nashif86ad37a2018-11-02 07:12:07 -0400733
Torsten Rasmussen2e8868c2024-11-28 09:07:00 +0100734config BUILD_OUTPUT_HEX_GAP_FILL
735 bool "Fill gaps in hex files"
736 depends on !BUILD_NO_GAP_FILL
737 help
738 Fill gaps in hex based files.
739
Anas Nashif86ad37a2018-11-02 07:12:07 -0400740config BUILD_OUTPUT_BIN
741 bool "Build a binary in BIN format"
742 default y
743 help
Martí Bolívarf39fdc42020-08-06 14:57:17 -0700744 Build a "raw" binary zephyr/zephyr.bin in the build directory.
745 The name of this file can be customized with CONFIG_KERNEL_BIN_NAME.
Anas Nashif86ad37a2018-11-02 07:12:07 -0400746
Anas Nashif51c34bb2021-01-26 06:58:30 -0500747config BUILD_OUTPUT_EFI
748 bool "Build as an EFI application"
749 default n
750 depends on X86_64
751 help
752 Build as an EFI application.
753
754 This works by creating a "zephyr.efi" EFI binary containing a zephyr
755 image extracted from a built zephyr.elf file. EFI applications are
756 relocatable, and cannot be placed at specific locations in memory.
757 Instead, the stub code will copy the embedded zephyr sections to the
758 appropriate locations at startup, clear any zero-filled (BSS, etc...)
759 areas, then jump into the 64 bit entry point.
760
Anas Nashif86ad37a2018-11-02 07:12:07 -0400761config BUILD_OUTPUT_EXE
762 bool "Build a binary in ELF format with .exe extension"
763 help
Martí Bolívarf39fdc42020-08-06 14:57:17 -0700764 Build an ELF binary that can run in the host system at
765 zephyr/zephyr.exe in the build directory.
766 The name of this file can be customized with CONFIG_KERNEL_BIN_NAME.
Anas Nashif86ad37a2018-11-02 07:12:07 -0400767
768config BUILD_OUTPUT_S19
769 bool "Build a binary in S19 format"
770 help
Martí Bolívarf39fdc42020-08-06 14:57:17 -0700771 Build an S19 binary zephyr/zephyr.s19 in the build directory.
772 The name of this file can be customized with CONFIG_KERNEL_BIN_NAME.
Håkon Øye Amundsenc086b932018-11-26 09:47:16 +0000773
Torsten Rasmussen2e8868c2024-11-28 09:07:00 +0100774config BUILD_OUTPUT_S19_GAP_FILL
775 bool "Fill gaps in s19 files"
776 depends on !BUILD_NO_GAP_FILL
777 help
778 Fill gaps in s19 based files.
779
Pete Johanson310a4642020-12-31 16:51:52 -0500780config BUILD_OUTPUT_UF2
781 bool "Build a binary in UF2 format"
782 depends on BUILD_OUTPUT_BIN
783 help
784 Build a UF2 binary zephyr/zephyr.uf2 in the build directory.
785 The name of this file can be customized with CONFIG_KERNEL_BIN_NAME.
786
787if BUILD_OUTPUT_UF2
788
789config BUILD_OUTPUT_UF2_FAMILY_ID
Pete Johansonff01a002021-02-16 09:35:11 -0500790 string "UF2 device family ID"
Marek Matej6b57b3b2023-07-20 18:24:09 +0200791 default "0x1c5f21b0" if SOC_SERIES_ESP32
Xudong Zheng8db98692022-03-22 12:15:50 -0400792 default "0x621e937a" if SOC_NRF52833_QIAA
Pete Johansonff01a002021-02-16 09:35:11 -0500793 default "0xada52840" if SOC_NRF52840_QIAA
Torsten Rasmussen8dc3f852022-09-14 22:23:15 +0200794 default "0x4fb2d5bd" if SOC_SERIES_IMXRT10XX || SOC_SERIES_IMXRT11XX
Pete Johansonff01a002021-02-16 09:35:11 -0500795 default "0x2abc77ec" if SOC_SERIES_LPC55XXX
Yonatan Schachterefa170f2022-02-01 23:05:04 +0200796 default "0xe48bff56" if SOC_SERIES_RP2XXX
Pete Johansonff01a002021-02-16 09:35:11 -0500797 default "0x68ed2b88" if SOC_SERIES_SAMD21
798 default "0x55114460" if SOC_SERIES_SAMD51
799 default "0x647824b6" if SOC_SERIES_STM32F0X
800 default "0x5d1a0a2e" if SOC_SERIES_STM32F2X
801 default "0x6b846188" if SOC_SERIES_STM32F3X
802 default "0x53b80f00" if SOC_SERIES_STM32F7X
803 default "0x300f5633" if SOC_SERIES_STM32G0X
804 default "0x4c71240a" if SOC_SERIES_STM32G4X
805 default "0x6db66082" if SOC_SERIES_STM32H7X
806 default "0x202e3a91" if SOC_SERIES_STM32L0X
807 default "0x1e1f432d" if SOC_SERIES_STM32L1X
808 default "0x00ff6919" if SOC_SERIES_STM32L4X
809 default "0x04240bdf" if SOC_SERIES_STM32L5X
810 default "0x70d16653" if SOC_SERIES_STM32WBX
811 default "0x5ee21072" if SOC_STM32F103XE
Guillaume Gautier3d423222022-12-21 14:44:45 +0100812 default "0x57755a57" if SOC_SERIES_STM32F4X && (!SOC_STM32F407XE) && (!SOC_STM32F407XG)
Pete Johansonff01a002021-02-16 09:35:11 -0500813 default "0x6d0922fa" if SOC_STM32F407XE
814 default "0x8fb060fe" if SOC_STM32F407XG
Pete Johanson310a4642020-12-31 16:51:52 -0500815 help
816 UF2 bootloaders only accept UF2 files with a matching family ID.
817 This can be either a hex, e.g. 0x68ed2b88, or well-known family
Pete Johansonff01a002021-02-16 09:35:11 -0500818 name string. If the SoC in use is known by UF2, the Family ID will
819 be pre-filled with the known value.
Pete Johanson310a4642020-12-31 16:51:52 -0500820
Peter Johanson3f332072022-01-27 00:45:27 -0500821config BUILD_OUTPUT_UF2_USE_FLASH_BASE
822 bool
823 default n
824
825config BUILD_OUTPUT_UF2_USE_FLASH_OFFSET
826 bool
827 default n
828
Pete Johanson310a4642020-12-31 16:51:52 -0500829endif # BUILD_OUTPUT_UF2
830
Anas Nashif86ad37a2018-11-02 07:12:07 -0400831config BUILD_OUTPUT_STRIPPED
832 bool "Build a stripped binary"
833 help
Martí Bolívarf39fdc42020-08-06 14:57:17 -0700834 Build a stripped binary zephyr/zephyr.strip in the build directory.
835 The name of this file can be customized with CONFIG_KERNEL_BIN_NAME.
Anas Nashif86ad37a2018-11-02 07:12:07 -0400836
Noah Pendleton265da0d2024-05-08 06:21:52 -0400837config BUILD_OUTPUT_COMPRESS_DEBUG_SECTIONS
838 bool "Compress debug sections in the ELF file"
839 help
840 Compress debug sections in the ELF file to reduce the file size.
841
Torsten Rasmussend51a67b2022-01-12 14:21:07 +0100842config BUILD_OUTPUT_ADJUST_LMA
843 string
844 help
845 This will adjust the LMA address in the final ELF and hex files with
846 the value provided.
847 This will not affect the internal address symbols inside the image but
848 can be useful when adjusting the LMA address for flash tools or multi
849 stage loaders where a pre-loader may copy image to a second location
850 before booting a second core.
851 The value will be evaluated as a math expression, this means that
852 following are valid expression
853 - 1024
854 - 0x1000
855 - -0x1000
856 - 0x20000000 - 0x10000000
857 Note: negative numbers are valid.
858 To adjust according to a chosen flash partition one can specify a
859 default as:
860 DT_CHOSEN_IMAGE_<name> := <name>,<name>-partition
861 DT_CHOSEN_Z_FLASH := zephyr,flash
862 config BUILD_OUTPUT_ADJUST_LMA
863 default "$(dt_chosen_reg_addr_hex,$(DT_CHOSEN_IMAGE_M4))-\
864 $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_FLASH))"
865
Grzegorz Swiderskif2dc4a02024-01-24 09:41:20 +0100866config BUILD_OUTPUT_ADJUST_LMA_SECTIONS
867 def_string "*"
868 depends on BUILD_OUTPUT_ADJUST_LMA!=""
869 help
870 This determines the output sections to which the above LMA adjustment
871 will be applied.
872 The value can be the name of a section in the final ELF, like "text".
873 It can also be a pattern with wildcards, such as "*bss", which could
874 match more than one section name. Multiple such patterns can be given
875 as a ";"-separated list. It's possible to supply a 'negative' pattern
876 starting with "!", to exclude sections matched by a preceding pattern.
877
878 By default, all sections will have their LMA adjusted. The following
879 example excludes one section produced by the code relocation feature:
880 config BUILD_OUTPUT_ADJUST_LMA_SECTIONS
881 default "*;!.extflash_text_reloc"
882
Torsten Rasmussenc8ddc342022-01-10 11:02:26 +0100883config BUILD_OUTPUT_INFO_HEADER
884 bool "Create a image information header"
885 help
886 Create an image information header which will contain image
887 information from the Zephyr binary.
888 Example of information contained in the header file:
889 - Number of segments in the image
890 - LMA address of each segment
891 - VMA address of each segment
892 - Size of each segment
893
Daniel DeGrassed8bdddd2023-07-28 19:47:45 +0000894config BUILD_ALIGN_LMA
895 bool "Align LMA in output image"
896 default y if BUILD_OUTPUT_ADJUST_LMA!=""
897 help
898 Ensure that the LMA for each section in the output image respects
899 the alignment requirements of that section. This is required for
900 some tooling, such as objcopy, to be able to adjust the LMA of the
901 ELF file.
902
Anas Nashif86ad37a2018-11-02 07:12:07 -0400903config APPLICATION_DEFINED_SYSCALL
904 bool "Scan application folder for any syscall definition"
905 help
906 Scan additional folders inside application source folder
907 for application defined syscalls.
908
Sebastian Bøed3a8fd42019-10-17 14:25:34 +0200909config MAKEFILE_EXPORTS
910 bool "Generate build metadata files named Makefile.exports"
911 help
912 Generates a file with build information that can be read by
913 third party Makefile-based build systems.
914
Torsten Rasmussenfffaf052021-10-12 23:08:36 +0200915config BUILD_OUTPUT_META
916 bool "Create a build meta file"
917 help
918 Create a build meta file in the build directory containing lists of:
919 - Zephyr: path and revision (if git repo)
920 - Zephyr modules: name, path, and revision (if git repo)
Torsten Rasmussen64ec6ee2021-11-04 14:28:21 +0100921 - West:
922 - manifest: path and revision
923 - projects: path and revision
924 - Workspace:
925 - dirty: one or more repositories are marked dirty
926 - extra: extra Zephyr modules are manually included in the build
927 - off: the SHA of one or more west projects are not what the manifest
928 defined when `west update` was run the last time (`manifest-rev`).
929 The off state is only present if a west workspace is found.
Torsten Rasmussenfffaf052021-10-12 23:08:36 +0200930 File extension is .meta
931
Torsten Rasmussen1a519932021-11-04 18:35:50 +0100932config BUILD_OUTPUT_META_STATE_PROPAGATE
933 bool "Propagate module and project state"
934 depends on BUILD_OUTPUT_META
935 help
936 Propagate to state of each module to the Zephyr revision field.
937 If west is used the state of each west project is also propagated to
938 the Zephyr revision field.
939 West manifest repo revision field will also
940 be marked with the same state as the Zephyr revision.
941 The final revision will become: <SHA>-<state1>-<state2>-<state3>...
942 If no states are appended to the SHA it means the build is of a clean
943 tree.
944 - dirty: one or more repositories are marked dirty
945 - extra: extra Zephyr modules are manually included in the build
946 - off: the SHA of one or more west projects are not what the manifest
947 defined when `west update` was run the last time (`manifest-rev`).
948 The off state is only present if a west workspace is found.
949
Martin Jägera0ffaa72023-03-29 16:06:30 +0200950config BUILD_OUTPUT_STRIP_PATHS
951 bool "Strip absolute paths from binaries"
952 default y
953 help
954 If the compiler supports it, strip the ${ZEPHYR_BASE} prefix from the
955 __FILE__ macro used in __ASSERT*, in the
956 .noinit."/home/joe/zephyr/fu/bar.c" section names and in any
957 application code.
958 This saves some memory, stops leaking user locations in binaries, makes
959 failure logs more deterministic and most importantly makes builds more
960 deterministic.
961 Debuggers usually have a path mapping feature to ensure the files are
962 still found.
963
Fabio Baltieri2264c142023-03-09 17:29:54 +0000964config CHECK_INIT_PRIORITIES
965 bool "Build time initialization priorities check"
Fabio Baltieri058f2562023-03-10 17:26:35 +0000966 default y
Alberto Escolar Piedras9bb708e2023-11-23 15:27:09 +0100967 # If we are building a native_simulator target, we can only check the init priorities
968 # if we are building the final output but we are not assembling several images together
969 depends on !(NATIVE_LIBRARY && (!BUILD_OUTPUT_EXE || NATIVE_SIMULATOR_EXTRA_IMAGE_PATHS != ""))
Fabio Baltieri4a556a92023-09-18 11:35:35 +0000970 depends on "$(ZEPHYR_TOOLCHAIN_VARIANT)" != "armclang"
Fabio Baltieri2264c142023-03-09 17:29:54 +0000971 help
972 Check the build for initialization priority issues by comparing the
973 initialization priority in the build with the device dependency
974 derived from the devicetree definition.
975
976 Fails the build on priority errors (dependent devices, inverted
Fabio Baltieri2a70c312023-10-27 09:27:48 +0000977 priority).
Fabio Baltieri2264c142023-03-09 17:29:54 +0000978
Daniel Leung80e78202023-05-25 11:41:48 -0700979config EMIT_ALL_SYSCALLS
980 bool "Emit all possible syscalls in the tree"
981 help
982 This tells the build system to emit all possible syscalls found
983 in the tree, instead of only those syscalls associated with enabled
984 drivers and subsystems.
985
Anas Nashif86ad37a2018-11-02 07:12:07 -0400986endmenu
Torsten Rasmussen1c911292021-03-22 14:29:38 +0100987
Torsten Rasmussen6066ab42022-07-15 12:05:04 +0200988config DEPRECATED
989 bool
990 help
991 Symbol that must be selected by a feature or module if it is
992 considered to be deprecated.
Alberto Escolar Piedras50145bb2024-08-13 10:30:22 +0200993 When adding this to an option, remember to follow the instructions in
994 https://docs.zephyrproject.org/latest/develop/api/api_lifecycle.html#deprecated
Torsten Rasmussen6066ab42022-07-15 12:05:04 +0200995
996config WARN_DEPRECATED
997 bool
998 default y
999 prompt "Warn on deprecated usage"
1000 help
1001 Print a warning when the Kconfig tree is parsed if any deprecated
1002 features are enabled.
1003
Torsten Rasmussen1c911292021-03-22 14:29:38 +01001004config EXPERIMENTAL
1005 bool
1006 help
1007 Symbol that must be selected by a feature if it is considered to be
1008 at an experimental implementation stage.
1009
1010config WARN_EXPERIMENTAL
1011 bool
1012 prompt "Warn on experimental usage"
1013 help
1014 Print a warning when the Kconfig tree is parsed if any experimental
1015 features are enabled.
1016
Carles Cufid800ccc2022-08-22 18:38:16 +02001017config TAINT
1018 bool
1019 help
1020 Symbol that must be selected by a feature or module if the Zephyr
1021 build is considered tainted.
1022
Nicolas Pitre0a386db2022-06-20 13:18:14 -04001023config ENFORCE_ZEPHYR_STDINT
1024 bool
1025 prompt "Enforce Zephyr convention for stdint"
1026 depends on !ARCH_POSIX
1027 default y
1028 help
1029 This enforces the Zephyr stdint convention where int32_t = int,
1030 int64_t = long long, and intptr_t = long so that short string
1031 format length modifiers can be used universally across ILP32
1032 and LP64 architectures. Sometimes this is not possible e.g. when
1033 linking against a binary-only C++ library whose type mangling
1034 is incompatible with the Zephyr convention, or if the build
1035 environment doesn't allow such enforcement, in which case this
1036 should be turned off with the caveat that argument type validation
1037 on Zephyr code will be skipped.
1038
Anas Nashif86ad37a2018-11-02 07:12:07 -04001039endmenu
1040
1041
1042menu "Boot Options"
1043
1044config IS_BOOTLOADER
1045 bool "Act as a bootloader"
1046 depends on XIP
1047 depends on ARM
1048 help
1049 This option indicates that Zephyr will act as a bootloader to execute
1050 a separate Zephyr image payload.
1051
Michael Hope8c1f1862020-06-13 21:32:11 +02001052config BOOTLOADER_BOSSA
1053 bool "BOSSA bootloader support"
1054 select USE_DT_CODE_PARTITION
Michael Hope8c1f1862020-06-13 21:32:11 +02001055
1056 help
1057 Signifies that the target uses a BOSSA compatible bootloader. If CDC
1058 ACM USB support is also enabled then the board will reboot into the
1059 bootloader automatically when bossac is run.
1060
1061config BOOTLOADER_BOSSA_DEVICE_NAME
1062 string "BOSSA CDC ACM device name"
1063 depends on BOOTLOADER_BOSSA && CDC_ACM_DTE_RATE_CALLBACK_SUPPORT
1064 default "CDC_ACM_0"
1065 help
1066 Sets the CDC ACM port to watch for reboot commands.
1067
1068choice
1069 prompt "BOSSA bootloader variant"
1070 depends on BOOTLOADER_BOSSA
1071
Gerson Fernando Budkef3a7f042021-05-06 21:20:11 -03001072config BOOTLOADER_BOSSA_LEGACY
1073 bool "Legacy"
1074 help
1075 Select the Legacy variant of the BOSSA bootloader. This is defined
1076 for compatibility mode only. The recommendation is use newer
1077 versions like Arduino or Adafruit UF2.
1078
Michael Hope8c1f1862020-06-13 21:32:11 +02001079config BOOTLOADER_BOSSA_ARDUINO
1080 bool "Arduino"
1081 help
1082 Select the Arduino variant of the BOSSA bootloader. Uses 0x07738135
1083 as the magic value to enter the bootloader.
1084
1085config BOOTLOADER_BOSSA_ADAFRUIT_UF2
1086 bool "Adafruit UF2"
1087 help
1088 Select the Adafruit UF2 variant of the BOSSA bootloader. Uses
1089 0xf01669ef as the magic value to enter the bootloader.
1090
1091endchoice
1092
Anas Nashif86ad37a2018-11-02 07:12:07 -04001093endmenu
Yong Cong Sinbbe5e1e2024-01-24 17:35:04 +08001094
1095menu "Compatibility"
1096
1097config LEGACY_GENERATED_INCLUDE_PATH
1098 bool "Legacy include path for generated headers"
1099 default y
1100 help
1101 Allow applications and libraries to use the Zephyr legacy include
1102 path for the generated headers which does not use the `zephyr/` prefix.
1103
1104 From now on, i.e., the preferred way to include the `version.h` header is to
1105 use <zephyr/version.h>, this Kconfig is currently enabled by default so that
1106 user applications won't immediately fail to compile.
1107
1108 This Kconfig will be deprecated and eventually removed in the future releases.
1109
1110endmenu