Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boot: zephyr: add BOOT_MAX_IMG_SECTORS_OVERRIDE #1920

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JordanYates
Copy link

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

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 mcu-tools#1919

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@JordanYates
Copy link
Author

JordanYates commented Mar 15, 2024

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 😄.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zephyr: CONFIG_BOOT_MAX_IMG_SECTORS is not configurable for downstream platforms
2 participants