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

Can't use west to flash test images into up_squared board. #23004

Closed
chen-png opened this issue Feb 21, 2020 · 2 comments · Fixed by #23027
Closed

Can't use west to flash test images into up_squared board. #23004

chen-png opened this issue Feb 21, 2020 · 2 comments · Fixed by #23027
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug

Comments

@chen-png
Copy link
Collaborator

Describe the bug
when using west flash to download image into up_squared, it met an error "KeyError: 'misc-flasher',
it is that for up_squared, in the runner_config args list, the misc-flasher is NONE, so when invoking "runner_config['args'][runner_name]", it will report an error.

To Reproduce
Steps to reproduce the behavior:

  1. west build -b up_squared -p auto samples/hello_world/
  2. west flash
  3. See error

Screenshots or console output
[ztest@zserver12 zephyr]$ west flash ~/up_squared.sh
-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner misc-flasher
Traceback (most recent call last):
File "/home/ztest/.local/bin/west", line 11, in
sys.exit(main())
File "/home/ztest/.local/lib/python3.6/site-packages/west/main.py", line 583, in main
args.handler(args, unknown)
File "/home/ztest/.local/lib/python3.6/site-packages/west/main.py", line 334, in ext_command_handler
command.run(args, unknown, topdir, manifest=manifest)
File "/home/ztest/.local/lib/python3.6/site-packages/west/commands/init.py", line 118, in run
self.do_run(args, unknown)
File "/home/ztest/work/zephyrproject/zephyr/scripts/west_commands/flash.py", line 30, in do_run
do_run_common(self, my_args, runner_args)
File "/home/ztest/work/zephyrproject/zephyr/scripts/west_commands/run_common.py", line 170, in do_run_common
runner_config['args'][runner_name] +
KeyError: 'misc-flasher'

Environment (please complete the following information):

  • OS: fedora28
  • Toolchain: zephyr-sdk-0.11.1
  • Commit ID: 82e0066
@chen-png chen-png added the bug The issue is a bug, or the PR is fixing a bug label Feb 21, 2020
@chen-png
Copy link
Collaborator Author

@mbolivar Could you take a look of this? it's related to commit" eb95bed".

@mbolivar
Copy link
Contributor

Thanks for the report. I believe #23027 is a fix.

mbolivar pushed a commit to mbolivar/zephyr that referenced this issue Feb 21, 2020
There are two problems with the way runners.yaml is being created:

1. The dictionary which contains the arguments for each runner is
   using the runner's name converted to a C identifier instead of the
   runner's name itself. That causes west flash to fail when the two
   are different, e.g. for 'misc-flasher' (runner name), which is
   different than 'misc_flasher' (runner name as C identifier)

2. We need to make sure that the dictionary key maps to an empty list
   if there are no arguments, which normally doesn't happen since the
   runner usually at least takes the path of the file to flash or debug.
   It does happen in the case of misc-flasher, though, since the whole
   point of that runner is that it's an escape hatch for people with
   out of tree scripts that nevertheless want 'west flash' integration
   for things like sanitycheck device testing.

3. A copy/paste error is setting the debug runner to the flash runner.

Fix them all.

Fixes: zephyrproject-rtos#23004
Signed-off-by: Martí Bolívar <[email protected]>
jhedberg pushed a commit that referenced this issue Feb 24, 2020
There are two problems with the way runners.yaml is being created:

1. The dictionary which contains the arguments for each runner is
   using the runner's name converted to a C identifier instead of the
   runner's name itself. That causes west flash to fail when the two
   are different, e.g. for 'misc-flasher' (runner name), which is
   different than 'misc_flasher' (runner name as C identifier)

2. We need to make sure that the dictionary key maps to an empty list
   if there are no arguments, which normally doesn't happen since the
   runner usually at least takes the path of the file to flash or debug.
   It does happen in the case of misc-flasher, though, since the whole
   point of that runner is that it's an escape hatch for people with
   out of tree scripts that nevertheless want 'west flash' integration
   for things like sanitycheck device testing.

3. A copy/paste error is setting the debug runner to the flash runner.

Fix them all.

Fixes: #23004
Signed-off-by: Martí Bolívar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants