build: interpose zephyr_flash_debug.py in flash target
Zephyr board flashing and debugging is done via shell scripts. It would improve the CMake transition to remove the shell dependency. Add zephyr_flash_debug.py to allow phasing out the shell scripts. This takes two arguments: - a command (eventually flash, debug, and debugserver, but just flash for now) - the path to the corresponding shell script zephyr_flash_debug.py runs the command in pure Python if it knows how. Otherwise, it falls back on the shell script. In this patch, it always falls back. Subsequent patches add support for existing flash backends. Invoke zephyr_flash_debug.py from the Makefile flash target, but only if USE_ZEPHYR_FLASH_DEBUG_SHELL is empty. This lets users keep existing behavior in case of issues, and can be removed later once the Python script is more widely tested. Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
This commit is contained in:
parent
c136a2eb83
commit
113ee65b89
2 changed files with 111 additions and 0 deletions
6
Makefile
6
Makefile
|
@ -1374,9 +1374,15 @@ run:
|
|||
endif
|
||||
|
||||
ifneq ($(FLASH_SCRIPT),)
|
||||
ifeq ($(USE_ZEPHYR_FLASH_DEBUG_SHELL),)
|
||||
flash: zephyr
|
||||
@echo "Flashing $(BOARD_NAME)"
|
||||
$(Q)$(srctree)/scripts/support/zephyr_flash_debug.py flash $(srctree)/scripts/support/$(FLASH_SCRIPT)
|
||||
else
|
||||
flash: zephyr
|
||||
@echo "Flashing $(BOARD_NAME)"
|
||||
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/support/$(FLASH_SCRIPT) flash
|
||||
endif
|
||||
else
|
||||
flash: FORCE
|
||||
@echo Flashing not supported with this board.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue