blob: 00c3c1080606844d746c82b465097079b0f24bef [file] [log] [blame] [view]
Roman Okhrimenko6ea44be2020-09-24 17:20:15 +03001### Port of MCUBoot library for evaluation with Cypress PSoC 6 chips
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +02002
Roman Okhrimenko6ea44be2020-09-24 17:20:15 +03003### Disclaimer
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +02004
Roman Okhrimenko6ea44be2020-09-24 17:20:15 +03005Given 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.
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +02006
Roman Okhrimenko6ea44be2020-09-24 17:20:15 +03007Examples provided to use with **ModusToolbox® Software Environment** are a recommended reference point to start development of MCUBoot based bootloaders for PSoC 6 devices.
8
9Refer to **Cypress Semiconductors** [github](https://github.com/cypresssemiconductorco) page to find examples.
10
111. MCUboot-Based Basic Bootloader [mtb-example-psoc6-mcuboot-basic](https://github.com/cypresssemiconductorco/mtb-example-psoc6-mcuboot-basic)
122. MCUboot-Based Bootloader with Rollback to Factory App in External Flash [mtb-example-anycloud-mcuboot-rollback](https://github.com/cypresssemiconductorco/mtb-example-anycloud-mcuboot-rollback)
13
14### Solution Description
15
16There are two applications implemented:
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020017* MCUBootApp - PSoC6 MCUBoot-based bootloading application;
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020018* BlinkyApp - simple PSoC6 blinking LED application which is a target of BOOT/UPGRADE;
19
20The default flash map for MCUBootApp implemented is next:
21
22* [0x10000000, 0x10018000] - MCUBootApp (bootloader) area;
23* [0x10018000, 0x10028000] - primary slot for BlinkyApp;
24* [0x10028000, 0x10038000] - secondary slot for BlinkyApp;
25* [0x10038000, 0x10039000] - scratch area;
26
27The flash map is defined through sysflash.h and cy_flash_map.c.
28
Roman Okhrimenko579b30c2021-03-24 13:35:59 +020029It is also possible to place secondary (upgrade) slots in external memory module. In this case primary slot can be doubled in size.
Bohdan Kovalchuka333a452020-07-09 16:55:58 +030030For more details about External Memory usage, please refer to separate guiding document `MCUBootApp/ExternalMemory.md`.
31
Roman Okhrimenko579b30c2021-03-24 13:35:59 +020032MCUBootApp 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 mbedTLS Library.
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020033
Roman Okhrimenko6ea44be2020-09-24 17:20:15 +030034### Downloading Solution's Assets
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020035
36There is a set assets required:
37
38* MCUBooot Library (root repository)
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020039* PSoC6 Peripheral Drivers Library (PDL)
40* mbedTLS Cryptographic Library
41
42Those are represented as submodules.
43
44To retrieve source code with subsequent submodules pull:
45
Fabio Utzigde1d72d2020-11-10 12:35:04 -030046 git clone --recursive https://github.com/mcu-tools/mcuboot.git
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020047
48Submodules can also be updated and initialized separately:
49
Christian Daudte1960a92020-03-04 14:20:33 -080050 cd mcuboot
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020051 git submodule update --init --recursive
52
53
54
Roman Okhrimenko6ea44be2020-09-24 17:20:15 +030055### Building Solution
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020056
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020057Root directory for build is **boot/cypress.**
58
Roman Okhrimenkoaa7c0212020-03-24 23:33:00 +020059This folder contains make files infrastructure for building both MCUBoot Bootloader and sample BlinkyApp application used for Bootloader demo functionality.
60
61Instructions on how to build and upload MCUBootApp bootloader application and sample user applocation are located in `Readme.md` files in corresponding folders.
62
Roman Okhrimenko579b30c2021-03-24 13:35:59 +020063Supported platforms for `MCUBoot`, `BlinkyApp`:
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020064
Roman Okhrimenko579b30c2021-03-24 13:35:59 +020065* PSOC_062_2M
66* PSOC_062_1M
67* PSOC_062_512K
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020068
Roman Okhrimenko6ea44be2020-09-24 17:20:15 +030069### Build environment troubleshooting
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020070
71Following CLI / IDE are supported for project build:
72
73* Cygwin on Windows systems
Christian Daudte1960a92020-03-04 14:20:33 -080074* unix style shells on *nix systems
Roman Okhrimenko89ecdac2020-02-28 17:05:55 +020075* Eclipse / ModusToolbox ("makefile project from existing source")
76
77*Make* - make sure it is added to system's `PATH` variable and correct path is first in the list;
78
79*Python/Python3* - make sure you have correct path referenced in `PATH`;
80
81*Msys2* - to use systems PATH navigate to msys2 folder, open `msys2_shell.cmd`, uncomment set `MSYS2_PATH_TYPE=inherit`, restart MSYS2 shell.
82
83This will inherit system's PATH so should find `python3.7` installed in regular way as well as imgtool and its dependencies.
84