mcuboot icon indicating copy to clipboard operation
mcuboot copied to clipboard

boot: zephyr: add `BOOT_MAX_IMG_SECTORS_OVERRIDE`

Open JordanYates opened this issue 1 year ago • 1 comments

Add a symbol to allow the default value of BOOT_MAX_IMG_SECTORS to be updated by external kconfig files.

${BOARD_ROOT}/board/kconfig.default

// This board requires at least 206 sectors
config BOOT_MAX_IMG_SECTORS_OVERRIDE
	bool "Override default value"
	default y if MCUBOOT

config BOOT_MAX_IMG_SECTORS
	int "Override default value"
	depends on MCUBOOT
	default 256

Resolves #1919

JordanYates avatar Mar 15 '24 04:03 JordanYates

This is not the right way to do this, you can use APPLICATION_CONFIG_DIR to specify a directory that contains the configuration, you would need to copy app.overlay and prj.conf from boot/zephyr then you can add a boards directory with the overlays for each board

So the right way is to:

  1. copy-paste two files to a new location (requiring a manual re-sync each time mcuboot is updated)
  2. create a new tree hierarchy with additional files per board to be supported
  3. Requiring the user to add -DAPPLICATION_CONFIG_PATH=/some/path on each bootloader build
  4. Repeat for each repository that defines boards

Compared to adding the MCUboot configs to the board kconfig.defconfig and everything working by default. I'm not sure I want to do it the right way 😄.

JordanYates avatar Mar 15 '24 08:03 JordanYates

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

github-actions[bot] avatar Sep 12 '24 01:09 github-actions[bot]