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

Synch to upstream aa041a28

merge using GH web GUI

Synch up to upstream https://github.com/mcu-tools/mcuboot/commit/aa041a282d01eca2d427d9bb95ae9aecd9d2aa66



- Added workflow verifying integration with the Zephyr
- removed deprecated DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL
- Fixed usage of CONFIG_LOG_IMMEDIATE 

Signed-off-by: default avatarMarek Pieta <Marek.Pieta@nordicsemi.no>
parents 7b9e4eec aa041a28
Loading
Loading
Loading
Loading
+103 −0
Original line number Diff line number Diff line
# Copyright (c) 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

name: Build Zephyr samples with Twister

# Workflow triggers on PRs, pushes to main, once per day at midnight and can be started manually.
on:
  # By default, pull_request includes: opened, synchronize, or reopened
  pull_request:
    branches:
      - main
  push:
    branches:
      - main
  schedule:
    - cron: 0 0 * * *
  # When triggered manually, ask for Zephyr and MCUBoot versions to check out
  workflow_dispatch:
    inputs:
      version_zephyr:
        description: 'Which Zephyr version to checkout?'
        required: true
        default: 'main'
      version_mcuboot:
        description: 'Which MCUBoot version to checkout?'
        required: true
        default: 'main'

env:
  ZEPHYR_VERSION: 'main'
  MCUBOOT_VERSION: 'main'

# Only cancel ongoing runs for PRs
concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  build_zephyr_with_twister:
    runs-on: ubuntu-latest
    # Docker image from the zephyr upstream. Includes SDK and other required tools
    container:
      image: zephyrprojectrtos/ci:v0.21.0
      options: '--entrypoint /bin/bash'
      volumes:
        - /home/runners/zephyrproject:/github/cache/zephyrproject
    env:
      ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-0.13.2

    steps:
      - name: Set versions when workflow_dispatch
        if: github.event_name == 'workflow_dispatch'
        run: |
          echo "ZEPHYR_VERSION=${{ github.event.inputs.version_zephyr }}" >> $GITHUB_ENV
          echo "MCUBOOT_VERSION=${{ github.event.inputs.version_mcuboot }}" >> $GITHUB_ENV

      - name: Set versions when pull_request
        if: github.event_name == 'pull_request'
        run: |
          echo "MCUBOOT_VERSION=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV

      - name: Checkout Zephyr
        uses: actions/checkout@v2
        with:
          repository: 'zephyrproject-rtos/zephyr'
          ref: ${{ env.ZEPHYR_VERSION }}
          path: 'repos/zephyr'

      - name: Setup Zephyr
        working-directory: repos/zephyr
        run: |
          west init -l .
          west update

      - name: Checkout MCUBoot
        uses: actions/checkout@v2
        with:
          repository: 'mcu-tools/mcuboot'
          ref: ${{ env.MCUBOOT_VERSION }}
          path: 'repos/bootloader/mcuboot'

      - name: Run Twister tests
        working-directory: repos/zephyr
        env:
          test_paths: >
              -T ../bootloader/mcuboot/boot/zephyr
              -T ./tests/subsys/dfu
              -T ./samples/subsys/mgmt/mcumgr/smp_svr
        run: |
          export ZEPHYR_BASE=${PWD}
          export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
          echo "Using Zephyr version: ${{ env.ZEPHYR_VERSION }}"
          echo "Using Mcuboot version: ${{ env.MCUBOOT_VERSION }}"
          ./scripts/twister --inline-logs -v -N -M --integration --overflow-as-errors --retry-failed 2 ${test_paths}

      - name: Upload Tests Results
        uses: actions/upload-artifact@v2
        if: always()
        with:
          name: Tests Results
          if-no-files-found: ignore
          path: |
            repos/zephyr/twister-out/twister.xml
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
[travis]: https://travis-ci.org/mcu-tools/mcuboot
[license]: https://github.com/mcu-tools/mcuboot/blob/main/LICENSE

This is MCUboot version 1.9.0
This is MCUboot version 1.10.0-dev

MCUboot is a secure bootloader for 32-bits microcontrollers. It defines a
common infrastructure for the bootloader and the system flash layout on
+22 −2
Original line number Diff line number Diff line
@@ -3,13 +3,33 @@
# SPDX-License-Identifier: Apache-2.0

CONFIG_ESP_BOOTLOADER_SIZE=0xF000
CONFIG_ESP_APPLICATION_PRIMARY_START_ADDRESS=0x10000
CONFIG_ESP_IMAGE0_PRIMARY_START_ADDRESS=0x10000
CONFIG_ESP_APPLICATION_SIZE=0x100000
CONFIG_ESP_APPLICATION_SECONDARY_START_ADDRESS=0x110000
CONFIG_ESP_IMAGE0_SECONDARY_START_ADDRESS=0x110000
CONFIG_ESP_MCUBOOT_WDT_ENABLE=y
CONFIG_ESP_SCRATCH_OFFSET=0x210000
CONFIG_ESP_SCRATCH_SIZE=0x40000

# Enables multi image, if it is not defined, it is assumed
# only one updatable image
# CONFIG_ESP_IMAGE_NUMBER=2

# Enables multi image boot on independent processors
# (main host OS is not responsible for booting the second image)
# Use only with CONFIG_ESP_IMAGE_NUMBER=2
# CONFIG_ESP_MULTI_PROCESSOR_BOOT=y

# Example of values to be used when multi image is enabled
# Notice that the OS layer and update agent must be aware
# of these regions
# CONFIG_ESP_APPLICATION_SIZE=0x50000
# CONFIG_ESP_IMAGE0_PRIMARY_START_ADDRESS=0x10000
# CONFIG_ESP_IMAGE0_SECONDARY_START_ADDRESS=0x60000
# CONFIG_ESP_IMAGE1_PRIMARY_START_ADDRESS=0xB0000
# CONFIG_ESP_IMAGE1_SECONDARY_START_ADDRESS=0x100000
# CONFIG_ESP_SCRATCH_OFFSET=0x150000
# CONFIG_ESP_SCRATCH_SIZE=0x40000

# CONFIG_ESP_SIGN_EC256=y
# CONFIG_ESP_SIGN_ED25519=n
# CONFIG_ESP_SIGN_RSA=n
+1 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ set(hal_srcs
    ${src_dir}/flash_encrypt.c
    ${src_dir}/${MCUBOOT_TARGET}/bootloader_init.c
    ${esp_idf_dir}/components/hal/mpu_hal.c
    ${esp_idf_dir}/components/hal/soc_hal.c
    ${esp_idf_dir}/components/bootloader_support/src/bootloader_common_loader.c
    ${esp_idf_dir}/components/bootloader_support/src/bootloader_console_loader.c
    ${esp_idf_dir}/components/bootloader_support/src/bootloader_flash.c
+11 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#pragma once

#include <stdint.h>

void appcpu_start(uint32_t entry_addr);
Loading