Skip to content

zephyr: Add a bool Kconfig option for swap move #1352

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

Merged
merged 1 commit into from
Sep 23, 2022

Conversation

d3zd3z
Copy link
Member

@d3zd3z d3zd3z commented Apr 26, 2022

The Kconfig system used by Zephyr does not allow the defaults for choice
options to be overridden. To compensate for this, create a new boolean
config option that will determine what the default is for the boot mode.

This allows the kconfig override file for various Zephyr boards to
change the default to swap move.

Signed-off-by: David Brown [email protected]

The Kconfig system used by Zephyr does not allow the defaults for choice
options to be overridden.  To compensate for this, create a new boolean
config option that will determine what the default is for the boot mode.

This allows the kconfig override file for various Zephyr boards to
change the default to swap move.

Signed-off-by: David Brown <[email protected]>
@d3zd3z d3zd3z marked this pull request as draft April 26, 2022 20:52
@d3zd3z
Copy link
Member Author

d3zd3z commented Apr 26, 2022

Making this a draft for additional integration testing with Zephyr.

@gustavonihei gustavonihei added the area: zephyr Affects the Zephyr port label May 18, 2022
@d3zd3z d3zd3z marked this pull request as ready for review May 24, 2022 15:32
@d3zd3z d3zd3z requested review from nvlsianpu and utzig May 24, 2022 15:32
@d3zd3z
Copy link
Member Author

d3zd3z commented May 24, 2022

I think this should be benign until other changes are made in Zephyr, so it'd be nice to get this in, so we can work toward getting Zephyr transitioned to using it.

@nvlsianpu
Copy link
Collaborator

The Kconfig system used by Zephyr does not allow the defaults for choice
options to be overridden.

For named choice (like that one you modified) you can modify it using additional Kconfig.
An example of this https://github.com/nrfconnect/sdk-nrf/blob/main/drivers/mpsl/flash_sync/Kconfig#L9, choice SOC_FLASH_NRF_RADIO_SYNC_CHOICE is originated from zephyr.

Although override a choice might be unproductive for this particular need.

@d3zd3z
Copy link
Member Author

d3zd3z commented May 31, 2022

For named choice (like that one you modified) you can modify it using additional Kconfig.

I'd be open to suggestions on how to make this work, but what you've suggested definitely doesn't work when used in a Kconfig.defconfig file. It is stated in the Kconfig documentation that this is a limitation.

@@ -194,10 +194,21 @@ config BOOT_VALIDATE_SLOT0_ONCE
low end devices with as a compromise lowering the security level.
If unsure, leave at the default value.

config BOOT_PREFER_SWAP_MOVE
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would name this option with prefix MCUBOOT instead of BOOT - reason is that this will be used from boards defconfig files in zephyr, this would be right visible that it is for MCUBOOT.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@d3zd3z One nit ^^

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, it makes it different than the rest of the options, but I can certainly do it that way if that makes it clearer.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thinking more about this. I don't think it makes sense to add an MCUBOOT prefix to this, unless we change all of the rest of the options as well. This is the Zephyr config file, and any of these will be showing up in board defconfigs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

okay, I won't insist

@@ -194,10 +194,21 @@ config BOOT_VALIDATE_SLOT0_ONCE
low end devices with as a compromise lowering the security level.
If unsure, leave at the default value.

config BOOT_PREFER_SWAP_MOVE
Copy link
Collaborator

Choose a reason for hiding this comment

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

okay, I won't insist

@nvlsianpu nvlsianpu merged commit 08a30a4 into mcu-tools:main Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: zephyr Affects the Zephyr port
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants