Unverified Commit 33906b47 authored by Andrzej Puzdrowski's avatar Andrzej Puzdrowski Committed by GitHub
Browse files

Merge: synchronize up to mcu-tools/mcuboot/commit/caa1f6bb

Merged by GH web UI, PR #66

synchronization up to https://github.com/mcu-tools/mcuboot/commit/05143ce2361829c4f05e036bdb9177676f9bb297



- Fixed serial recovery skipping on nrf5340
- Fixed issue which caused that progressive's erase feature was off although
was selected by Kconfig (introduced by #42c985ce)
- Added check of reset address in incoming image validation phase, see `CONFIG_MCUBOOT_VERIFY_IMG_ADDRESS`
- Allow image header bigger than 1 KB for encrypted images
- Fixed build with image encryption using RSA (issue introduced by migration to mbedTLS 3.0.0)
- stm32: watchdog support
- many documentation improvements

Signed-off-by: default avatarAndrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
parents 225b0246 caa1f6bb
Loading
Loading
Loading
Loading
+41 −0
Original line number Diff line number Diff line
# SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0

# For development, trigger this on any push.
on:
  push:
    branches:
      - main
  pull_request:

name: Espressif

jobs:
  environment:
    strategy:
      matrix:
        targets: [esp32, esp32s2, esp32c3]
    runs-on: ubuntu-latest
    env:
      MCUBOOT_TARGET: ${{ matrix.targets }}
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0
        submodules: recursive
    - name: Print the environment
      run: |
        uname -a
        lscpu
        free
        pwd
    - name: Signed commit check
      if: ${{ github.event_name == 'pull_request' }}
      run: |
        ./ci/check-signed-off-by.sh
    - name: Espressif install
      run: |
        ./ci/espressif_install.sh
    - name: Espressif run
      run: |
        ./ci/espressif_run.sh
+47 −42
Original line number Diff line number Diff line
@@ -18,60 +18,65 @@

This is MCUboot version 1.8.0

MCUboot is a secure bootloader for 32-bit MCUs. The goal of MCUboot is to
define a common infrastructure for the bootloader, system flash layout on
microcontroller systems, and to provide a secure bootloader that enables
simple software upgrades.

MCUboot is operating system and hardware independent and relies on
hardware porting layers from the operating. Currently, MCUboot works
with both the Apache Mynewt and Zephyr operating systems, but more
ports are planned in the future. RIOT is currently supported as a boot
target with a complete port planned.

## Using MCUboot

Instructions for different operating systems can be found here:
MCUboot is a secure bootloader for 32-bits microcontrollers. It defines a
common infrastructure for the bootloader and the system flash layout on
microcontroller systems, and provides a secure bootloader that enables easy
software upgrade.

MCUboot is not dependent on any specific operating system and hardware and
relies on hardware porting layers from the operating system it works with.
Currently, MCUboot works with the following operating systems and SoCs:
- [Zephyr](https://www.zephyrproject.org/)
- [Apache Mynewt](https://mynewt.apache.org/)
- [Apache NuttX](https://nuttx.apache.org/)
- [RIOT](https://www.riot-os.org/)
- [Mbed OS](https://os.mbed.com/)
- [Espressif IDF](https://idf.espressif.com/)
- [Cypress/Infineon](https://www.cypress.com/)

RIOT is supported only as a boot target. We will accept any new
port contributed by the community once it is good enough.

## MCUboot How-tos

See the following pages for instructions on using MCUboot with different
operating systems and SoCs:
- [Zephyr](docs/readme-zephyr.md)
- [Mynewt](docs/readme-mynewt.md)
- [Apache Mynewt](docs/readme-mynewt.md)
- [Apache NuttX](docs/readme-nuttx.md)
- [RIOT](docs/readme-riot.md)
- [Mbed-OS](docs/readme-mbed.md)
- [NuttX](docs/readme-nuttx.md)
- [Mbed OS](docs/readme-mbed.md)
- [Espressif IDF](docs/readme-espressif.md)
- [Simulator](sim/README.rst)
- [Cypress/Infineon](boot/cypress/readme.md)

There are also instructions for the [Simulator](sim/README.rst).

## Roadmap

The issues being planned and worked on are tracked using GitHub issues. To
participate please visit:

[MCUboot GitHub Issues](https://github.com/mcu-tools/mcuboot/issues)

~~Issues were previously tracked on [MCUboot JIRA](https://runtimeco.atlassian.net/projects/MCUB/summary)
, but it is now deprecated.~~

## Browsing

Information and documentation on the bootloader are stored within the source.
give your input, visit [MCUboot GitHub
Issues](https://github.com/mcu-tools/mcuboot/issues).

~~It was previously also documented on confluence:
[MCUboot Confluence](https://runtimeco.atlassian.net/wiki/discover/all-updates)
however, it is now deprecated and not currently maintained~~
## Source files

For more information in the source, here are some pointers:
You can find additional documentation on the bootloader in the source files.
For more information, use the following links:
- [boot/bootutil](https://github.com/mcu-tools/mcuboot/tree/main/boot/bootutil) - The core of the bootloader itself.
- [boot/boot\_serial](https://github.com/mcu-tools/mcuboot/tree/main/boot/boot_serial) - Support for serial upgrade within the bootloader itself.
- [boot/zephyr](https://github.com/mcu-tools/mcuboot/tree/main/boot/zephyr) - Port of the bootloader to Zephyr.
- [boot/mynewt](https://github.com/mcu-tools/mcuboot/tree/main/boot/mynewt) - Bootloader application for Apache Mynewt.
- [boot/nuttx](https://github.com/mcu-tools/mcuboot/tree/main/boot/nuttx) - Bootloader application and port of MCUboot interfaces for Apache NuttX.
- [boot/mbed](https://github.com/mcu-tools/mcuboot/tree/main/boot/mbed) - Port of the bootloader to Mbed OS.
- [boot/espressif](https://github.com/mcu-tools/mcuboot/tree/main/boot/espressif) - Bootloader application and MCUboot port for Espressif SoCs.
- [boot/cypress](https://github.com/mcu-tools/mcuboot/tree/main/boot/cypress) - Bootloader application and MCUboot port for Cypress/Infineon SoCs.
- [imgtool](https://github.com/mcu-tools/mcuboot/tree/main/scripts/imgtool.py) - A tool to securely sign firmware images for booting by MCUboot.
- [sim](https://github.com/mcu-tools/mcuboot/tree/main/sim) - A bootloader simulator for testing and regression.

- [boot/bootutil](boot/bootutil): The core of the bootloader itself.
- [boot/boot\_serial](boot/boot_serial): Support for serial upgrade within the bootloader itself.
- [boot/zephyr](boot/zephyr): Port of the bootloader to Zephyr
- [boot/mynewt](boot/mynewt): Mynewt bootloader app
- [boot/nuttx](boot/nuttx): Bootloader application and port of MCUboot interfaces for NuttX.
- [boot/espressif](boot/espressif): Bootloader application and MCUboot port for Espressif SoCs.
- [imgtool](scripts/imgtool.py): A tool to securely sign firmware images for booting by MCUboot.
- [sim](sim): A bootloader simulator for testing and regression
## Joining the project

## Joining
Developers are welcome!

Developers welcome!
Use the following links to join or see more about the project:

* [Our developer mailing list](https://groups.io/g/MCUBoot)
* [Our Slack channel](https://mcuboot.slack.com/) <br />
+2 −5
Original line number Diff line number Diff line
@@ -63,12 +63,8 @@

BOOT_LOG_MODULE_DECLARE(mcuboot);

#ifndef BOOT_IMAGE_NUMBER
#define BOOT_IMAGE_NUMBER MCUBOOT_IMAGE_NUMBER
#endif

#define BOOT_SERIAL_INPUT_MAX   512
#define BOOT_SERIAL_OUT_MAX     (128 * MCUBOOT_IMAGE_NUMBER)
#define BOOT_SERIAL_OUT_MAX     (128 * BOOT_IMAGE_NUMBER)

#ifdef __ZEPHYR__
/* base64 lib encodes data to null-terminated string */
@@ -667,6 +663,7 @@ boot_serial_start(const struct boot_uart_funcs *f)
    off = 0;
    while (1) {
        MCUBOOT_CPU_IDLE();
        MCUBOOT_WATCHDOG_FEED();
        rc = f->read(in_buf + off, sizeof(in_buf) - off, &full_line);
        if (rc <= 0 && !full_line) {
            continue;
+11 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *
 * Copyright (c) 2017-2019 Linaro LTD
 * Copyright (c) 2016-2019 JUUL Labs
 * Copyright (c) 2019-2020 Arm Limited
 * Copyright (c) 2019-2021 Arm Limited
 *
 * Original license:
 *
@@ -36,6 +36,14 @@
extern "C" {
#endif

#ifdef MCUBOOT_IMAGE_NUMBER
#define BOOT_IMAGE_NUMBER          MCUBOOT_IMAGE_NUMBER
#else
#define BOOT_IMAGE_NUMBER          1
#endif

_Static_assert(BOOT_IMAGE_NUMBER > 0, "Invalid value for BOOT_IMAGE_NUMBER");

struct image_header;
/**
 * A response object provided by the boot loader code; indicates where to jump
@@ -68,8 +76,10 @@ struct image_trailer {

/* you must have pre-allocated all the entries within this structure */
fih_int boot_go(struct boot_rsp *rsp);
fih_int boot_go_for_image_id(struct boot_rsp *rsp, uint32_t image_id);

struct boot_loader_state;
void boot_state_clear(struct boot_loader_state *state);
fih_int context_boot_go(struct boot_loader_state *state, struct boot_rsp *rsp);

#define SPLIT_GO_OK                 (0)
+17 −8
Original line number Diff line number Diff line
@@ -130,14 +130,6 @@ struct boot_status {

extern const uint32_t boot_img_magic[4];

#ifdef MCUBOOT_IMAGE_NUMBER
#define BOOT_IMAGE_NUMBER          MCUBOOT_IMAGE_NUMBER
#else
#define BOOT_IMAGE_NUMBER          1
#endif

_Static_assert(BOOT_IMAGE_NUMBER > 0, "Invalid value for BOOT_IMAGE_NUMBER");

#if !defined(MCUBOOT_DIRECT_XIP) && !defined(MCUBOOT_RAM_LOAD)
#define ARE_SLOTS_EQUIVALENT()    0
#else
@@ -224,7 +216,24 @@ struct boot_loader_state {

#if (BOOT_IMAGE_NUMBER > 1)
    uint8_t curr_img_idx;
    bool img_mask[BOOT_IMAGE_NUMBER];
#endif

#if defined(MCUBOOT_DIRECT_XIP) || defined(MCUBOOT_RAM_LOAD)
    struct slot_usage_t {
        /* Index of the slot chosen to be loaded */
        uint32_t active_slot;
        bool slot_available[BOOT_NUM_SLOTS];
#if defined(MCUBOOT_RAM_LOAD)
        /* Image destination and size for the active slot */
        uint32_t img_dst;
        uint32_t img_sz;
#elif defined(MCUBOOT_DIRECT_XIP_REVERT)
        /* Swap status for the active slot */
        struct boot_swap_state swap_state;
#endif
    } slot_usage[BOOT_IMAGE_NUMBER];
#endif /* MCUBOOT_DIRECT_XIP || MCUBOOT_RAM_LOAD */
};

fih_int bootutil_verify_sig(uint8_t *hash, uint32_t hlen, uint8_t *sig,
Loading