diff --git a/boards/infineon/cyw920829m2evk_02/board.cmake b/boards/infineon/cyw920829m2evk_02/board.cmake index be95fa715a3..833f354b9c0 100644 --- a/boards/infineon/cyw920829m2evk_02/board.cmake +++ b/boards/infineon/cyw920829m2evk_02/board.cmake @@ -2,6 +2,19 @@ # SPDX-License-Identifier: Apache-2.0 board_runner_args(openocd "--target-handle=TARGET.cm33") + +# MCUboot requires a flashloader with 64k erase size, please use 'west blobs fetch hal_infineon' to download it. +if(CONFIG_BOOTLOADER_MCUBOOT) + set(flashloader_blobs_path ${ZEPHYR_HAL_INFINEON_MODULE_DIR}/zephyr/blobs/flashloader/TARGET_CYW920829M2EVK-02) + + if(NOT EXISTS ${flashloader_blobs_path}/CYW208xx_SMIF_64K.FLM) + message(WARNING "MCUboot requires a flashloader with 64k erase size, please use 'west blobs fetch hal_infineon' to download it") + else() + board_runner_args(openocd "--openocd-search=${flashloader_blobs_path}") + board_runner_args(openocd "--config=${BOARD_DIR}/support/openocd_CYW208xx_SMIF_64K.cfg") + endif() +endif() + include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake) board_runner_args(jlink "--device=CYW20829_tm") include (${ZEPHYR_BASE}/boards/common/jlink.board.cmake) diff --git a/boards/infineon/cyw920829m2evk_02/support/openocd.cfg b/boards/infineon/cyw920829m2evk_02/support/openocd.cfg index fe70fb383a8..d6578e98a03 100644 --- a/boards/infineon/cyw920829m2evk_02/support/openocd.cfg +++ b/boards/infineon/cyw920829m2evk_02/support/openocd.cfg @@ -2,7 +2,6 @@ # Copyright (c) 2018 Linaro Limited. # # SPDX-License-Identifier: Apache-2.0 - source [find interface/kitprog3.cfg] transport select swd diff --git a/boards/infineon/cyw920829m2evk_02/support/openocd_CYW208xx_SMIF_64K.cfg b/boards/infineon/cyw920829m2evk_02/support/openocd_CYW208xx_SMIF_64K.cfg new file mode 100644 index 00000000000..d1f0a09f855 --- /dev/null +++ b/boards/infineon/cyw920829m2evk_02/support/openocd_CYW208xx_SMIF_64K.cfg @@ -0,0 +1,7 @@ +# +# Copyright (c) 2018 Linaro Limited. +# +# SPDX-License-Identifier: Apache-2.0 +set QSPI_FLASHLOADER "CYW208xx_SMIF_64K.FLM" + +source [find openocd.cfg]