diff --git a/ports/cc3200/Makefile b/ports/cc3200/Makefile index 61af0bfd98..f89a927c0e 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 5021e4ff3c..f4487d69d4 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 5368279e29..d3dddcc32d 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 12ac230dfb..e1f2287ee5 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 6f3f938096..2b323ba9b0 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 0cbdb9c428..0000000000 --- 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 " - 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