Add STM32CubeProgrammer where it is not available, & make it default flashing method by placing it 1st in board.cmake Before this change, the west runner that's selected when calling 'westflash' without the '--runner ...' option is kind of arbitrary & depends on which runner is 1st in board.cmake file. Another reason this change is needed is that STM32CubeProg is the only available way to check/modify Option Bytes, and to flash code to external Flash on many STM32 boards. This change does not affect 'west debug' behavior, which defaults to the debugger (OpenOCD/JLink) that is included first in board.cmake Signed-off-by: Abderrahmane Jarmouni <git@jarmouni.me>
27 lines
852 B
CMake
27 lines
852 B
CMake
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
if(CONFIG_BUILD_WITH_TFM)
|
|
set(FLASH_BASE_ADDRESS_S 0x0C000000)
|
|
|
|
# Flash merged TF-M + Zephyr binary
|
|
set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex)
|
|
|
|
if (CONFIG_HAS_FLASH_LOAD_OFFSET)
|
|
MATH(EXPR TFM_HEX_BASE_ADDRESS_NS "${FLASH_BASE_ADDRESS_S}+${CONFIG_FLASH_LOAD_OFFSET}")
|
|
else()
|
|
set(TFM_HEX_BASE_ADDRESS_NS ${TFM_FLASH_BASE_ADDRESS_S})
|
|
endif()
|
|
endif()
|
|
|
|
# keep first
|
|
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
|
|
|
|
set_ifndef(BOARD_DEBUG_RUNNER pyocd)
|
|
set_ifndef(BOARD_FLASH_RUNNER pyocd)
|
|
|
|
board_runner_args(pyocd "--target=stm32l552zetxq")
|
|
|
|
# keep first
|
|
include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)
|
|
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
|
|
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
|