IRNAS / irnas-east-software

East is a command line meta-tool, useful for creating, managing, and deploying Zephyr or nRF Connect SDK projects.
MIT License
9 stars 1 forks source link

Implement clean, build, flash commands #3

Closed MarkoSagadin closed 1 year ago

MarkoSagadin commented 2 years ago

Context

Clean, build and flash commands are the bare minimum of commands that are needed to build a project. There is no need for the toolchain manager download yet at this stage.

Required steps / Implementation details

Wrappers are needed for later features...

Definition of Done

MarkoSagadin commented 2 years ago

@eva-cerncic @vid553 @TjazVracko

What additional argument options would you like to see added to above three commands? What do you often use? Keep in mind that after this issue is done, the tool we function essentially as a command wrapper.

TjazVracko commented 2 years ago

for west build I use:

  -b BOARD, --board BOARD
                        board to build for
  -d BUILD_DIR, --build-dir BUILD_DIR
                        build directory to create or use
  -t TARGET, --target TARGET
                        run this build system target (try "-t usage" or "-t help")

Example of target usage: west build -t partition_manager_report

for west flash I use:

-d DIR, --build-dir DIR
                        application build directory
-r RUNNER, --runner RUNNER
                        override default runner from --build-dir

and also I often pass the ID of the jlink to use to nrfjprog by using --. For example: west flash -- -i 85642561. This is also useful to pass the --verify flag, since it is not used by default (west flash -- --verify)

------

I would suggest you just pass all arguments after -- to the underlying west call. west already does this to pass commands to nrfjprog, as shown in some of the examples above.

MarkoSagadin commented 2 years ago

Lesson learned:

west init sets the ZEPHYR_BASE variable. We can force this manually with west config call. More info here: https://docs.zephyrproject.org/3.1.0/develop/west/config.html

vid553 commented 2 years ago

I would like to have:

MarkoSagadin commented 2 years ago

Jlink error codes are here:

https://infocenter.nordicsemi.com/pdf/nRF5x_Command_Line_Tools_v1.0.pdf

page 15