blob: e195ed31c729caaf9d3e18579fdf1f52d0abc4a5 [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
David B. Kinderac74d8b2017-01-18 17:01:01 -08005# SPDX-License-Identifier: Apache-2.0
Sebastian Bøe4b61bd12018-01-09 14:12:07 +01006
Anas Nashif658f6bc2019-05-28 14:22:51 -04007
Ulf Magnussone63b6522020-01-26 23:47:41 +01008# 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 Magnussonec3eff52018-07-30 10:57:47 +020012#
Ulf Magnussone63b6522020-01-26 23:47:41 +010013# Shield defaults should have precedence over board defaults, which should have
14# precedence over SoC defaults, so include them in that order.
Ulf Magnussonec3eff52018-07-30 10:57:47 +020015#
Ulf Magnussone63b6522020-01-26 23:47:41 +010016# $ARCH and $BOARD_DIR will be glob patterns when building documentation.
Torsten Rasmussen6be1b2a2021-06-02 08:47:21 +020017# This loads custom shields defconfigs (from BOARD_ROOT)
18osource "$(KCONFIG_BINARY_DIR)/Kconfig.shield.defconfig"
19# This loads Zephyr base shield defconfigs
20source "boards/shields/*/Kconfig.defconfig"
21
Ulf Magnussond7130332018-09-05 13:10:19 +020022source "$(BOARD_DIR)/Kconfig.defconfig"
Torsten Rasmussen6be1b2a2021-06-02 08:47:21 +020023
24# This loads custom SoC root defconfigs
25osource "$(KCONFIG_BINARY_DIR)/Kconfig.soc.defconfig"
26# This loads Zephyr base SoC root defconfigs
27osource "soc/$(ARCH)/*/Kconfig.defconfig"
Ulf Magnussonec3eff52018-07-30 10:57:47 +020028
Ioannis Glaropoulosc5203852020-12-07 18:42:52 +010029menu "Modules"
30
Ioannis Glaropoulosc5203852020-12-07 18:42:52 +010031source "modules/Kconfig"
32
33endmenu
34
Anas Nashifabcf2ad2018-09-04 08:32:07 -050035source "boards/Kconfig"
Torsten Rasmussen5f7cc8d2020-07-06 12:53:39 +020036source "soc/Kconfig"
Anas Nashif77ba3c32015-10-09 06:20:52 -040037source "arch/Kconfig"
Anas Nashif77ba3c32015-10-09 06:20:52 -040038source "kernel/Kconfig"
Anas Nashifc6ba67f2017-08-03 07:47:44 -040039source "dts/Kconfig"
Anas Nashif77ba3c32015-10-09 06:20:52 -040040source "drivers/Kconfig"
Anas Nashif0b2c44a2016-05-14 23:10:51 -040041source "lib/Kconfig"
Ramesh Thomase354ad22016-10-29 04:10:36 -070042source "subsys/Kconfig"
Kumar Gala7584a122016-05-24 14:23:26 -050043
Kumar Gala2630fba2020-01-24 09:39:40 -060044osource "$(TOOLCHAIN_KCONFIG_DIR)/Kconfig"
Anas Nashif8017c592019-05-23 17:19:41 -040045
Anas Nashif86ad37a2018-11-02 07:12:07 -040046menu "Build and Link Features"
47
48menu "Linker Options"
49
Daniel Leung6600c642018-10-19 10:15:19 -070050choice
51 prompt "Linker Orphan Section Handling"
52 default LINKER_ORPHAN_SECTION_WARN
53
54config LINKER_ORPHAN_SECTION_PLACE
55 bool "Place"
56 help
57 Linker puts orphan sections in place without warnings
58 or errors.
59
60config LINKER_ORPHAN_SECTION_WARN
61 bool "Warn"
62 help
Anas Nashiff2cb20c2019-06-18 14:45:40 -040063 Linker places the orphan sections in output and issues
Daniel Leung6600c642018-10-19 10:15:19 -070064 warning about those sections.
65
66config LINKER_ORPHAN_SECTION_ERROR
67 bool "Error"
68 help
69 Linker exits with error when an orphan section is found.
70
71endchoice
Anas Nashif86ad37a2018-11-02 07:12:07 -040072
73config HAS_FLASH_LOAD_OFFSET
74 bool
75 help
76 This option is selected by targets having a FLASH_LOAD_OFFSET
77 and FLASH_LOAD_SIZE.
78
Ulf Magnussonfd9981a2019-11-16 01:33:09 +010079if HAS_FLASH_LOAD_OFFSET
80
Ulf Magnusson90b9eb32019-11-16 01:22:16 +010081config USE_DT_CODE_PARTITION
Ulf Magnusson1f9c5f12019-11-16 01:16:57 +010082 bool "Link application into /chosen/zephyr,code-partition from devicetree"
Andrzej Puzdrowski2b1227f2019-03-18 14:02:11 +010083 help
Ulf Magnusson1f9c5f12019-11-16 01:16:57 +010084 When enabled, the application will be linked into the flash partition
85 selected by the zephyr,code-partition property in /chosen in devicetree.
86 When this is disabled, the flash load offset and size can be set manually
87 below.
Andrzej Puzdrowski2b1227f2019-03-18 14:02:11 +010088
Kumar Gala8ce0cf02019-08-28 09:29:26 -050089# Workaround for not being able to have commas in macro arguments
90DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
91
Anas Nashif86ad37a2018-11-02 07:12:07 -040092config FLASH_LOAD_OFFSET
Ulf Magnusson90b9eb32019-11-16 01:22:16 +010093 # Only user-configurable when USE_DT_CODE_PARTITION is disabled
94 hex "Kernel load offset" if !USE_DT_CODE_PARTITION
95 default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION
Anas Nashif86ad37a2018-11-02 07:12:07 -040096 default 0
Anas Nashif86ad37a2018-11-02 07:12:07 -040097 help
98 This option specifies the byte offset from the beginning of flash that
99 the kernel should be loaded into. Changing this value from zero will
100 affect the Zephyr image's link, and will decrease the total amount of
101 flash available for use by application code.
102
103 If unsure, leave at the default value 0.
104
105config FLASH_LOAD_SIZE
Ulf Magnusson90b9eb32019-11-16 01:22:16 +0100106 # Only user-configurable when USE_DT_CODE_PARTITION is disabled
107 hex "Kernel load size" if !USE_DT_CODE_PARTITION
108 default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) if USE_DT_CODE_PARTITION
Anas Nashif86ad37a2018-11-02 07:12:07 -0400109 default 0
Anas Nashif86ad37a2018-11-02 07:12:07 -0400110 help
111 If non-zero, this option specifies the size, in bytes, of the flash
112 area that the Zephyr image will be allowed to occupy. If zero, the
113 image will be able to occupy from the FLASH_LOAD_OFFSET to the end of
114 the device.
115
116 If unsure, leave at the default value 0.
Anas Nashif86ad37a2018-11-02 07:12:07 -0400117
Ulf Magnussonfd9981a2019-11-16 01:33:09 +0100118endif # HAS_FLASH_LOAD_OFFSET
119
Stephanos Ioannidis33224892020-02-10 16:37:24 +0900120config ROM_START_OFFSET
Ole Sæther985446a2019-01-23 14:13:03 +0100121 hex
Stephanos Ioannidis33224892020-02-10 16:37:24 +0900122 prompt "ROM start offset" if !BOOTLOADER_MCUBOOT
Anas Nashif86ad37a2018-11-02 07:12:07 -0400123 default 0x200 if BOOTLOADER_MCUBOOT
124 default 0
125 help
126 If the application is built for chain-loading by a bootloader this
127 variable is required to be set to value that leaves sufficient
Stephanos Ioannidis33224892020-02-10 16:37:24 +0900128 space between the beginning of the image and the start of the first
Anas Nashif86ad37a2018-11-02 07:12:07 -0400129 section to store an image header or any other metadata.
130 In the particular case of the MCUboot bootloader this reserves enough
131 space to store the image header, which should also meet vector table
132 alignment requirements on most ARM targets, although some targets
133 may require smaller or larger values.
134
135config HAVE_CUSTOM_LINKER_SCRIPT
136 bool "Custom linker scripts provided"
137 help
138 Set this option if you have a custom linker script which needed to
139 be define in CUSTOM_LINKER_SCRIPT.
140
141config CUSTOM_LINKER_SCRIPT
142 string "Path to custom linker script"
143 depends on HAVE_CUSTOM_LINKER_SCRIPT
144 help
145 Path to the linker script to be used instead of the one define by the
146 board.
147
148 The linker script must be based on a version provided by Zephyr since
149 the kernel can expect a certain layout/certain regions.
150
151 This is useful when an application needs to add sections into the
152 linker script and avoid having to change the script provided by
153 Zephyr.
154
Anas Nashif86ad37a2018-11-02 07:12:07 -0400155config KERNEL_ENTRY
156 string "Kernel entry symbol"
157 default "__start"
158 help
159 Code entry symbol, to be set at linking phase.
160
Sebastian Bøe3a0597f2019-03-15 14:05:09 +0100161config LINKER_SORT_BY_ALIGNMENT
162 bool "Sort input sections by alignment"
163 default y
164 help
165 This turns on the linker flag to sort sections by alignment
166 in decreasing size of symbols. This helps to minimize
167 padding between symbols.
168
Jordan Yates318ee972021-04-17 20:04:33 +1000169config SRAM_VECTOR_TABLE
170 bool "Place the vector table in SRAM instead of flash"
171 help
172 The option specifies that the vector table should be placed at the
173 start of SRAM instead of the start of flash.
174
Daniel Leungece9cad2021-02-20 11:02:17 -0800175config HAS_SRAM_OFFSET
176 bool
177 help
178 This option is selected by targets that require SRAM_OFFSET.
179
180config SRAM_OFFSET
181 hex "Kernel SRAM offset" if HAS_SRAM_OFFSET
182 default 0
183 help
184 This option specifies the byte offset from the beginning of SRAM
185 where the kernel begins. Changing this value from zero will affect
186 the Zephyr image's link, and will decrease the total amount of
187 SRAM available for use by application code.
188
189 If unsure, leave at the default value 0.
190
Daniel Leungd8127282021-02-24 10:18:34 -0800191menu "Linker Sections"
192
193config LINKER_USE_BOOT_SECTION
194 bool "Enable Usage of Boot Linker Section"
195 help
196 If enabled, the symbols which are needed for the boot process
197 will be put into another linker section reserved for these
198 symbols.
199
200 Requires that boot sections exist in the architecture, SoC,
201 board or custom linker script.
202
Daniel Leung1310ad62021-02-23 13:33:38 -0800203config LINKER_USE_PINNED_SECTION
204 bool "Enable Usage of Pinned Linker Section"
205 help
206 If enabled, the symbols which need to be pinned in memory
207 will be put into another linker section reserved for pinned
208 symbols. During boot, the corresponding memory will be marked
209 as pinned.
210
211 Requires that pinned sections exist in the architecture, SoC,
212 board or custom linker script.
213
Daniel Leungd8127282021-02-24 10:18:34 -0800214endmenu # "Linker Sections"
215
Anas Nashif86ad37a2018-11-02 07:12:07 -0400216endmenu
217
218menu "Compiler Options"
219
Flavio Ceolinb587e8d2020-08-26 09:48:33 -0700220config CODING_GUIDELINE_CHECK
221 bool "Enforce coding guideline rules"
222 help
223 Use available compiler flags to check coding guideline rules during
224 the build.
225
Anas Nashif86ad37a2018-11-02 07:12:07 -0400226config NATIVE_APPLICATION
227 bool "Build as a native host application"
228 help
229 Build as a native application that can run on the host and using
230 resources and libraries provided by the host.
231
232choice
233 prompt "Optimization level"
234 default NO_OPTIMIZATIONS if COVERAGE
235 default DEBUG_OPTIMIZATIONS if DEBUG
236 default SIZE_OPTIMIZATIONS
237 help
238 Note that these flags shall only control the compiler
239 optimization level, and that no extra debug code shall be
240 conditionally compiled based on them.
241
242config SIZE_OPTIMIZATIONS
243 bool "Optimize for size"
244 help
245 Compiler optimizations will be set to -Os independently of other
246 options.
247
248config SPEED_OPTIMIZATIONS
249 bool "Optimize for speed"
250 help
251 Compiler optimizations will be set to -O2 independently of other
252 options.
253
254config DEBUG_OPTIMIZATIONS
255 bool "Optimize debugging experience"
256 help
257 Compiler optimizations will be set to -Og independently of other
258 options.
259
260config NO_OPTIMIZATIONS
261 bool "Optimize nothing"
262 help
263 Compiler optimizations will be set to -O0 independently of other
264 options.
265
266endchoice
267
Arvin Farahmande430b7b2021-04-15 11:20:10 -0400268config COMPILER_COLOR_DIAGNOSTICS
269 bool "Enable colored diganostics"
270 default y
271 help
272 Compiler diagnostic messages are colorized.
273
Anas Nashif86ad37a2018-11-02 07:12:07 -0400274config COMPILER_OPT
275 string "Custom compiler options"
276 help
277 This option is a free-form string that is passed to the compiler
278 when building all parts of a project (i.e. kernel).
279 The compiler options specified by this string supplement the
280 predefined set of compiler supplied by the build system,
281 and can be used to change compiler optimization, warning and error
282 messages, and so on.
283
Martí Bolívare5cc8542021-05-21 10:56:23 -0700284config MISRA_SANE
285 bool "MISRA standards compliance features"
286 help
287 Causes the source code to build in "MISRA" mode, which
288 disallows some otherwise-permitted features of the C
289 standard for safety reasons. Specifically variable length
290 arrays are not permitted (and gcc will enforce this).
291
Anas Nashif86ad37a2018-11-02 07:12:07 -0400292endmenu
293
Anas Nashif22b95a22019-11-24 11:28:38 -0500294choice
295 prompt "Error checking behavior for CHECK macro"
296 default RUNTIME_ERROR_CHECKS
297
298config ASSERT_ON_ERRORS
299 bool "Assert on all errors"
300 help
301 Assert on errors covered with the CHECK macro.
302
303config NO_RUNTIME_CHECKS
304 bool "No runtime error checks"
305 help
306 Do not do any runtime checks or asserts when using the CHECK macro.
307
308config RUNTIME_ERROR_CHECKS
309 bool "Enable runtime error checks"
310 help
311 Always perform runtime checks covered with the CHECK macro. This
312 option is the default and the only option used during testing.
313
314endchoice
315
Anas Nashif86ad37a2018-11-02 07:12:07 -0400316menu "Build Options"
317
318config KERNEL_BIN_NAME
319 string "The kernel binary name"
320 default "zephyr"
321 help
322 This option sets the name of the generated kernel binary.
323
324config OUTPUT_STAT
325 bool "Create a statistics file"
326 default y
327 help
328 Create a stat file using readelf -e <elf>
329
330config OUTPUT_DISASSEMBLY
331 bool "Create a disassembly file"
332 default y
333 help
334 Create an .lst file with the assembly listing of the firmware.
335
Rohit Gujarathi35713f22020-05-07 10:08:37 +0530336config OUTPUT_DISASSEMBLE_ALL
337 bool "Disassemble all sections with source. Fill zeros."
338 default n
339 depends on OUTPUT_DISASSEMBLY
340 help
341 The .lst file will contain complete disassembly of the firmware
342 not just those expected to contain instructions including zeros
343
Anas Nashif86ad37a2018-11-02 07:12:07 -0400344config OUTPUT_PRINT_MEMORY_USAGE
345 bool "Print memory usage to stdout"
346 default y
347 help
348 If the toolchain supports it, this option will pass
349 --print-memory-region to the linker when it is doing it's first
350 linker pass. Note that the memory regions are symbolic concepts
351 defined by the linker scripts and do not necessarily map
352 directly to the real physical address space. Take also note that
353 some platforms do two passes of the linker so the results do not
354 match exactly to the final elf file. See also rom_report,
355 ram_report and
356 https://sourceware.org/binutils/docs/ld/MEMORY.html
357
Anas Nashiffdbf2db2020-10-20 14:31:56 -0400358config CLEANUP_INTERMEDIATE_FILES
359 bool "Remove all intermediate files"
360 help
361 Delete intermediate files to save space and cleanup clutter resulting
362 from the build process.
363
Martí Bolívarf39fdc42020-08-06 14:57:17 -0700364config BUILD_NO_GAP_FILL
365 bool "Don't fill gaps in generated hex/bin/s19 files."
366
Anas Nashif86ad37a2018-11-02 07:12:07 -0400367config BUILD_OUTPUT_HEX
368 bool "Build a binary in HEX format"
369 help
Martí Bolívarf39fdc42020-08-06 14:57:17 -0700370 Build an Intel HEX binary zephyr/zephyr.hex in the build directory.
371 The name of this file can be customized with CONFIG_KERNEL_BIN_NAME.
Anas Nashif86ad37a2018-11-02 07:12:07 -0400372
373config BUILD_OUTPUT_BIN
374 bool "Build a binary in BIN format"
375 default y
376 help
Martí Bolívarf39fdc42020-08-06 14:57:17 -0700377 Build a "raw" binary zephyr/zephyr.bin in the build directory.
378 The name of this file can be customized with CONFIG_KERNEL_BIN_NAME.
Anas Nashif86ad37a2018-11-02 07:12:07 -0400379
Anas Nashif51c34bb2021-01-26 06:58:30 -0500380config BUILD_OUTPUT_EFI
381 bool "Build as an EFI application"
382 default n
383 depends on X86_64
384 help
385 Build as an EFI application.
386
387 This works by creating a "zephyr.efi" EFI binary containing a zephyr
388 image extracted from a built zephyr.elf file. EFI applications are
389 relocatable, and cannot be placed at specific locations in memory.
390 Instead, the stub code will copy the embedded zephyr sections to the
391 appropriate locations at startup, clear any zero-filled (BSS, etc...)
392 areas, then jump into the 64 bit entry point.
393
Anas Nashif86ad37a2018-11-02 07:12:07 -0400394config BUILD_OUTPUT_EXE
395 bool "Build a binary in ELF format with .exe extension"
396 help
Martí Bolívarf39fdc42020-08-06 14:57:17 -0700397 Build an ELF binary that can run in the host system at
398 zephyr/zephyr.exe in the build directory.
399 The name of this file can be customized with CONFIG_KERNEL_BIN_NAME.
Anas Nashif86ad37a2018-11-02 07:12:07 -0400400
401config BUILD_OUTPUT_S19
402 bool "Build a binary in S19 format"
403 help
Martí Bolívarf39fdc42020-08-06 14:57:17 -0700404 Build an S19 binary zephyr/zephyr.s19 in the build directory.
405 The name of this file can be customized with CONFIG_KERNEL_BIN_NAME.
Håkon Øye Amundsenc086b932018-11-26 09:47:16 +0000406
Pete Johanson310a4642020-12-31 16:51:52 -0500407config BUILD_OUTPUT_UF2
408 bool "Build a binary in UF2 format"
409 depends on BUILD_OUTPUT_BIN
410 help
411 Build a UF2 binary zephyr/zephyr.uf2 in the build directory.
412 The name of this file can be customized with CONFIG_KERNEL_BIN_NAME.
413
414if BUILD_OUTPUT_UF2
415
416config BUILD_OUTPUT_UF2_FAMILY_ID
Pete Johansonff01a002021-02-16 09:35:11 -0500417 string "UF2 device family ID"
418 default "0x1c5f21b0" if SOC_ESP32
419 default "0xada52840" if SOC_NRF52840_QIAA
420 default "0x4fb2d5bd" if SOC_SERIES_IMX_RT
421 default "0x2abc77ec" if SOC_SERIES_LPC55XXX
422 default "0x68ed2b88" if SOC_SERIES_SAMD21
423 default "0x55114460" if SOC_SERIES_SAMD51
424 default "0x647824b6" if SOC_SERIES_STM32F0X
425 default "0x5d1a0a2e" if SOC_SERIES_STM32F2X
426 default "0x6b846188" if SOC_SERIES_STM32F3X
427 default "0x53b80f00" if SOC_SERIES_STM32F7X
428 default "0x300f5633" if SOC_SERIES_STM32G0X
429 default "0x4c71240a" if SOC_SERIES_STM32G4X
430 default "0x6db66082" if SOC_SERIES_STM32H7X
431 default "0x202e3a91" if SOC_SERIES_STM32L0X
432 default "0x1e1f432d" if SOC_SERIES_STM32L1X
433 default "0x00ff6919" if SOC_SERIES_STM32L4X
434 default "0x04240bdf" if SOC_SERIES_STM32L5X
435 default "0x70d16653" if SOC_SERIES_STM32WBX
436 default "0x5ee21072" if SOC_STM32F103XE
437 default "0x57755a57" if SOC_STM32F401XC || SOC_STM32F401XE
438 default "0x6d0922fa" if SOC_STM32F407XE
439 default "0x8fb060fe" if SOC_STM32F407XG
Pete Johanson310a4642020-12-31 16:51:52 -0500440 help
441 UF2 bootloaders only accept UF2 files with a matching family ID.
442 This can be either a hex, e.g. 0x68ed2b88, or well-known family
Pete Johansonff01a002021-02-16 09:35:11 -0500443 name string. If the SoC in use is known by UF2, the Family ID will
444 be pre-filled with the known value.
Pete Johanson310a4642020-12-31 16:51:52 -0500445
446endif # BUILD_OUTPUT_UF2
447
Anas Nashif86ad37a2018-11-02 07:12:07 -0400448config BUILD_OUTPUT_STRIPPED
449 bool "Build a stripped binary"
450 help
Martí Bolívarf39fdc42020-08-06 14:57:17 -0700451 Build a stripped binary zephyr/zephyr.strip in the build directory.
452 The name of this file can be customized with CONFIG_KERNEL_BIN_NAME.
Anas Nashif86ad37a2018-11-02 07:12:07 -0400453
454config APPLICATION_DEFINED_SYSCALL
455 bool "Scan application folder for any syscall definition"
456 help
457 Scan additional folders inside application source folder
458 for application defined syscalls.
459
Sebastian Bøed3a8fd42019-10-17 14:25:34 +0200460config MAKEFILE_EXPORTS
461 bool "Generate build metadata files named Makefile.exports"
462 help
463 Generates a file with build information that can be read by
464 third party Makefile-based build systems.
465
Anas Nashif86ad37a2018-11-02 07:12:07 -0400466endmenu
467endmenu
468
469
470menu "Boot Options"
471
472config IS_BOOTLOADER
473 bool "Act as a bootloader"
474 depends on XIP
475 depends on ARM
476 help
477 This option indicates that Zephyr will act as a bootloader to execute
478 a separate Zephyr image payload.
479
480config BOOTLOADER_SRAM_SIZE
481 int "SRAM reserved for bootloader"
482 default 16
483 depends on !XIP || IS_BOOTLOADER
Rajavardhan Gundie584b052018-12-14 16:55:43 +0530484 depends on ARM || XTENSA
Anas Nashif86ad37a2018-11-02 07:12:07 -0400485 help
486 This option specifies the amount of SRAM (measure in kB) reserved for
487 a bootloader image, when either:
488 - the Zephyr image itself is to act as the bootloader, or
489 - Zephyr is a !XIP image, which implicitly assumes existence of a
490 bootloader that loads the Zephyr !XIP image onto SRAM.
491
Håkon Øye Amundsenc92a60b2020-09-17 12:05:15 +0000492config MCUBOOT
493 bool
494 help
495 Hidden option used to indicate that the current image is MCUBoot
496
Anas Nashif86ad37a2018-11-02 07:12:07 -0400497config BOOTLOADER_MCUBOOT
498 bool "MCUboot bootloader support"
Ulf Magnusson90b9eb32019-11-16 01:22:16 +0100499 select USE_DT_CODE_PARTITION
Ioannis Glaropoulos071ab4a2020-10-21 15:56:38 +0200500 imply INIT_ARCH_HW_AT_BOOT if ARCH_SUPPORTS_ARCH_HW_INIT
Håkon Øye Amundsenc92a60b2020-09-17 12:05:15 +0000501 depends on !MCUBOOT
Anas Nashif86ad37a2018-11-02 07:12:07 -0400502 help
503 This option signifies that the target uses MCUboot as a bootloader,
504 or in other words that the image is to be chain-loaded by MCUboot.
505 This sets several required build system and Device Tree options in
506 order for the image generated to be bootable using the MCUboot open
507 source bootloader. Currently this includes:
508
Stephanos Ioannidis33224892020-02-10 16:37:24 +0900509 * Setting ROM_START_OFFSET to a default value that allows space
Anas Nashif86ad37a2018-11-02 07:12:07 -0400510 for the MCUboot image header
Andrzej Puzdrowskic7ab1a12020-07-03 16:01:33 +0200511 * Activating SW_VECTOR_RELAY_CLIENT on Cortex-M0
512 (or Armv8-M baseline) targets with no built-in vector relocation
513 mechanisms
Anas Nashif86ad37a2018-11-02 07:12:07 -0400514
Ioannis Glaropoulos071ab4a2020-10-21 15:56:38 +0200515 By default, this option instructs Zephyr to initialize the core
516 architecture HW registers during boot, when this is supported by
517 the application. This removes the need by MCUboot to reset
518 the core registers' state itself.
519
Martí Bolívarf66a0c32020-08-18 11:28:04 -0700520if BOOTLOADER_MCUBOOT
521
522config MCUBOOT_SIGNATURE_KEY_FILE
523 string "Path to the mcuboot signing key file"
524 default ""
525 help
526 The file contains a key pair whose public half is verified
527 by your target's MCUboot image. The file is in PEM format.
528
529 If set to a non-empty value, the build system tries to
530 sign the final binaries using a 'west sign -t imgtool' command.
531 The signed binaries are placed in the build directory
532 at zephyr/zephyr.signed.bin and zephyr/zephyr.signed.hex.
533
534 The file names can be customized with CONFIG_KERNEL_BIN_NAME.
535 The existence of bin and hex files depends on CONFIG_BUILD_OUTPUT_BIN
536 and CONFIG_BUILD_OUTPUT_HEX.
537
538 This option should contain an absolute path to the same file
539 as the BOOT_SIGNATURE_KEY_FILE option in your MCUboot
540 .config. (The MCUboot config option is used for the MCUboot
541 bootloader image; this option is for your application which
542 is to be loaded by MCUboot. The MCUboot config option can be
543 a relative path from the MCUboot repository root; this option's
544 behavior is undefined for relative paths.)
545
546 If left empty, you must sign the Zephyr binaries manually.
547
548config MCUBOOT_EXTRA_IMGTOOL_ARGS
549 string "Extra arguments to pass to imgtool"
550 default ""
551 help
552 If CONFIG_MCUBOOT_SIGNATURE_KEY_FILE is a non-empty string,
553 you can use this option to pass extra options to imgtool.
554 For example, you could set this to "--version 1.2".
555
556config MCUBOOT_GENERATE_CONFIRMED_IMAGE
Henrik Brix Andersen7e39e1d2020-09-03 20:37:31 +0200557 bool "Also generate a padded, confirmed image"
Martí Bolívarf66a0c32020-08-18 11:28:04 -0700558 help
Henrik Brix Andersen7e39e1d2020-09-03 20:37:31 +0200559 The signed, padded, and confirmed binaries are placed in the build
560 directory at zephyr/zephyr.signed.confirmed.bin and
Martí Bolívarf66a0c32020-08-18 11:28:04 -0700561 zephyr/zephyr.signed.confirmed.hex.
562
563 The file names can be customized with CONFIG_KERNEL_BIN_NAME.
564 The existence of bin and hex files depends on CONFIG_BUILD_OUTPUT_BIN
565 and CONFIG_BUILD_OUTPUT_HEX.
566
567endif # BOOTLOADER_MCUBOOT
568
Anas Nashif86ad37a2018-11-02 07:12:07 -0400569config BOOTLOADER_ESP_IDF
570 bool "ESP-IDF bootloader support"
571 depends on SOC_ESP32
572 help
573 This option will trigger the compilation of the ESP-IDF bootloader
574 inside the build folder.
575 At flash time, the bootloader will be flashed with the zephyr image
576
Michael Hope8c1f1862020-06-13 21:32:11 +0200577config BOOTLOADER_BOSSA
578 bool "BOSSA bootloader support"
579 select USE_DT_CODE_PARTITION
Michael Hope8c1f1862020-06-13 21:32:11 +0200580
581 help
582 Signifies that the target uses a BOSSA compatible bootloader. If CDC
583 ACM USB support is also enabled then the board will reboot into the
584 bootloader automatically when bossac is run.
585
586config BOOTLOADER_BOSSA_DEVICE_NAME
587 string "BOSSA CDC ACM device name"
588 depends on BOOTLOADER_BOSSA && CDC_ACM_DTE_RATE_CALLBACK_SUPPORT
589 default "CDC_ACM_0"
590 help
591 Sets the CDC ACM port to watch for reboot commands.
592
593choice
594 prompt "BOSSA bootloader variant"
595 depends on BOOTLOADER_BOSSA
596
Gerson Fernando Budkef3a7f042021-05-06 21:20:11 -0300597config BOOTLOADER_BOSSA_LEGACY
598 bool "Legacy"
599 help
600 Select the Legacy variant of the BOSSA bootloader. This is defined
601 for compatibility mode only. The recommendation is use newer
602 versions like Arduino or Adafruit UF2.
603
Michael Hope8c1f1862020-06-13 21:32:11 +0200604config BOOTLOADER_BOSSA_ARDUINO
605 bool "Arduino"
606 help
607 Select the Arduino variant of the BOSSA bootloader. Uses 0x07738135
608 as the magic value to enter the bootloader.
609
610config BOOTLOADER_BOSSA_ADAFRUIT_UF2
611 bool "Adafruit UF2"
612 help
613 Select the Adafruit UF2 variant of the BOSSA bootloader. Uses
614 0xf01669ef as the magic value to enter the bootloader.
615
616endchoice
617
Anas Nashif86ad37a2018-11-02 07:12:07 -0400618endmenu
Carlo Caioned048faa2019-12-17 17:13:47 +0000619
620menu "Compatibility"
621
622config COMPAT_INCLUDES
623 bool "Suppress warnings when using header shims"
624 default y
625 help
626 Suppress any warnings from the pre-processor when including
627 deprecated header files.
628
629endmenu