Linux Audio

Check our new training course

Embedded Linux Audio

Check our new training course
with Creative Commons CC-BY-SA
lecture materials

Bootlin logo

Elixir Cross Referencer

Loading...
# Copyright Runtime.io 2018. All rights reserved.
# Copyright Nordic Semiconductor ASA 2020-2022. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

menuconfig MCUMGR_CMD_IMG_MGMT
	bool "Mcumgr handlers for image management"
	select FLASH
	select MPU_ALLOW_FLASH_WRITE if ARM_MPU
	select IMG_MANAGER
	select MGMT_MIN_DECODING_LEVEL_2
	help
	  Enables mcumgr handlers for image management

if MCUMGR_CMD_IMG_MGMT

if HEAP_MEM_POOL_SIZE > 0
config IMG_MGMT_USE_HEAP_FOR_FLASH_IMG_CONTEXT
	bool "Use heap mem pool for flash image DFU context"
	help
	  Use heap to allocate flash image upload context, otherwise a static variable will
	  be used. The context object is used by IMG_MANAGER to buffer image writes
	  and has significant size, mainly affected by image write buffer of
	  the CONFIG_IMG_BLOCK_BUF_SIZE size and additional fields that hold the state information
	  (struct flash_img_context).
	  When the option is not enabled it increases static RAM use.
	  Make sure with testing, when enabling the option, that the heap has enough size
	  to allocate this context or it will not be possible to perform DFU; it may also not be
	  possible to allocate such context when heap is under pressure, due to application
	  operation, an issue that should also be addressed within application.
endif

config IMG_MGMT_UL_CHUNK_SIZE
	int "Maximum chunk size for image uploads (DEPRECATED)"
	default 512
	depends on MCUMGR_CMD_IMG_MGMT
	help
	  DEPRECATED: The mcumgr no longer copies chunk of file into intermediate
	  buffer, instead the request transport buffer is used directly to
	  process image chunk.

	  Limits the maximum chunk size for image uploads, in bytes.  A buffer of
	  this size gets allocated on the stack during handling of a image upload
	  command.

config IMG_MGMT_UPDATABLE_IMAGE_NUMBER
	int "Number of supported images"
	default UPDATEABLE_IMAGE_NUMBER
	range 1 2
	help
	  Sets how many application images are supported (pairs of secondary and primary slots).
	  Setting this to 2 requires MCUMGR_BUF_SIZE to be at least 512b.
	  NOTE: The UPDATEABLE_IMAGE_NUMBER of MCUBOOT configuration, even for Zephyr build,
	  needs to be set to the same value; this is due to the fact that the mcumgr uses
	  boot_util and the UPDATEABLE_IMAGE_NUMBER controls number of images supported
	  by that library.

config IMG_MGMT_VERBOSE_ERR
	bool "Verbose error responses when uploading application image"
	select MGMT_VERBOSE_ERR_RESPONSE
	help
	  Add additional "rsn" key to SMP responses, where provided, explaining
	  non-0 "rc" codes.

config IMG_MGMT_DUMMY_HDR
	bool "Return dummy image header data for imgr functions"
	help
	  Returns dummy image header data for imgr functions,
	  useful when there are no images present, Eg: unit tests.

config IMG_MGMT_DIRECT_IMAGE_UPLOAD
	bool "Allow direct image upload"
	help
	  Enables directly uploading image to selected image partition.
	  This changes how "image" is understood by mcumgr: normally the mcumgr allows to upload
	  to first slot of the only image it knows, where image is understood as two slots
	  (two DTS images for Zephyr); this allows to treat every DTS defined image as direct
	  target for upload, and more than two may be used (4 at this time).
	  NOTE: When direct upload is used the image numbers are shifted by + 1, and the default
	  behaviour is, when image is not selected, to upload to image that represents secondary
	  slot in normal operation.

config IMG_MGMT_REJECT_DIRECT_XIP_MISMATCHED_SLOT
	bool "Reject Direct-XIP applications with mismatched address"
	help
	  When enabled, the mcumgr will compare base address of application,
	  encoded into .bin file header with use of imgtool, on upload and will
	  reject binaries that would not be able to start from available
	  Direct-XIP address.
	  The base address can be set, to an image binary header, with imgtool,
	  using the --rom-fixed command line option.

config IMG_MGMT_FRUGAL_LIST
	bool "Omit zero, empty or false values from status list"
	help
	  The status list send back from the device will only be filled with data that is non-zero,
	  non-empty or true.  This option slightly reduces number of bytes transferred back from
	  a device but requires support in client software, which has to default omitted values.
	  Works correctly with mcumgr-cli.

module = MCUMGR_IMG_MGMT
module-str = mcumgr_img_mgmt
source "subsys/logging/Kconfig.template.log_config"

endif