diff --git a/ports/stm32/Makefile b/ports/stm32/Makefile index 7c912f4f0b..f981f8f3eb 100644 --- a/ports/stm32/Makefile +++ b/ports/stm32/Makefile @@ -37,6 +37,9 @@ include $(TOP)/extmod/extmod.mk GIT_SUBMODULES += lib/libhydrogen lib/lwip lib/mbedtls lib/stm32lib +query-variants: + $(ECHO) "VARIANTS:" $(BOARD_VARIANTS) + LD_DIR=boards USBDEV_DIR=usbdev #USBHOST_DIR=usbhost diff --git a/ports/stm32/boards/PYBLITEV10/mpconfigboard.mk b/ports/stm32/boards/PYBLITEV10/mpconfigboard.mk index df95065225..89977b74ea 100644 --- a/ports/stm32/boards/PYBLITEV10/mpconfigboard.mk +++ b/ports/stm32/boards/PYBLITEV10/mpconfigboard.mk @@ -4,3 +4,24 @@ AF_FILE = boards/stm32f411_af.csv LD_FILES = boards/stm32f411.ld boards/common_ifs.ld TEXT0_ADDR = 0x08000000 TEXT1_ADDR = 0x08020000 + +# Provide different variants for the downloads page. +BOARD_VARIANTS += "dp thread dp-thread network" + +ifeq ($(BOARD_VARIANT),"dp") +MICROPY_FLOAT_IMPL=double +endif + +ifeq ($(BOARD_VARIANT),"thread") +CFLAGS += -DMICROPY_PY_THREAD=1 +endif + +ifeq ($(BOARD_VARIANT),"dp-thread") +MICROPY_FLOAT_IMPL=double +CFLAGS += -DMICROPY_PY_THREAD=1 +endif + +ifeq ($(BOARD_VARIANT),"network") +MICROPY_PY_NETWORK_WIZNET5K=5200 +MICROPY_PY_CC3K=1 +endif diff --git a/ports/stm32/boards/PYBV10/mpconfigboard.mk b/ports/stm32/boards/PYBV10/mpconfigboard.mk index cb78a7846d..071ae6eb7c 100644 --- a/ports/stm32/boards/PYBV10/mpconfigboard.mk +++ b/ports/stm32/boards/PYBV10/mpconfigboard.mk @@ -14,3 +14,24 @@ endif # MicroPython settings MICROPY_VFS_LFS2 = 1 + +# Provide different variants for the downloads page. +BOARD_VARIANTS += "dp thread dp-thread network" + +ifeq ($(BOARD_VARIANT),"dp") +MICROPY_FLOAT_IMPL=double +endif + +ifeq ($(BOARD_VARIANT),"thread") +CFLAGS += -DMICROPY_PY_THREAD=1 +endif + +ifeq ($(BOARD_VARIANT),"dp-thread") +MICROPY_FLOAT_IMPL=double +CFLAGS += -DMICROPY_PY_THREAD=1 +endif + +ifeq ($(BOARD_VARIANT),"network") +MICROPY_PY_NETWORK_WIZNET5K=5200 +MICROPY_PY_CC3K=1 +endif diff --git a/ports/stm32/boards/PYBV11/mpconfigboard.mk b/ports/stm32/boards/PYBV11/mpconfigboard.mk index cb78a7846d..071ae6eb7c 100644 --- a/ports/stm32/boards/PYBV11/mpconfigboard.mk +++ b/ports/stm32/boards/PYBV11/mpconfigboard.mk @@ -14,3 +14,24 @@ endif # MicroPython settings MICROPY_VFS_LFS2 = 1 + +# Provide different variants for the downloads page. +BOARD_VARIANTS += "dp thread dp-thread network" + +ifeq ($(BOARD_VARIANT),"dp") +MICROPY_FLOAT_IMPL=double +endif + +ifeq ($(BOARD_VARIANT),"thread") +CFLAGS += -DMICROPY_PY_THREAD=1 +endif + +ifeq ($(BOARD_VARIANT),"dp-thread") +MICROPY_FLOAT_IMPL=double +CFLAGS += -DMICROPY_PY_THREAD=1 +endif + +ifeq ($(BOARD_VARIANT),"network") +MICROPY_PY_NETWORK_WIZNET5K=5200 +MICROPY_PY_CC3K=1 +endif diff --git a/tools/autobuild/build-stm32-extra.sh b/tools/autobuild/build-stm32-extra.sh index 80c6f42f5e..feb269e356 100755 --- a/tools/autobuild/build-stm32-extra.sh +++ b/tools/autobuild/build-stm32-extra.sh @@ -7,12 +7,15 @@ function do_build() { board=$2 shift shift - echo "building $descr $board" - build_dir=/tmp/stm-build-$board - $MICROPY_AUTOBUILD_MAKE $@ BOARD=$board BUILD=$build_dir || exit 1 - mv $build_dir/firmware.dfu $dest_dir/$descr$fw_tag.dfu - mv $build_dir/firmware.hex $dest_dir/$descr$fw_tag.hex - rm -rf $build_dir + for variant in `$MICROPY_AUTOBUILD_MAKE BOARD=$board query-variants | grep VARIANTS: | cut -d' ' -f2-`; do + target=$descr-$variant + echo "building $target $board" + build_dir=/tmp/stm-build-$board + $MICROPY_AUTOBUILD_MAKE $@ BOARD=$board BOARD_VARIANT=$variant BUILD=$build_dir || exit 1 + mv $build_dir/firmware.dfu $dest_dir/$target$fw_tag.dfu + mv $build_dir/firmware.hex $dest_dir/$target$fw_tag.hex + rm -rf $build_dir + done } # check/get parameters @@ -30,18 +33,7 @@ if [ ! -r modpyb.c ]; then exit 1 fi -# build the versions -do_build pybv3 PYBV3 -do_build pybv3-network PYBV3 MICROPY_PY_NETWORK_WIZNET5K=5200 MICROPY_PY_CC3K=1 -do_build pybv10-dp PYBV10 MICROPY_FLOAT_IMPL=double -do_build pybv10-thread PYBV10 CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1' -do_build pybv10-dp-thread PYBV10 MICROPY_FLOAT_IMPL=double CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1' -do_build pybv10-network PYBV10 MICROPY_PY_NETWORK_WIZNET5K=5200 MICROPY_PY_CC3K=1 -do_build pybv11-dp PYBV11 MICROPY_FLOAT_IMPL=double -do_build pybv11-thread PYBV11 CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1' -do_build pybv11-dp-thread PYBV11 MICROPY_FLOAT_IMPL=double CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1' -do_build pybv11-network PYBV11 MICROPY_PY_NETWORK_WIZNET5K=5200 MICROPY_PY_CC3K=1 -do_build pyblitev10-dp PYBLITEV10 MICROPY_FLOAT_IMPL=double -do_build pyblitev10-thread PYBLITEV10 CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1' -do_build pyblitev10-dp-thread PYBLITEV10 MICROPY_FLOAT_IMPL=double CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1' -do_build pyblitev10-network PYBLITEV10 MICROPY_PY_NETWORK_WIZNET5K=5200 MICROPY_PY_CC3K=1 +# build the variants for each board +do_build pybv10 PYBV10 +do_build pybv11 PYBV11 +do_build pyblitev10 PYBLITEV10