Skip to content

Conversation

@carlescufi
Copy link
Member

See commit messages.

Until now, for historical reasons (see
f42cef9 and
58e0e31), the use of the --erase-mode
command-line switch was reserved for the nRF54L family. But in fact this
can be used (instead of --erase) for any of the Nordic ICs. This patch
extends the usage of this switch regardless of family.

Signed-off-by: Carles Cufi <[email protected]>
@@ -483,12 +485,15 @@ class ZephyrBinaryRunner(abc.ABC):
commands in its constructor. The actual command execution is
handled in the run() method.'''

def __init__(self, cfg: RunnerConfig):
def __init__(self, cfg: RunnerConfig, dry_run: bool=_DRY_RUN):
Copy link
Member Author

@carlescufi carlescufi Oct 21, 2025

Choose a reason for hiding this comment

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

@pdgendt I am fairly sure this will not break out-of-tree runners, but FYI. Also, CC @mbolivar.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm skeptical about this. The reason I made it just for debugging was that some runners are truly interactive and can't work without actually running their commands, because the output of one is used as an input for another.

I'd rather see this dropped from core.py. If you really need this for multiple runners, it would make more sense to me to have this added via RunnerCaps.

Copy link
Member Author

Choose a reason for hiding this comment

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

While adding this via RunnerCaps makes sense, I would still need to modify core.py to do that, and I would also need to somewhat replace the _DRY_RUN global with something in the instance?

For now I will make this nRF-only while we decide.

Copy link
Member Author

Choose a reason for hiding this comment

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

@mbolivar since we are very close to release I've opted to make this specific to a single runner. I may try to generalize this later if it's worth it, because I had to duplicate a tiny bit of code.

Copy link
Contributor

Choose a reason for hiding this comment

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

@carlescufi right, it would still be in core.py but it would be done on a runner-specific basis and as far as I can tell would just end up being an additional common --dry-run argument in ZephyrBinaryRunner.add_parser(), which would be handled by the runners themselves. The debugging option could remain unchanged. What am I missing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nothing at all, all good. I just wanted to make sure to get this in for 4.3.0 @mbolivar. Will follow-up next week.

@zephyrbot zephyrbot added the area: West West utility label Oct 21, 2025
@marc-hb marc-hb removed their request for review October 21, 2025 17:48
@pdgendt pdgendt assigned carlescufi and unassigned pdgendt Oct 22, 2025
pdgendt
pdgendt previously approved these changes Oct 22, 2025
@carlescufi
Copy link
Member Author

@pdgendt I realized I was missing parts of the implementation I had not committed. Can you please take another look?

@carlescufi carlescufi requested a review from pdgendt October 23, 2025 16:51
@carlescufi
Copy link
Member Author

@pdgendt could you refresh your +1 here? thanks!

Copy link
Contributor

@nordic-piks nordic-piks left a comment

Choose a reason for hiding this comment

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

Working fine at CI

In order to allow for users to invoke "west flash" without actual
hardware connected but still running the logic and pregeneration of
commands, specifically the json file.

Signed-off-by: Carles Cufi <[email protected]>
@sonarqubecloud
Copy link

@dkalowsk dkalowsk merged commit 0679c05 into zephyrproject-rtos:main Oct 24, 2025
43 checks passed
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.

7 participants