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

west: fix for context with sysbuild #87537

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

Conversation

vignesh-aerlync
Copy link

show west flash --context with sysbuild

Copy link

Hello @vignesh-aerlync, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@pdgendt pdgendt requested review from tejlmand and nordicjm March 24, 2025 07:18
@pdgendt pdgendt linked an issue Mar 24, 2025 that may be closed by this pull request
@brycewilkins
Copy link
Contributor

Thanks @vignesh-aerlync for the patch to my issue! I think it makes sense to use the default domain.

@pdgendt
Copy link
Collaborator

pdgendt commented Mar 24, 2025

@vignesh-aerlync please check the contribution guidelines, you need to add a sign-off to your commits.

@vignesh-aerlync
Copy link
Author

sure @pdgendt I will check.

show `west flash --context` with sysbuild

Signed-off-by: Vignesh Pandian <vignesh@aerlync.com>
@vignesh-aerlync
Copy link
Author

@vignesh-aerlync please check the contribution guidelines, you need to add a sign-off to your commits.

Can you please check now.

@vignesh-aerlync
Copy link
Author

Thanks @vignesh-aerlync for the patch to my issue! I think it makes sense to use the default domain.

Welcome! :)

@nordicjm
Copy link
Collaborator

Some things that have been noticed:

  • if you configure a project using cmake, then run west flash --context, it builds, then shows the context
  • if you then edit the sysbuild config using sysbuild_menuconfig to include MCUboot and run the command again... it does not reconfigure, and shows outdated information
  • if you build manually and then run the command, it only shows details about the main application e.g. hello_world

I've not used this feature before, don't know what it's meant to do but doesn't really seem to be working here?

@vignesh-aerlync
Copy link
Author

vignesh-aerlync commented Mar 27, 2025

@nordicjm thank you for your review. I will check.

@vignesh-aerlync
Copy link
Author

Hi @nordicjm

https://docs.zephyrproject.org/latest/develop/west/build-flash-debug.html#runner-specific-overrides

From this document the --context flag in west flash displays runner-specific details, such as available flash runners, their configurations, and supported options. Since sysbuild is not a flash runner, it won’t appear in this output. If you're looking for sysbuild-related information, that is typically managed during the build stage, not flashing.

To get domain-specific details, you can use either of these commands (both will produce the same output):

west flash --domain app --context
west flash --domain mcuboot --context

Let me know if you were expecting different information or if I missed something

@nordicjm
Copy link
Collaborator

So I've tried that in a build without mcuboot but pretended there is mcuboot with west flash --domain mcuboot --context and, strangely, get the output for the default image...

-- west flash: rebuilding
ninja: no work to do.
build configuration:
  build directory: /tmp/aa/zephyr/samples/hello_world/_AA/hello_world
  board: nrf52840dk/nrf52840
  runners.yaml: /tmp/aa/zephyr/samples/hello_world/_AA/hello_world/zephyr/runners.yaml
zephyr runners which support "west flash":
  minichlink, stm32flash, canopen, pyocd, teensy, openocd, nrfjprog,
...

If I then enable MCUboot from sysbuild Kconfig using menuconfig, and run menuconfig again so it reconfigures (because otherwise this is not being detected) then I run the same command again west flash --domain mcuboot --context:

build configuration:
  build directory: /tmp/aa/zephyr/samples/hello_world/_AA/hello_world
  board: nrf52840dk/nrf52840
  runners.yaml: /tmp/aa/zephyr/samples/hello_world/_AA/hello_world/zephyr/runners.yaml
zephyr runners which support "west flash":

it is again giving me the default image context, which it should not

@vignesh-aerlync
Copy link
Author

The --context option dumps runner related information only.
Context is not used to provide domain specific details, in my understanding.
Are you expecting sysbuild related information the command?

cc @brycewilkins

@nordicjm
Copy link
Collaborator

I expect it to to dump the information for that image. Whilst having 2 images might have the same flash runners available, that is not something that is true - a board might contain 2 SoCs, one image per SoC, and the flash runners for each might be completely different. Plus all the context information is wrong, when I do --domain mcuboot none of this is valid because it's showing me details of the hello_world image:

build configuration:
  build directory: /tmp/aa/zephyr/samples/hello_world/_AA/hello_world
  board: nrf52840dk/nrf52840
  runners.yaml: /tmp/aa/zephyr/samples/hello_world/_AA/hello_world/zephyr/runners.yaml
zephyr runners which support "west flash":
...

common runner configuration:
  - build_dir: /tmp/aa/zephyr/samples/hello_world/_AA/hello_world
  - board_dir: /tmp/aa/zephyr/boards/nordic/nrf52840dk
  - elf_file: /tmp/aa/zephyr/samples/hello_world/_AA/hello_world/zephyr/zephyr.elf
...
  - hex_file: /tmp/aa/zephyr/samples/hello_world/_AA/hello_world/zephyr/zephyr.signed.hex
  - bin_file: /tmp/aa/zephyr/samples/hello_world/_AA/hello_world/zephyr/zephyr.signed.bin
...
  jlink arguments from runners.yaml:
    --dt-flash=y
    --device=nRF52840_xxAA
    --speed=4000
...

nrf9160dk comes to mind which has an nrf52840 and nrf9160 on it, if there's one image for each, can see how the context needing to be aware of the domain is important

@vignesh-aerlync
Copy link
Author

Thank you its clear I will look into it.

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

Successfully merging this pull request may close these issues.

west flash --context fails for Sysbuild projects
5 participants