This website requires JavaScript.
Explore
Help
Sign In
OrgZephyr
/
zephyr
mirror of
https://github.com/zephyrproject-rtos/zephyr.git
Watch
1
Star
0
Fork
You've already forked zephyr
0
Code
Issues
Releases
Wiki
Activity
f5a3e77434
zephyr
/
boards
/
arm
/
bbc_microbit
/
board.cmake
3 lines
98 B
CMake
Raw
Normal View
History
Unescape
Escape
scripts: runner: use arguments, not environment vars The various runners (flash/debug scripts) use environment variables to take arguments. This is legacy behavior which is not desirable. Use command line arguments instead. Note: this leaves more general environment variables with publicly documented behavior in place for now, for compatibility, e.g.: ZEPHYR_FLASH_OVER_DFU, OPENSDA_FW, ESP_IDF_PATH, PYOCD_DAPARG For example, when using dfu-util to flash arduino_101, instead of setting DFUUTIL_PID, DFUUTIL_ALT, and DFUUTIL_IMG environment variables, have the script invocation look like this: python3 .../zephyr_flash_debug.py dfu-util flash \ [common arguments omitted] \ --pid=8087:0aba --alt=x86_app \ --img=.../build/zephyr/zephyr.bin Make similar changes for other runners (openocd, etc.) and targets (debug, debugserver). To implement this in the scripts: - have the individual scripts/support/runner/some-runner.py files register their own command line arguments - teach them to construct instances from arguments, not the environment - have zephyr_flash_debug.py request runners to register command line argument parsers, and handle arguments In the build system: - add a new board_runner_args() extension function that board.cmake files can use to add to the zephyr_flash_debug.py command line - adjust cmake/flash/CMakeLists.txt to invoke with arguments - add new helper include files for each runner (like boards/common/dfu-util.board.cmake, etc.), which add default options as needed and then add on overrides from board_runner_args() calls - update board.cmake files to use the new includes and extension This implied some tweaking when using openocd to make the CMake string escaping and unescaping work properly. Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-11-17 06:45:38 +08:00
board_runner_args
(
pyocd
"--target=nrf51"
)
cmake: Use path-corrected version of ZEPHYR_BASE Instead of accessing the environment variable ZEPHYR_BASE every time we require accessing the source code root, use an intermediate variable that has OS path separators correctly set to '/' to avoid issues on Windows. Note: This removes the ZEPHYR_SOURCE_DIR CMake variable. External applications using that will need to change to use the new ZEPHYR_BASE variable. Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-01-11 22:46:44 +08:00
include
(
${
ZEPHYR_BASE
}
/boards/common/pyocd.board.cmake
)