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

sysbuild: Add alternative hex file and sysbuild signing script support #1370

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

nordicjm
Copy link
Contributor

[nrf noup] cmake: flash: Add support for alternative hex file

Adds support for an alternative hex file, this is needed for
sysbuild partition manager to flash the combined hex file

[nrf fromlist] cmake: Add support for sysbuild-set signing script

Allows a sysbuild project to specify a signing script file to
use instead of the default zephyr one

Comment on lines 45 to 47
if(SYSBUILD AND DEFINED alt_file)
set(hex "${alt_file}")
else()
Copy link
Contributor

Choose a reason for hiding this comment

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

not directly related to those changes themselves, but I was wondering if this would be a use-case where sysbuild should be able to support flashing of specific binaries / hex files.

That way, sysbuild could mark the app image as build only, and instead specify its own alternate image as a custom hex file to flash.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could be a possible expansion, though there area things like zephyrproject-rtos/zephyr#64551 which throw a spanner in the works

Copy link
Contributor

Choose a reason for hiding this comment

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

not directly related to those changes themselves, but I was wondering if this would be a use-case where sysbuild should be able to support flashing of specific binaries / hex files.

it is not support well for west flash, as it heavyily depends on CMakeCache.txt and runners.yaml, which is generated by west build

Copy link
Contributor

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

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

minor nit, but otherwise looks good.

if(CONFIG_BUILD_OUTPUT_HEX)
get_runners_prop(hex_file hex "${KERNEL_HEX_NAME}")
if(SYSBUILD AND DEFINED alt_file)
Copy link
Contributor

Choose a reason for hiding this comment

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

you already tested for if(SYSBUILD) above, so if SYSBUILD is false then alt_file will be undefined.

So would be enough to just do:

Suggested change
if(SYSBUILD AND DEFINED alt_file)
if(DEFINED alt_file)

nordicjm and others added 2 commits November 13, 2023 16:04
Allows a sysbuild project to specify a signing script file to
use instead of the default zephyr one

Upstream PR: zephyrproject-rtos/zephyr#63912

Signed-off-by: Jamie McCrae <[email protected]>
Create dedicated function, sysbuild_cache(), for handling sysbuild's
image specific cache file.

This provides a cleaner handling of said cache file, and provides a
mechanism for updating the cache file at later sysbuild CMake stages.

Upstream PR: zephyrproject-rtos/zephyr#65124

Signed-off-by: Torsten Rasmussen <[email protected]>
@nordicjm nordicjm merged commit c441a8d into nrfconnect:main Nov 14, 2023
8 checks passed
@nordicjm nordicjm deleted the prtodo branch November 6, 2024 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants