diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2023-08-24 15:44:16 +1000 |
---|---|---|
committer | Jim Mussared <jim.mussared@gmail.com> | 2023-08-24 15:44:20 +1000 |
commit | bc1af5ab7f9f28d0bfd882a7f00027b146feb11e (patch) | |
tree | 7514ecd651c5473b571d464d667f738a99bca678 | |
parent | 326dfd2a8579828c4159d965c6a41883a2a90029 (diff) |
cc3200/Makefile: Build firmware.zip.
This allows the cc3200 port to be build with the standard autobuild script
rather than the custom build-cc3200-latest.sh (which is now removed).
This also fixes the path inside the zip file (by using the `-j` flag to
zip).
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
-rw-r--r-- | ports/cc3200/Makefile | 2 | ||||
-rw-r--r-- | ports/cc3200/application.mk | 6 | ||||
-rw-r--r-- | py/mkenv.mk | 1 | ||||
-rwxr-xr-x | tools/autobuild/autobuild.sh | 2 | ||||
-rwxr-xr-x | tools/autobuild/build-boards.sh | 4 | ||||
-rwxr-xr-x | tools/autobuild/build-cc3200-latest.sh | 32 |
6 files changed, 13 insertions, 34 deletions
diff --git a/ports/cc3200/Makefile b/ports/cc3200/Makefile index 61af0bfd9..f89a927c0 100644 --- a/ports/cc3200/Makefile +++ b/ports/cc3200/Makefile @@ -7,6 +7,8 @@ endif # Make 'release' the default build type BTYPE ?= release +# Make the 'application' by default ('bootloader' can be built explicitly) +BTARGET ?= application # Port for flashing firmware PORT ?= /dev/ttyUSB1 diff --git a/ports/cc3200/application.mk b/ports/cc3200/application.mk index 5021e4ff3..f4487d69d 100644 --- a/ports/cc3200/application.mk +++ b/ports/cc3200/application.mk @@ -198,7 +198,7 @@ WIPY_IP ?= '192.168.1.1' WIPY_USER ?= 'micro' WIPY_PWD ?= 'python' -all: $(BUILD)/mcuimg.bin +all: $(BUILD)/firmware.zip .PHONY: deploy-ota @@ -219,6 +219,10 @@ $(BUILD)/mcuimg.bin: $(BUILD)/application.bin $(ECHO) "Create $@" $(Q)$(SHELL) $(APP_SIGN) $(BUILD) +$(BUILD)/firmware.zip: $(BUILD)/mcuimg.bin + $(ECHO) "Create $@" + $(Q)$(ZIP) -j $@ $< + MAKE_PINS = boards/make-pins.py BOARD_PINS = boards/$(BOARD)/pins.csv AF_FILE = boards/cc3200_af.csv diff --git a/py/mkenv.mk b/py/mkenv.mk index 5368279e2..d3dddcc32 100644 --- a/py/mkenv.mk +++ b/py/mkenv.mk @@ -42,6 +42,7 @@ SED = sed CAT = cat TOUCH = touch PYTHON = python3 +ZIP = zip AS = $(CROSS_COMPILE)as CC = $(CROSS_COMPILE)gcc diff --git a/tools/autobuild/autobuild.sh b/tools/autobuild/autobuild.sh index 12ac230df..e1f2287ee 100755 --- a/tools/autobuild/autobuild.sh +++ b/tools/autobuild/autobuild.sh @@ -60,7 +60,7 @@ FW_TAG="-$FW_DATE-unstable-$FW_GIT" # build new firmware cd ports/cc3200 -${AUTODIR}/build-cc3200-latest.sh ${FW_TAG} ${LOCAL_FIRMWARE} +build_cc3200_boards ${FW_TAG} ${LOCAL_FIRMWARE} cd ../esp8266 build_esp8266_boards ${FW_TAG} ${LOCAL_FIRMWARE} cd ../esp32 diff --git a/tools/autobuild/build-boards.sh b/tools/autobuild/build-boards.sh index 6f3f93809..2b323ba9b 100755 --- a/tools/autobuild/build-boards.sh +++ b/tools/autobuild/build-boards.sh @@ -88,6 +88,10 @@ function build_boards { done } +function build_cc3200_boards { + build_boards hal/cc3200_hal.c $1 $2 zip +} + function build_esp32_boards { build_boards modesp32.c $1 $2 bin elf map uf2 app-bin } diff --git a/tools/autobuild/build-cc3200-latest.sh b/tools/autobuild/build-cc3200-latest.sh deleted file mode 100755 index 0cbdb9c42..000000000 --- a/tools/autobuild/build-cc3200-latest.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# function for building firmware -function do_build() { - descr=$1 - board=$2 - shift - shift - echo "building $descr $board" - build_dir=/tmp/cc3200-build-$board - $MICROPY_AUTOBUILD_MAKE $@ BTARGET=application BOARD=$board BUILD=$build_dir || exit 1 - zip $dest_dir/$descr$fw_tag.zip $build_dir/mcuimg.bin - 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 application.mk ]; then - echo "must be in cc3200 directory" - exit 1 -fi - -# build the versions -do_build wipy WIPY |