summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2023-08-16 00:51:37 +1000
committerJim Mussared <jim.mussared@gmail.com>2023-08-23 15:49:37 +1000
commitef03ca8bf2e06d3d8b753aafdf13e1399dc26847 (patch)
treec487fb5cd2a5b70b5a9c9b8e9ed22c0820c0b6ac /tools
parentaa236981192395cda555efa3db5f490c168bebdd (diff)
esp8266: Add board variant support.
This merges the existing GENERIC, GENERIC_1M, and GENERIC_512k boards into variants of the new ESP8266_GENERIC board (renamed from GENERIC so as not to clash with other ports). Also moves the generation of the "OTA" variant (previously generated by autobuild/build-esp8266-latest.sh) into the variant. Following the convention established for the WEACTSTUDIO rp2 board, the names of the variants are FLASH_1M and FLASH_512K (but rename the .ld files to use MiB and kiB). Updates autobuild to build esp8266 firmware the same way as other ports. This requires renaming the output from firmware-combined.bin to just firmware.bin. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/autobuild/autobuild.sh2
-rwxr-xr-xtools/autobuild/build-boards.sh4
-rwxr-xr-xtools/autobuild/build-esp8266-latest.sh61
-rwxr-xr-xtools/ci.sh6
4 files changed, 8 insertions, 65 deletions
diff --git a/tools/autobuild/autobuild.sh b/tools/autobuild/autobuild.sh
index 999a42c0e..12ac230df 100755
--- a/tools/autobuild/autobuild.sh
+++ b/tools/autobuild/autobuild.sh
@@ -62,7 +62,7 @@ FW_TAG="-$FW_DATE-unstable-$FW_GIT"
cd ports/cc3200
${AUTODIR}/build-cc3200-latest.sh ${FW_TAG} ${LOCAL_FIRMWARE}
cd ../esp8266
-${AUTODIR}/build-esp8266-latest.sh ${FW_TAG} ${LOCAL_FIRMWARE}
+build_esp8266_boards ${FW_TAG} ${LOCAL_FIRMWARE}
cd ../esp32
(source ${IDF_PATH_V50}/export.sh && build_esp32_boards ${FW_TAG} ${LOCAL_FIRMWARE})
cd ../mimxrt
diff --git a/tools/autobuild/build-boards.sh b/tools/autobuild/build-boards.sh
index 82d7f3605..6f3f93809 100755
--- a/tools/autobuild/build-boards.sh
+++ b/tools/autobuild/build-boards.sh
@@ -92,6 +92,10 @@ function build_esp32_boards {
build_boards modesp32.c $1 $2 bin elf map uf2 app-bin
}
+function build_esp8266_boards {
+ build_boards modesp.c $1 $2 bin elf map
+}
+
function build_mimxrt_boards {
build_boards modmimxrt.c $1 $2 bin hex
}
diff --git a/tools/autobuild/build-esp8266-latest.sh b/tools/autobuild/build-esp8266-latest.sh
deleted file mode 100755
index 1972e85fc..000000000
--- a/tools/autobuild/build-esp8266-latest.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-
-PYTHON3=python3
-yaota8266=$HOME/yaota8266
-
-# for debugging
-#exec &> /tmp/esp-log-$$.txt
-
-# function for building firmware
-function do_build() {
- descr=$1
- board=$2
- shift
- shift
- echo "building $descr $board"
- build_dir=/tmp/esp8266-build-$board
- $MICROPY_AUTOBUILD_MAKE $@ BOARD=$board BUILD=$build_dir || exit 1
- mv $build_dir/firmware-combined.bin $dest_dir/$descr$fw_tag.bin
- mv $build_dir/firmware.elf $dest_dir/$descr$fw_tag.elf
- mv $build_dir/firmware.map $dest_dir/$descr$fw_tag.map
- rm -rf $build_dir
-}
-
-function do_build_ota() {
- descr=$1
- board=$2
- shift
- shift
- echo "building $descr $board"
- build_dir=/tmp/esp8266-build-$board
- $MICROPY_AUTOBUILD_MAKE $@ BOARD=$board BUILD=$build_dir || exit 1
- cat $yaota8266/yaota8266.bin $build_dir/firmware-ota.bin > $dest_dir/$descr$fw_tag.bin
- pushd $yaota8266/ota-client
- $PYTHON3 ota_client.py sign $build_dir/firmware-ota.bin
- popd
- mv $build_dir/firmware-ota.bin.ota $dest_dir/$descr$fw_tag.ota
- mv $build_dir/firmware.elf $dest_dir/$descr$fw_tag.elf
- mv $build_dir/firmware.map $dest_dir/$descr$fw_tag.map
- rm -rf $build_dir
-}
-
-# check/get parameters
-if [ $# != 2 ]; then
- echo "usage: $0 <fw-tag> <dest-dir>"
- exit 1
-fi
-
-fw_tag=$1
-dest_dir=$2
-
-# check we are in the correct directory
-if [ ! -r boards/esp8266_common.ld ]; then
- echo "must be in esp8266 directory"
- exit 1
-fi
-
-# build the versions
-do_build esp8266 GENERIC
-do_build esp8266-512k GENERIC_512K
-do_build esp8266-1m GENERIC_1M
-do_build_ota esp8266-ota GENERIC_1M ota
diff --git a/tools/ci.sh b/tools/ci.sh
index 55e90dc4a..f60ba0fd5 100755
--- a/tools/ci.sh
+++ b/tools/ci.sh
@@ -155,9 +155,9 @@ function ci_esp8266_path {
function ci_esp8266_build {
make ${MAKEOPTS} -C mpy-cross
make ${MAKEOPTS} -C ports/esp8266 submodules
- make ${MAKEOPTS} -C ports/esp8266
- make ${MAKEOPTS} -C ports/esp8266 BOARD=GENERIC_512K
- make ${MAKEOPTS} -C ports/esp8266 BOARD=GENERIC_1M
+ make ${MAKEOPTS} -C ports/esp8266 BOARD=ESP8266_GENERIC
+ make ${MAKEOPTS} -C ports/esp8266 BOARD=ESP8266_GENERIC BOARD_VARIANT=FLASH_512K
+ make ${MAKEOPTS} -C ports/esp8266 BOARD=ESP8266_GENERIC BOARD_VARIANT=FLASH_1M
}
########################################################################################