Use cypress cy-mbedtls-acceleration revision w/o HAL

Signed-off-by: Kostiantyn Tkachov <kotk@cypress.com>
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@cypress.com>
This commit is contained in:
Kostiantyn Tkachov 2020-06-04 21:16:09 +03:00 committed by Roman Okhrimenko
parent 4dc3f442d7
commit 120efee34f
4 changed files with 29 additions and 2 deletions

View File

@ -69,6 +69,24 @@ To get appropriate artifact for second image PRIMARY slot run this command:
*Note:* only 2 images are supported at the moment.
**How to build upgrade image for external memory:**
For prepare MCUBoot to work with external memory please refer to MCUBoot/ExternalMemory.md
For build BlinkyApp upgarde image for external memory use command:
make app APP_NAME=BlinkyApp PLATFORM=PSOC_062_2M IMG_TYPE=UPGRADE HEADER_OFFSET=0x7FE8000 ERASED_VALUE=0xff
`HEADER_OFFSET` defines the offset from original boot image address. This one in line above suggests secondary slot will start from `0x18000000`.
`ERASED_VALUE` defines the memory cell contents in erased state. It is `0x00` for PSoC6's internal Flash and `0xff` for S25FL512S.
In case of using muti-image configuration, upgrade image for second application can be built using next command:
make app APP_NAME=BlinkyApp PLATFORM=PSOC_062_2M IMG_TYPE=UPGRADE HEADER_OFFSET=0x8028000 ERASED_VALUE=0xff
Note: for S25FL512S block address shuld be mutiple by 0x40000
**Post-Build:**
Post build action is executed at compile time for `BlinkyApp`. In case of build for `PSOC_062_2M` platform it calls `imgtool` from `MCUBoot` scripts and adds signature to compiled image.
@ -83,7 +101,7 @@ Hex file names to use for programming:
`BlinkyApp` always produce build artifacts in 2 separate folders - `boot` and `upgrade`.
`BlinkyApp` built to run with `MCUBootApp` produces files with name BlinkyApp.hex in `boot` directory and `BlinkyApp_upgrade.hex` in `upgrade` folder. These files are ready to be flashed to the board.
`BlinkyApp` built to run with `MCUBootApp` produces files with name BlinkyApp.hex in `boot` directory and `BlinkyApp_upgrade.hex` in `upgrade` folder. These files are ready to be flashed to the board.
`BlinkyApp_unsigned.hex` hex file is also preserved in both cases for possible troubleshooting.

View File

@ -28,6 +28,7 @@
COMPILER ?= GCC_ARM
USE_CRYPTO_HW ?= 1
USE_EXTERNAL_FLASH ?= 0
MCUBOOT_IMAGE_NUMBER ?= 1
ifneq ($(COMPILER), GCC_ARM)
@ -45,10 +46,13 @@ DEFINES_APP := -DMBEDTLS_CONFIG_FILE="\"mcuboot_crypto_config.h\""
DEFINES_APP += -DECC256_KEY_FILE="\"keys/$(SIGN_KEY_FILE).pub\""
DEFINES_APP += -DCORE=$(CORE)
DEFINES_APP += -DMCUBOOT_IMAGE_NUMBER=$(MCUBOOT_IMAGE_NUMBER)
ifeq ($(USE_EXTERNAL_FLASH), 1)
DEFINES_APP += -DCY_BOOT_USE_EXTERNAL_FLASH
endif
ifeq ($(USE_CRYPTO_HW), 1)
DEFINES_APP += -DMBEDTLS_USER_CONFIG_FILE="\"mcuboot_crypto_acc_config.h\""
DEFINES_APP += -DCY_CRYPTO_HAL_DISABLE
endif
# Collect MCUBoot sourses
SOURCES_MCUBOOT := $(wildcard $(CURDIR)/../bootutil/src/*.c)

View File

@ -124,12 +124,17 @@ static struct flash_area secondary_2 =
.fa_id = FLASH_AREA_IMAGE_SECONDARY(1),
/* TODO: it is for external flash memory
.fa_device_id = FLASH_DEVICE_EXTERNAL_FLASH(CY_BOOT_EXTERNAL_DEVICE_INDEX), */
#ifndef CY_BOOT_USE_EXTERNAL_FLASH
.fa_device_id = FLASH_DEVICE_INTERNAL_FLASH,
.fa_off = CY_FLASH_BASE +\
CY_BOOT_BOOTLOADER_SIZE +\
CY_BOOT_PRIMARY_1_SIZE +\
CY_BOOT_SECONDARY_1_SIZE +\
CY_BOOT_PRIMARY_2_SIZE,
#else
.fa_device_id = FLASH_DEVICE_EXTERNAL_FLASH(CY_BOOT_EXTERNAL_DEVICE_INDEX),
.fa_off = CY_SMIF_BASE_MEM_OFFSET + 0x40000,
#endif
.fa_size = CY_BOOT_SECONDARY_2_SIZE
};
#endif

@ -1 +1 @@
Subproject commit 33aecf1d51fa63620daa14fe1d75d7bb085b2178
Subproject commit 79a9d8e5e0a98531d8b17f94f3f040359e9cdd9d