espressif: ci: Add new building jobs configs for Espressif chips

Add jobs for testing build ESP32-XX within more features:
Serial Recovery, Multi Image and Multi Boot

Signed-off-by: Almir Okato <almir.okato@espressif.com>
This commit is contained in:
Almir Okato 2023-01-27 16:24:00 -03:00 committed by Fabio Utzig
parent 3eb0681273
commit bfdf934e3a
11 changed files with 129 additions and 5 deletions

View File

@ -20,11 +20,20 @@ jobs:
matrix:
targets: [esp32, esp32s2, esp32s3, esp32c3]
features:
- "sign-rsa2048,sign-rsa3072,sign-ec256,sign-ed25519"
- "secureboot-sign-rsa2048,secureboot-sign-rsa3072,secureboot-sign-ec256,secureboot-sign-ed25519"
- "serialrecovery"
include:
- targets: esp32
features: "multi-image,multi-boot"
img: "multi"
- targets: esp32s3
features: "multi-image,multi-boot"
img: "multi"
runs-on: ubuntu-latest
env:
MCUBOOT_TARGETS: ${{ matrix.targets }}
MCUBOOT_FEATURES: ${{ matrix.features }}
MCUBOOT_IMG_NUM: ${{ matrix.img }}
steps:
- uses: actions/checkout@v2
with:

View File

@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
# ATTENTION:
# This configuration file targets the building for CI environment and contains
# a set of definitions to resemble a bootloader image for RELEASE environment.
CONFIG_ESP_IMAGE_NUMBER=2
CONFIG_ESP_MULTI_PROCESSOR_BOOT=y

View File

@ -0,0 +1,9 @@
# SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
# ATTENTION:
# This configuration file targets the building for CI environment and contains
# a set of definitions to resemble a bootloader image for RELEASE environment.
CONFIG_ESP_IMAGE_NUMBER=2

View File

@ -18,3 +18,5 @@ CONFIG_SECURE_FLASH_ENCRYPTION_MODE_RELEASE=1
CONFIG_ESP_SIGN_KEY_FILE=root-ec-p256.pem
CONFIG_ESP_USE_TINYCRYPT=1
CONFIG_ESP_SIGN_EC256=1
CONFIG_ESP_DOWNGRADE_PREVENTION=1
CONFIG_ESP_DOWNGRADE_PREVENTION_SECURITY_COUNTER=1

View File

@ -18,3 +18,5 @@ CONFIG_SECURE_FLASH_ENCRYPTION_MODE_RELEASE=1
CONFIG_ESP_SIGN_KEY_FILE=root-ed25519.pem
CONFIG_ESP_USE_TINYCRYPT=1
CONFIG_ESP_SIGN_ED25519=1
CONFIG_ESP_DOWNGRADE_PREVENTION=1
CONFIG_ESP_DOWNGRADE_PREVENTION_SECURITY_COUNTER=1

View File

@ -19,3 +19,5 @@ CONFIG_ESP_SIGN_KEY_FILE=root-rsa-2048.pem
CONFIG_ESP_USE_MBEDTLS=1
CONFIG_ESP_SIGN_RSA=1
CONFIG_ESP_SIGN_RSA_LEN=2048
CONFIG_ESP_DOWNGRADE_PREVENTION=1
CONFIG_ESP_DOWNGRADE_PREVENTION_SECURITY_COUNTER=1

View File

@ -19,3 +19,5 @@ CONFIG_ESP_SIGN_KEY_FILE=root-rsa-3072.pem
CONFIG_ESP_USE_MBEDTLS=1
CONFIG_ESP_SIGN_RSA=1
CONFIG_ESP_SIGN_RSA_LEN=3072
CONFIG_ESP_DOWNGRADE_PREVENTION=1
CONFIG_ESP_DOWNGRADE_PREVENTION_SECURITY_COUNTER=1

View File

@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
# ATTENTION:
# This configuration file targets the building for CI environment and contains
# a set of definitions to resemble a bootloader image for RELEASE environment.
CONFIG_ESP_MCUBOOT_SERIAL=y
CONFIG_ESP_MCUBOOT_ERASE_PROGRESSIVELY=y

View File

@ -0,0 +1,34 @@
# SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
CONFIG_ESP_FLASH_SIZE=4MB
CONFIG_ESP_BOOTLOADER_SIZE=0xF000
CONFIG_ESP_BOOTLOADER_OFFSET=0x1000
# 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=0x80000
CONFIG_ESP_IMAGE0_PRIMARY_START_ADDRESS=0x10000
CONFIG_ESP_IMAGE0_SECONDARY_START_ADDRESS=0x90000
CONFIG_ESP_IMAGE1_PRIMARY_START_ADDRESS=0x110000
CONFIG_ESP_IMAGE1_SECONDARY_START_ADDRESS=0x190000
CONFIG_ESP_SCRATCH_OFFSET=0x210000
CONFIG_ESP_SCRATCH_SIZE=0x40000
CONFIG_ESP_MCUBOOT_WDT_ENABLE=y
CONFIG_ESP_CONSOLE_UART=y
CONFIG_ESP_CONSOLE_UART_NUM=0
# Configures alternative UART port for console printing
# CONFIG_ESP_CONSOLE_UART_CUSTOM=y
# CONFIG_ESP_CONSOLE_UART_TX_GPIO=26
# CONFIG_ESP_CONSOLE_UART_RX_GPIO=25
# 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

View File

@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
#
# SPDX-License-Identifier: Apache-2.0
CONFIG_ESP_FLASH_SIZE=4MB
CONFIG_ESP_BOOTLOADER_SIZE=0xF000
CONFIG_ESP_BOOTLOADER_OFFSET=0x0000
CONFIG_ESP_MCUBOOT_WDT_ENABLE=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=0x80000
CONFIG_ESP_IMAGE0_PRIMARY_START_ADDRESS=0x10000
CONFIG_ESP_IMAGE0_SECONDARY_START_ADDRESS=0x90000
CONFIG_ESP_IMAGE1_PRIMARY_START_ADDRESS=0x110000
CONFIG_ESP_IMAGE1_SECONDARY_START_ADDRESS=0x190000
CONFIG_ESP_SCRATCH_OFFSET=0x210000
CONFIG_ESP_SCRATCH_SIZE=0x40000
# Use UART0 for console printing (use either UART or USB alone)
CONFIG_ESP_CONSOLE_UART=y
CONFIG_ESP_CONSOLE_UART_NUM=0
# Configures alternative UART port for console printing
# (UART_NUM=0 must not be changed)
# CONFIG_ESP_CONSOLE_UART_CUSTOM=y
# CONFIG_ESP_CONSOLE_UART_TX_GPIO=17
# CONFIG_ESP_CONSOLE_UART_RX_GPIO=18
# Use USB JTAG Serial for console printing
# CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
# 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

View File

@ -18,12 +18,17 @@ prepare_environment() {
build_mcuboot() {
local target=${1}
local feature=${2}
local toolchain_file="${ESPRESSIF_ROOT}/tools/toolchain-${target}.cmake"
local mcuboot_config="${ESPRESSIF_ROOT}/port/${target}/bootloader.conf"
local img_num=${3}
local build_dir=".build-${target}"
local toolchain_file="${ESPRESSIF_ROOT}/tools/toolchain-${target}.cmake"
if [ -n "$img_num" ]; then
img_num="-${img_num}"
fi
local mcuboot_config="${ESPRESSIF_ROOT}/port/${target}/bootloader${img_num}.conf"
if [ -n "${feature}" ]; then
mcuboot_config="${mcuboot_config};${ESPRESSIF_ROOT}/secureboot-${feature}.conf"
mcuboot_config="${mcuboot_config};${ESPRESSIF_ROOT}/ci_configs/${feature}.conf"
build_dir=".build-${target}-${feature}"
fi
@ -44,11 +49,12 @@ prepare_environment
if [ -n "${MCUBOOT_FEATURES}" ]; then
IFS=','
read -ra target_list <<< "${MCUBOOT_TARGETS}"
read img_num <<< "${MCUBOOT_IMG_NUM}"
for target in "${target_list[@]}"; do
read -ra feature_list <<< "${MCUBOOT_FEATURES}"
for feature in "${feature_list[@]}"; do
echo "Building MCUboot for \"${target}\" with support for \"${feature}\""
build_mcuboot "${target}" "${feature}"
build_mcuboot "${target}" "${feature}" "${img_num}"
done
done
fi