Roman Okhrimenko | 89ecdac | 2020-02-28 17:05:55 +0200 | [diff] [blame] | 1 | ### Port of MCUBoot library to be used with Cypress targets |
| 2 | |
| 3 | **Solution Description** |
| 4 | |
| 5 | Given solution demonstrates operation of MCUBoot on Cypress' PSoC6 device. |
| 6 | |
| 7 | There are four applications implemented: |
| 8 | * MCUBootApp - PSoC6 MCUBoot-based bootloading application; |
| 9 | * CypressBootloader - PSoC6 MCUBoot-based Cypress' Secure Boot application; |
| 10 | * SecureBlinkyApp - simple PSoC6 blinking LED application which is a target of BOOT/UPGRADE, running on CM0p and playing a role of SPE; |
| 11 | * BlinkyApp - simple PSoC6 blinking LED application which is a target of BOOT/UPGRADE; |
| 12 | |
| 13 | The default flash map for MCUBootApp implemented is next: |
| 14 | |
| 15 | * [0x10000000, 0x10018000] - MCUBootApp (bootloader) area; |
| 16 | * [0x10018000, 0x10028000] - primary slot for BlinkyApp; |
| 17 | * [0x10028000, 0x10038000] - secondary slot for BlinkyApp; |
| 18 | * [0x10038000, 0x10039000] - scratch area; |
| 19 | |
| 20 | The flash map is defined through sysflash.h and cy_flash_map.c. |
| 21 | |
| 22 | MCUBootApp checks image integrity with SHA256, image authenticity with EC256 digital signature verification and uses completely SW implementation of cryptographic functions based on mbedTLS Library. |
| 23 | |
| 24 | **Downloading Solution's Assets** |
| 25 | |
| 26 | There is a set assets required: |
| 27 | |
| 28 | * MCUBooot Library (root repository) |
| 29 | * PSoC6 BSP Library |
| 30 | * PSoC6 Peripheral Drivers Library (PDL) |
| 31 | * mbedTLS Cryptographic Library |
| 32 | |
| 33 | Those are represented as submodules. |
| 34 | |
| 35 | To retrieve source code with subsequent submodules pull: |
| 36 | |
| 37 | git clone --recursive http://git-ore.aus.cypress.com/repo/cy_mcuboot_project/cy_mcuboot.git |
| 38 | |
| 39 | Submodules can also be updated and initialized separately: |
| 40 | |
| 41 | cd cy_mcuboot |
| 42 | git submodule update --init --recursive |
| 43 | |
| 44 | |
| 45 | |
| 46 | **Building Solution** |
| 47 | |
| 48 | This folder contains make files infrastructure for building both MCUBoot Bootloader, CypressBootloader and sample SecureBlinkyApp and BlinkyApp applications used for Bootloader demo functionality. |
| 49 | |
| 50 | Instructions on how to build and upload Bootloader and sample image are located in `Readme.md` files in corresponding folders. |
| 51 | |
| 52 | Root directory for build is **boot/cypress.** |
| 53 | |
| 54 | **Currently supported platforms:** |
| 55 | |
| 56 | * PSOC_062_2M - for MCUBoot, BlinkyApp; |
| 57 | |
| 58 | * PSOC_064_2M, PSOC_064_1M, PSOC_064_512K - for CypressBootloader, SecureBlinkyApp; |
| 59 | |
| 60 | * PSOC_062_2M, PSOC_064_2M, PSOC_064_1M, PSOC_064_512K - for BlinkyApp; |
| 61 | |
| 62 | **Build environment troubleshooting:** |
| 63 | |
| 64 | Following CLI / IDE are supported for project build: |
| 65 | |
| 66 | * Cygwin on Windows systems |
| 67 | * unix style sheels on *nix systems |
| 68 | * Eclipse / ModusToolbox ("makefile project from existing source") |
| 69 | |
| 70 | *Make* - make sure it is added to system's `PATH` variable and correct path is first in the list; |
| 71 | |
| 72 | *Python/Python3* - make sure you have correct path referenced in `PATH`; |
| 73 | |
| 74 | *Msys2* - to use systems PATH navigate to msys2 folder, open `msys2_shell.cmd`, uncomment set `MSYS2_PATH_TYPE=inherit`, restart MSYS2 shell. |
| 75 | |
| 76 | This will inherit system's PATH so should find `python3.7` installed in regular way as well as imgtool and its dependencies. |
| 77 | |