Skip to content

"west flash" is reporting error #82005

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

Closed
aaronyegx opened this issue Nov 26, 2024 · 4 comments · Fixed by #82013
Closed

"west flash" is reporting error #82005

aaronyegx opened this issue Nov 26, 2024 · 4 comments · Fixed by #82013
Assignees
Labels
area: West West utility bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug

Comments

@aaronyegx
Copy link
Collaborator

Describe the bug

"west flash" is broken in the Zephyr latest main branch.

To Reproduce

  1. west build apollo3_evb .\samples\hello_world -p
  2. west flash

Expected behavior

No error reports, the binary can be programmed to the target board.

Impact

Unable to continue the development without "west flash" working.

Logs and console output

Traceback (most recent call last):
File "C:\Python310\Lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python310\Lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Python310\Scripts\west.exe_main
.py", line 7, in
File "C:\Python310\Lib\site-packages\west\app\main.py", line 866, in main
app.run(argv or sys.argv[1:])
File "C:\Python310\Lib\site-packages\west\app\main.py", line 111, in run
self.run_command(argv)
File "C:\Python310\Lib\site-packages\west\app\main.py", line 385, in run_command
self.run_extension(args.command, argv)
File "C:\Python310\Lib\site-packages\west\app\main.py", line 467, in run_extension
self.cmd.run(args, unknown, self.topdir, manifest=self.manifest,
File "C:\Python310\Lib\site-packages\west\commands.py", line 194, in run
self.do_run(args, unknown)
File "C:\ambiqcodes\radio_sw\zephyr\scripts\west_commands\flash.py", line 33, in do_run
do_run_common(self, my_args, runner_args, domain_file=domains_file)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\run_common.py", line 314, in do_run_common
prev_runner = do_run_common_image(command, user_args, user_runner_args, used_cmds,
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\run_common.py", line 489, in do_run_common_image
runner.run(command_name)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\runners\core.py", line 720, in run
self.do_run(command, **kwargs)
do_run_common(self, my_args, runner_args, domain_file=domains_file)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\run_common.py", line 314, in do_run_common
prev_runner = do_run_common_image(command, user_args, user_runner_args, used_cmds,
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\run_common.py", line 489, in do_run_common_image
runner.run(command_name)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\runners\core.py", line 720, in run
self.do_run(command, **kwargs)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\run_common.py", line 314, in do_run_common
prev_runner = do_run_common_image(command, user_args, user_runner_args, used_cmds,
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\run_common.py", line 489, in do_run_common_image
runner.run(command_name)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\runners\core.py", line 720, in run
self.do_run(command, **kwargs)
prev_runner = do_run_common_image(command, user_args, user_runner_args, used_cmds,
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\run_common.py", line 489, in do_run_common_image
runner.run(command_name)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\runners\core.py", line 720, in run
self.do_run(command, **kwargs)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\run_common.py", line 489, in do_run_common_image
runner.run(command_name)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\runners\core.py", line 720, in run
self.do_run(command, **kwargs)
runner.run(command_name)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\runners\core.py", line 720, in run
self.do_run(command, **kwargs)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\runners\core.py", line 720, in run
self.do_run(command, **kwargs)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\runners\jlink.py", line 281, in do_run
self.flash(**kwargs)
self.do_run(command, **kwargs)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\runners\jlink.py", line 281, in do_run
self.flash(**kwargs)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\runners\jlink.py", line 281, in do_run
self.flash(**kwargs)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\runners\jlink.py", line 451, in flash
self.run_flash_cmd(fname, flash_file, **kwargs)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\runners\jlink.py", line 438, in run_flash_cmd
self.run_flash_cmd(fname, flash_file, **kwargs)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\runners\jlink.py", line 438, in run_flash_cmd
self.check_call(cmd, **kwargs)
File "C:\ambiqcodes\radio_sw\zephyr\scripts/west_commands\runners\jlink.py", line 438, in run_flash_cmd
self.check_call(cmd, **kwargs)
self.check_call(cmd, **kwargs)
UnboundLocalError: local variable 'cmd' referenced before assignment

Environment (please complete the following information):

  • OS: Windows
  • Toolchain Zephyr SDK 0.17.0
  • Commit SHA or Version used: f90ce01

Additional context

@aaronyegx aaronyegx added the bug The issue is a bug, or the PR is fixing a bug label Nov 26, 2024
@aaronyegx
Copy link
Collaborator Author

aaronyegx commented Nov 26, 2024

@jcpi-q It is likely the commit in PR #79372 causes the problem:

Commit: dd5874b
Parents: bb3bab7
Author: Jean-Christophe Pince <[email protected]>
Author Date: Mon Sep 30 2024 17:32:16 GMT+0800 (China Standard Time)
Committer: Henrik Brix Andersen <[email protected]>
Committer Date: Tue Nov 26 2024 04:53:43 GMT+0800 (China Standard Time)

jlink: custom flashing support

Allows to use a custom flashing script with jlink runners.

Signed-off-by: Jean-Christophe Pince [email protected]

I think this is the indent issue in the jlink.py file. With the following fix, "west flash" back to normal.
image

@aaronyegx aaronyegx added priority: high High impact/importance bug area: West West utility labels Nov 26, 2024
@aaronyegx
Copy link
Collaborator Author

Hi @kartben @henrikbrixandersen , can you help assign the right person to fix this? Thanks.

@pdgendt
Copy link
Collaborator

pdgendt commented Nov 26, 2024

@aaronyegx please test with #82013

@aaronyegx
Copy link
Collaborator Author

@aaronyegx please test with #82013

This fix works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: West West utility bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants