boards: cyw20829: add custom flashloader with 64k of erase block size

Add custom flashloader (for openocd) with 64k of erase block size.
Default one has 512, which cause MCUbootloader overwrite during flash
primary application.

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
This commit is contained in:
Sreeram Tatapudi 2025-04-23 13:00:09 -07:00 committed by Benjamin Cabé
commit 3d26d4cc87
3 changed files with 20 additions and 1 deletions

View file

@ -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)

View file

@ -2,7 +2,6 @@
# Copyright (c) 2018 Linaro Limited.
#
# SPDX-License-Identifier: Apache-2.0
source [find interface/kitprog3.cfg]
transport select swd

View file

@ -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]