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