File tree Expand file tree Collapse file tree 4 files changed +42
-0
lines changed Expand file tree Collapse file tree 4 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ # SPDX-License-Identifier: Apache-2.0
2+
3+ board_set_sim_runner_ifnset(example)
4+ board_finalize_runner_args(example) # No default arguments to provide.
Original file line number Diff line number Diff line change 33
44board_runner_args(jlink "--device=nrf52" "--speed=4000" )
55board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000" )
6+ board_runner_args(example "--param=foo" )
67
78set (OPENOCD_NRF5_SUBFAMILY "nrf52" )
89
910include (${ZEPHYR_BASE} /boards/common/nrfjprog.board.cmake)
1011include (${ZEPHYR_BASE} /boards/common/jlink.board.cmake)
1112include (${ZEPHYR_BASE} /boards/common/pyocd.board.cmake)
1213include (${ZEPHYR_BASE} /boards/common/openocd-nrf5.board.cmake)
14+ include (${CMAKE_CURRENT_LIST_DIR} /../../common/example_runner.board.cmake)
Original file line number Diff line number Diff line change 1+ # Copyright (c) 2024 Basalte bv
2+ #
3+ # SPDX-License-Identifier: Apache-2.0
4+
5+ from runners .core import RunnerCaps , ZephyrBinaryRunner
6+
7+
8+ class ExampleRunner (ZephyrBinaryRunner ):
9+ """Dummy example runner."""
10+
11+ def __init__ (self , cfg , param ):
12+ super ().__init__ (cfg )
13+ self .param = param
14+
15+ @classmethod
16+ def name (cls ):
17+ return "example"
18+
19+ @classmethod
20+ def capabilities (cls ):
21+ return RunnerCaps (commands = ({"simulate" }))
22+
23+ @classmethod
24+ def do_add_parser (cls , parser ):
25+ parser .add_argument ("--param" , action = "store" , help = "An example parameter" )
26+
27+ @classmethod
28+ def do_create (cls , cfg , args ):
29+ return cls (cfg , param = args .param )
30+
31+ def do_run (self , command , ** kwargs ):
32+ self .logger .info (f"Running { command } on { self .param } " )
Original file line number Diff line number Diff line change 1818 # `<dts_root>/dts/bindings` for additional dts binding files. The `.` is
1919 # the root of this repository.
2020 dts_root : .
21+ runners :
22+ # Additional runners, Zephyr will import these when discovering
23+ # subclasses of the `ZephyrBinaryRunner` class.
24+ - file : scripts/example_runner.py
You can’t perform that action at this time.
0 commit comments