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

Incorrect configuration override option for west flash #31630

Closed
rcwoolley opened this issue Jan 26, 2021 · 0 comments · Fixed by #31633
Closed

Incorrect configuration override option for west flash #31630

rcwoolley opened this issue Jan 26, 2021 · 0 comments · Fixed by #31633
Assignees
Labels
area: West West utility bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@rcwoolley
Copy link

rcwoolley commented Jan 26, 2021

Describe the bug

The documentation for West on "Building, Flashing and Debugging" has as section entitled "Configuration Overrides". [https://docs.zephyrproject.org/latest/guides/west/build-flash-debug.html#configuration-overrides]
)

It suggests that to specify an alternative HEX file one should execute the flash command with the --kernel-hex option:

west flash --kernel-hex path/to/some/other.hex
The help text for west flash indicates that this option has been renamed to --hex-file:

  -H, --context         print runner- and build-specific help
  --board-dir DIR       board directory
  --elf-file FILE       path to zephyr.elf
  --hex-file FILE       path to zephyr.hex
  --bin-file FILE       path to zephyr.bin
  --gdb GDB             path to GDB
  --openocd OPENOCD     path to openocd
  --openocd-search DIR  path to add to openocd search path, if applicable

I used the following command and it successfully flashed my custom zephyr HEX file:

west flash --hex-file ~/Downloads/zephyr.hex

To Reproduce
Steps to reproduce the behavior:

  1. Build a Zephyr application
  2. Use the --hex-file option to the west flash command to manually specify the zephyr.hex file

Expected behavior
West should successfully flash the device using the custom zephyr.hex file.

Impact
The documentation may lead someone astray with the wrong option. However, the correct option is documented in the tool itself.

Logs and console output
Output of west flash -h:

$ west flash -h                              usage: west flash [-h] [-d DIR] [-r RUNNER] [--skip-rebuild] [-H] [--board-dir DIR] [--elf-file FILE]                                     [--hex-file FILE] [--bin-file FILE] [--gdb GDB] [--openocd OPENOCD] [--openocd-search DIR]                                                                                                                                    Permanently reprogram a board's flash with a new binary.                                                                                                                                                                                        optional arguments:                                                            
  -h, --help            show this help message and exit

general options:
  If the build directory is not given, the default is build/ unless the
  build.dir-fmt configuration variable is set. The current directory is
  checked after that. If either is a Zephyr build directory, it is used.

  -d DIR, --build-dir DIR
                        application build directory
  -r RUNNER, --runner RUNNER
                        override default runner from --build-dir
  --skip-rebuild        do not refresh cmake dependencies first

runner configuration:
  ===================================================================
    IMPORTANT:
    Individual runners support additional options not printed here.
  ===================================================================

  Run "west flash --context" for runner-specific options.

  If a build directory is found, --context also prints per-runner
  settings found in that build directory's runners.yaml file.

  Use "west flash --context -r RUNNER" to limit output to a
  specific RUNNER.

  Some runner settings also can be overridden with options like
  --hex-file. However, this depends on the runner: not all runners
  respect --elf-file / --hex-file / --bin-file, nor use gdb or openocd,
  etc.

  -H, --context         print runner- and build-specific help
  --board-dir DIR       board directory
  --elf-file FILE       path to zephyr.elf
  --hex-file FILE       path to zephyr.hex
  --bin-file FILE       path to zephyr.bin
  --gdb GDB             path to GDB
  --openocd OPENOCD     path to openocd
  --openocd-search DIR  path to add to openocd search path, if applicable

Environment (please complete the following information):

  • OS: Linux (Ubuntu 20.04)
  • Toolchain Zephyr SDK zephyr-sdk-0.12.2
  • Commit SHA or Version used: 58fe3e1

Additional context
Add any other context about the problem here.

The source for the documentation is here: https://github.com/zephyrproject-rtos/zephyr/blob/master/doc/guides/west/build-flash-debug.rst

@rcwoolley rcwoolley added the bug The issue is a bug, or the PR is fixing a bug label Jan 26, 2021
@nashif nashif added area: West West utility priority: low Low impact/importance bug labels Jan 26, 2021
carlescufi added a commit to carlescufi/zephyr that referenced this issue Jan 26, 2021
Fix the documentation of the usage of --*-file, which were renamed from
--kernel-*.

Fixes zephyrproject-rtos#31630.

Signed-off-by: Carles Cufi <[email protected]>
nashif pushed a commit that referenced this issue Jan 26, 2021
Fix the documentation of the usage of --*-file, which were renamed from
--kernel-*.

Fixes #31630.

Signed-off-by: Carles Cufi <[email protected]>
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: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants