mcuboot/boot/cypress
David Brown c06f7bb367 Revert "boot: Add MCUBOOT_HW_KEY support for image encryption"
This reverts commit 0fa46270c0.

This breaks:

    samples/synchronization/sample.kernel.synchronization on
    b_u585i_iot02a/stm32u585xx/ns error

as this TF-M configuration uses its own keys.  This change is an API
change that needs to be coordinated with TF-M changes.

Before this revert, compiling this test results in:

    .../encrypted.c:447: undefined reference to
    `boot_enc_retrieve_private_key`

Signed-off-by: David Brown <david.brown@linaro.org>
2024-07-09 09:19:43 -06:00
..
BlinkyApp doc: Fix case in titles 2021-11-03 17:05:40 +01:00
MCUBootApp Revert "boot: Add MCUBOOT_HW_KEY support for image encryption" 2024-07-09 09:19:43 -06:00
cy_flash_pal flash_map_backend: Remove flash_area_id_to_image_slot 2023-02-14 16:40:21 -07:00
keys Add initial implementation of MCUBoot application for Cypress PSOC6 platform 2020-03-04 13:47:49 +02:00
libs cypress: Update core-lib, mob-pdl-cat1 submodules revision 2021-03-25 13:47:01 +02:00
platforms cypress: Rework makefiles, reorganise source, add 062_1M and 062_512k support 2021-03-25 13:47:01 +02:00
.gitignore Add initial implementation of MCUBoot application for Cypress PSOC6 platform 2020-03-04 13:47:49 +02:00
Makefile cypress: Rework makefiles, reorganise source, add 062_1M and 062_512k support 2021-03-25 13:47:01 +02:00
README.md doc: Fix case in titles 2021-11-03 17:05:40 +01:00
common_libs.mk cypress: Rework makefiles, reorganise source, add 062_1M and 062_512k support 2021-03-25 13:47:01 +02:00
host.mk cypress: Rework makefiles, reorganise source, add 062_1M and 062_512k support 2021-03-25 13:47:01 +02:00
platforms.mk cypress: Rework makefiles, reorganise source, add 062_1M and 062_512k support 2021-03-25 13:47:01 +02:00
toolchains.mk cypress: Rework makefiles, reorganise source, add 062_1M and 062_512k support 2021-03-25 13:47:01 +02:00

README.md

Port of MCUBoot library for evaluation with Cypress PSoC 6 chips

Disclaimer

Given solution is included in MCUboot repository with purpose to demonstrate basic consepts and features of MCUboot library on Cypress PSoC 6 device. Applications are created per MCUboot library maintainers requirements. Implemetation differs from conventional and recomended by Cypress Semiconductors development flow for PSoC 6 devices. These applications are not recomended as a starting point for development and should not be considered as supported examples for PSoC 6 devices.

Examples provided to use with ModusToolbox® Software Environment are a recommended reference point to start development of MCUboot based bootloaders for PSoC 6 devices.

Refer to Cypress Semiconductors github page to find examples.

  1. MCUboot-Based Basic Bootloader mtb-example-psoc6-mcuboot-basic
  2. MCUboot-Based Bootloader with Rollback to Factory App in External Flash mtb-example-anycloud-mcuboot-rollback

Solution description

There are two applications implemented:

  • MCUBootApp - PSoC6 MCUboot-based bootloading application;
  • BlinkyApp - simple PSoC6 blinking LED application which is a target of BOOT/UPGRADE;

The default flash map for MCUBootApp implemented is next:

  • [0x10000000, 0x10018000] - MCUBootApp (bootloader) area;
  • [0x10018000, 0x10028000] - primary slot for BlinkyApp;
  • [0x10028000, 0x10038000] - secondary slot for BlinkyApp;
  • [0x10038000, 0x10039000] - scratch area;

The flash map is defined through sysflash.h and cy_flash_map.c.

It is also possible to place secondary (upgrade) slots in external memory module. In this case primary slot can be doubled in size. For more details about External Memory usage, please refer to separate guiding document MCUBootApp/ExternalMemory.md.

MCUBootApp checks image integrity with SHA256, image authenticity with EC256 digital signature verification and uses either completely software implementation of cryptographic functions or accelerated by hardware - both based on Mbed TLS Library.

Downloading solution's assets

There is a set assets required:

  • MCUBooot Library (root repository)
  • PSoC6 Peripheral Drivers Library (PDL)
  • Mbed TLS Cryptographic Library

Those are represented as submodules.

To retrieve source code with subsequent submodules pull:

git clone --recursive https://github.com/mcu-tools/mcuboot.git

Submodules can also be updated and initialized separately:

cd mcuboot
git submodule update --init --recursive

Building solution

Root directory for build is boot/cypress.

This folder contains make files infrastructure for building both MCUboot Bootloader and sample BlinkyApp application used for Bootloader demo functionality.

Instructions on how to build and upload MCUBootApp bootloader application and sample user applocation are located in Readme.md files in corresponding folders.

Supported platforms for MCUboot, BlinkyApp:

  • PSOC_062_2M
  • PSOC_062_1M
  • PSOC_062_512K

Build environment troubleshooting

Following CLI / IDE are supported for project build:

  • Cygwin on Windows systems
  • unix style shells on *nix systems
  • Eclipse / ModusToolbox ("makefile project from existing source")

Make - make sure it is added to system's PATH variable and correct path is first in the list;

Python/Python3 - make sure you have correct path referenced in PATH;

Msys2 - to use systems PATH navigate to msys2 folder, open msys2_shell.cmd, uncomment set MSYS2_PATH_TYPE=inherit, restart MSYS2 shell.

This will inherit system's PATH so should find python3.7 installed in regular way as well as imgtool and its dependencies.