diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..beaed31 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,22 @@ +name: 'build' + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v1 + - name: Build bootloader and partition table + uses: docker://docker.io/espressif/idf:release-v4.3 + with: + args: ./build.sh + - name: Update release + if: "github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')" + uses: eine/tip@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + files: | + out/* + tag: latest + rm: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..63de16e --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +build +out +sdkconfig +sdkconfig.old diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ab98ba4 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.5) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(dummy) diff --git a/README.md b/README.md new file mode 100644 index 0000000..39bfcec --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Bootloader and partition table for NuttX + +This repository contains a minimal ESP-IDF project and build scripts used to produce 2nd stage bootloader and partition table binaries. Users of NuttX RTOS can download the binaries from release artifacts in this repository. diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..aac4593 --- /dev/null +++ b/build.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -euo pipefail + +targets="esp32 esp32s2 esp32c3" + +mkdir -p out + +for target in ${targets}; do + idf.py set-target ${target} + idf.py bootloader partition_table + cp build/bootloader/bootloader.bin out/bootloader-${target}.bin + cp build/partition_table/partition-table.bin out/partition-table-${target}.bin + cp sdkconfig out/sdkconfig +done diff --git a/partitions.csv b/partitions.csv new file mode 100644 index 0000000..be23c65 --- /dev/null +++ b/partitions.csv @@ -0,0 +1,2 @@ +# Name, Type, SubType, Offset, Size, Flags +factory, app, factory, , 1M, diff --git a/sdkconfig.defaults b/sdkconfig.defaults new file mode 100644 index 0000000..91d7574 --- /dev/null +++ b/sdkconfig.defaults @@ -0,0 +1,2 @@ +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"