From c9baf498c88349081442c8588b5ec3d01187a5c1 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 1 Feb 2023 11:31:06 +1100 Subject: [PATCH 1/8] lib/micropython-lib: Update submodule to latest. This brings in the bundle-networking package. Signed-off-by: Damien George --- lib/micropython-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/micropython-lib b/lib/micropython-lib index 038b4ac6572d..c1526d2d1eb6 160000 --- a/lib/micropython-lib +++ b/lib/micropython-lib @@ -1 +1 @@ -Subproject commit 038b4ac6572d0d5b4c18148dc7d7fdc026369fa4 +Subproject commit c1526d2d1eb68c4c3b0ff8940b012c98a80301f1 From 6250337c9cf725238df19104f7bf801e91b56e1a Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Fri, 27 Jan 2023 14:17:19 +1100 Subject: [PATCH 2/8] ports: Make all network-capable boards use bundle-networking. This will ensure that any board with networking support gets: - webrepl - mip - urequests - ntptime This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared --- ports/esp32/boards/manifest.py | 7 +++---- ports/esp8266/boards/manifest.py | 4 +--- ports/mimxrt/boards/MIMXRT1020_EVK/manifest.py | 3 +++ ports/mimxrt/boards/MIMXRT1020_EVK/mpconfigboard.mk | 2 ++ ports/mimxrt/boards/MIMXRT1050_EVK/manifest.py | 3 +++ ports/mimxrt/boards/MIMXRT1050_EVK/mpconfigboard.mk | 2 ++ ports/mimxrt/boards/MIMXRT1060_EVK/manifest.py | 3 +++ ports/mimxrt/boards/MIMXRT1060_EVK/mpconfigboard.mk | 2 ++ ports/mimxrt/boards/MIMXRT1064_EVK/manifest.py | 3 +++ ports/mimxrt/boards/MIMXRT1064_EVK/mpconfigboard.mk | 2 ++ ports/mimxrt/boards/MIMXRT1170_EVK/manifest.py | 3 +++ ports/mimxrt/boards/MIMXRT1170_EVK/mpconfigboard.mk | 2 ++ ports/mimxrt/boards/SEEED_ARCH_MIX/manifest.py | 3 +++ ports/mimxrt/boards/SEEED_ARCH_MIX/mpconfigboard.mk | 4 +++- ports/mimxrt/boards/TEENSY41/manifest.py | 3 +++ ports/mimxrt/boards/TEENSY41/mpconfigboard.mk | 2 ++ ports/rp2/boards/ARDUINO_NANO_RP2040_CONNECT/manifest.py | 4 +--- ports/rp2/boards/PICO_W/manifest.py | 6 ++---- ports/rp2/boards/PICO_W/mpconfigboard.cmake | 2 +- ports/rp2/boards/W5100S_EVB_PICO/manifest.py | 3 +++ ports/rp2/boards/W5100S_EVB_PICO/mpconfigboard.cmake | 1 + ports/rp2/boards/W5500_EVB_PICO/manifest.py | 3 +++ ports/rp2/boards/W5500_EVB_PICO/mpconfigboard.cmake | 1 + ports/stm32/boards/ARDUINO_PORTENTA_H7/manifest.py | 4 +--- ports/stm32/boards/NUCLEO_F429ZI/manifest.py | 2 ++ ports/stm32/boards/NUCLEO_F429ZI/mpconfigboard.mk | 2 ++ ports/stm32/boards/NUCLEO_F439ZI/manifest.py | 2 ++ ports/stm32/boards/NUCLEO_F439ZI/mpconfigboard.mk | 2 ++ ports/stm32/boards/NUCLEO_F746ZG/manifest.py | 2 ++ ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.mk | 2 ++ ports/stm32/boards/NUCLEO_F756ZG/manifest.py | 2 ++ ports/stm32/boards/NUCLEO_F756ZG/mpconfigboard.mk | 2 ++ ports/stm32/boards/NUCLEO_F767ZI/manifest.py | 2 ++ ports/stm32/boards/NUCLEO_F767ZI/mpconfigboard.mk | 2 ++ ports/stm32/boards/NUCLEO_H743ZI/manifest.py | 2 ++ ports/stm32/boards/NUCLEO_H743ZI/mpconfigboard.mk | 2 ++ ports/stm32/boards/OLIMEX_E407/manifest.py | 2 ++ ports/stm32/boards/PYBD_SF2/manifest.py | 2 +- ports/stm32/boards/STM32F769DISC/manifest.py | 2 ++ ports/stm32/boards/STM32F769DISC/mpconfigboard.mk | 2 ++ ports/stm32/boards/STM32F7DISC/manifest.py | 2 ++ ports/stm32/boards/STM32F7DISC/mpconfigboard.mk | 2 ++ ports/stm32/boards/VCC_GND_F407ZG/manifest.py | 2 ++ ports/stm32/boards/VCC_GND_F407ZG/mpconfigboard.mk | 2 ++ 44 files changed, 92 insertions(+), 20 deletions(-) create mode 100644 ports/mimxrt/boards/MIMXRT1020_EVK/manifest.py create mode 100644 ports/mimxrt/boards/MIMXRT1050_EVK/manifest.py create mode 100644 ports/mimxrt/boards/MIMXRT1060_EVK/manifest.py create mode 100644 ports/mimxrt/boards/MIMXRT1064_EVK/manifest.py create mode 100644 ports/mimxrt/boards/MIMXRT1170_EVK/manifest.py create mode 100644 ports/mimxrt/boards/SEEED_ARCH_MIX/manifest.py create mode 100644 ports/mimxrt/boards/TEENSY41/manifest.py create mode 100644 ports/rp2/boards/W5100S_EVB_PICO/manifest.py create mode 100644 ports/rp2/boards/W5500_EVB_PICO/manifest.py create mode 100644 ports/stm32/boards/NUCLEO_F429ZI/manifest.py create mode 100644 ports/stm32/boards/NUCLEO_F439ZI/manifest.py create mode 100644 ports/stm32/boards/NUCLEO_F746ZG/manifest.py create mode 100644 ports/stm32/boards/NUCLEO_F756ZG/manifest.py create mode 100644 ports/stm32/boards/NUCLEO_F767ZI/manifest.py create mode 100644 ports/stm32/boards/NUCLEO_H743ZI/manifest.py create mode 100644 ports/stm32/boards/OLIMEX_E407/manifest.py create mode 100644 ports/stm32/boards/STM32F769DISC/manifest.py create mode 100644 ports/stm32/boards/STM32F7DISC/manifest.py create mode 100644 ports/stm32/boards/VCC_GND_F407ZG/manifest.py diff --git a/ports/esp32/boards/manifest.py b/ports/esp32/boards/manifest.py index 3f6c8cfde5a9..a6df79f0a3d9 100644 --- a/ports/esp32/boards/manifest.py +++ b/ports/esp32/boards/manifest.py @@ -1,15 +1,14 @@ freeze("$(PORT_DIR)/modules") include("$(MPY_DIR)/extmod/uasyncio") +# Useful networking-related packages. +require("bundle-networking") + # Require some micropython-lib modules. require("dht") require("ds18x20") -require("mip") require("neopixel") -require("ntptime") require("onewire") require("umqtt.robust") require("umqtt.simple") require("upysh") -require("urequests") -require("webrepl") diff --git a/ports/esp8266/boards/manifest.py b/ports/esp8266/boards/manifest.py index 53975f6a6baf..10fa6da2796e 100644 --- a/ports/esp8266/boards/manifest.py +++ b/ports/esp8266/boards/manifest.py @@ -1,8 +1,6 @@ freeze("$(PORT_DIR)/modules") +require("bundle-networking") require("dht") require("ds18x20") -require("mip") require("neopixel") -require("ntptime") require("onewire") -require("webrepl") diff --git a/ports/mimxrt/boards/MIMXRT1020_EVK/manifest.py b/ports/mimxrt/boards/MIMXRT1020_EVK/manifest.py new file mode 100644 index 000000000000..107181c31ca7 --- /dev/null +++ b/ports/mimxrt/boards/MIMXRT1020_EVK/manifest.py @@ -0,0 +1,3 @@ +include("../manifest.py") + +require("bundle-networking") diff --git a/ports/mimxrt/boards/MIMXRT1020_EVK/mpconfigboard.mk b/ports/mimxrt/boards/MIMXRT1020_EVK/mpconfigboard.mk index e8922e4b7abf..85bc1f71b606 100644 --- a/ports/mimxrt/boards/MIMXRT1020_EVK/mpconfigboard.mk +++ b/ports/mimxrt/boards/MIMXRT1020_EVK/mpconfigboard.mk @@ -13,6 +13,8 @@ MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 +FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py + JLINK_PATH ?= /media/RT1020-EVK/ JLINK_COMMANDER_SCRIPT = $(BUILD)/script.jlink diff --git a/ports/mimxrt/boards/MIMXRT1050_EVK/manifest.py b/ports/mimxrt/boards/MIMXRT1050_EVK/manifest.py new file mode 100644 index 000000000000..107181c31ca7 --- /dev/null +++ b/ports/mimxrt/boards/MIMXRT1050_EVK/manifest.py @@ -0,0 +1,3 @@ +include("../manifest.py") + +require("bundle-networking") diff --git a/ports/mimxrt/boards/MIMXRT1050_EVK/mpconfigboard.mk b/ports/mimxrt/boards/MIMXRT1050_EVK/mpconfigboard.mk index 00843350494a..8e4213569a4f 100644 --- a/ports/mimxrt/boards/MIMXRT1050_EVK/mpconfigboard.mk +++ b/ports/mimxrt/boards/MIMXRT1050_EVK/mpconfigboard.mk @@ -12,3 +12,5 @@ MICROPY_HW_SDRAM_SIZE = 0x2000000 # 32MB MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 + +FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py diff --git a/ports/mimxrt/boards/MIMXRT1060_EVK/manifest.py b/ports/mimxrt/boards/MIMXRT1060_EVK/manifest.py new file mode 100644 index 000000000000..107181c31ca7 --- /dev/null +++ b/ports/mimxrt/boards/MIMXRT1060_EVK/manifest.py @@ -0,0 +1,3 @@ +include("../manifest.py") + +require("bundle-networking") diff --git a/ports/mimxrt/boards/MIMXRT1060_EVK/mpconfigboard.mk b/ports/mimxrt/boards/MIMXRT1060_EVK/mpconfigboard.mk index 96afe276f706..22cd5356d93a 100644 --- a/ports/mimxrt/boards/MIMXRT1060_EVK/mpconfigboard.mk +++ b/ports/mimxrt/boards/MIMXRT1060_EVK/mpconfigboard.mk @@ -13,6 +13,8 @@ MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 +FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py + JLINK_PATH ?= /media/RT1060-EVK/ JLINK_COMMANDER_SCRIPT = $(BUILD)/script.jlink diff --git a/ports/mimxrt/boards/MIMXRT1064_EVK/manifest.py b/ports/mimxrt/boards/MIMXRT1064_EVK/manifest.py new file mode 100644 index 000000000000..107181c31ca7 --- /dev/null +++ b/ports/mimxrt/boards/MIMXRT1064_EVK/manifest.py @@ -0,0 +1,3 @@ +include("../manifest.py") + +require("bundle-networking") diff --git a/ports/mimxrt/boards/MIMXRT1064_EVK/mpconfigboard.mk b/ports/mimxrt/boards/MIMXRT1064_EVK/mpconfigboard.mk index ceb1e9796e01..08696d72ff44 100644 --- a/ports/mimxrt/boards/MIMXRT1064_EVK/mpconfigboard.mk +++ b/ports/mimxrt/boards/MIMXRT1064_EVK/mpconfigboard.mk @@ -13,6 +13,8 @@ MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 +FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py + JLINK_PATH ?= /media/RT1064-EVK/ deploy: $(BUILD)/firmware.bin diff --git a/ports/mimxrt/boards/MIMXRT1170_EVK/manifest.py b/ports/mimxrt/boards/MIMXRT1170_EVK/manifest.py new file mode 100644 index 000000000000..107181c31ca7 --- /dev/null +++ b/ports/mimxrt/boards/MIMXRT1170_EVK/manifest.py @@ -0,0 +1,3 @@ +include("../manifest.py") + +require("bundle-networking") diff --git a/ports/mimxrt/boards/MIMXRT1170_EVK/mpconfigboard.mk b/ports/mimxrt/boards/MIMXRT1170_EVK/mpconfigboard.mk index ea72008d5141..dc44b93bd073 100644 --- a/ports/mimxrt/boards/MIMXRT1170_EVK/mpconfigboard.mk +++ b/ports/mimxrt/boards/MIMXRT1170_EVK/mpconfigboard.mk @@ -15,6 +15,8 @@ MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 +FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py + CFLAGS += -DCPU_MIMXRT1176DVMAA_cm7 \ -DMIMXRT117x_SERIES \ -DENET_ENHANCEDBUFFERDESCRIPTOR_MODE=1 \ diff --git a/ports/mimxrt/boards/SEEED_ARCH_MIX/manifest.py b/ports/mimxrt/boards/SEEED_ARCH_MIX/manifest.py new file mode 100644 index 000000000000..107181c31ca7 --- /dev/null +++ b/ports/mimxrt/boards/SEEED_ARCH_MIX/manifest.py @@ -0,0 +1,3 @@ +include("../manifest.py") + +require("bundle-networking") diff --git a/ports/mimxrt/boards/SEEED_ARCH_MIX/mpconfigboard.mk b/ports/mimxrt/boards/SEEED_ARCH_MIX/mpconfigboard.mk index 82a95c493c95..8e530ac55892 100644 --- a/ports/mimxrt/boards/SEEED_ARCH_MIX/mpconfigboard.mk +++ b/ports/mimxrt/boards/SEEED_ARCH_MIX/mpconfigboard.mk @@ -13,4 +13,6 @@ MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 -CFLAGS += -DSPI_RETRY_TIMES=1000000 \ No newline at end of file +FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py + +CFLAGS += -DSPI_RETRY_TIMES=1000000 diff --git a/ports/mimxrt/boards/TEENSY41/manifest.py b/ports/mimxrt/boards/TEENSY41/manifest.py new file mode 100644 index 000000000000..107181c31ca7 --- /dev/null +++ b/ports/mimxrt/boards/TEENSY41/manifest.py @@ -0,0 +1,3 @@ +include("../manifest.py") + +require("bundle-networking") diff --git a/ports/mimxrt/boards/TEENSY41/mpconfigboard.mk b/ports/mimxrt/boards/TEENSY41/mpconfigboard.mk index 601a2cfe8606..ca7e10b5e4c3 100755 --- a/ports/mimxrt/boards/TEENSY41/mpconfigboard.mk +++ b/ports/mimxrt/boards/TEENSY41/mpconfigboard.mk @@ -11,5 +11,7 @@ MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 +FROZEN_MANIFEST ?= $(BOARD_DIR)/manifest.py + deploy: $(BUILD)/firmware.hex teensy_loader_cli --mcu=imxrt1062 -v -w $< diff --git a/ports/rp2/boards/ARDUINO_NANO_RP2040_CONNECT/manifest.py b/ports/rp2/boards/ARDUINO_NANO_RP2040_CONNECT/manifest.py index 5061e2cf0516..2fed2b1921c8 100644 --- a/ports/rp2/boards/ARDUINO_NANO_RP2040_CONNECT/manifest.py +++ b/ports/rp2/boards/ARDUINO_NANO_RP2040_CONNECT/manifest.py @@ -1,9 +1,7 @@ include("$(PORT_DIR)/boards/manifest.py") # Networking -require("webrepl") -require("urequests") -require("ntptime") +require("bundle-networking") # Drivers require("lsm6dsox") diff --git a/ports/rp2/boards/PICO_W/manifest.py b/ports/rp2/boards/PICO_W/manifest.py index 8a74006c64f7..02d1874b52b9 100644 --- a/ports/rp2/boards/PICO_W/manifest.py +++ b/ports/rp2/boards/PICO_W/manifest.py @@ -1,5 +1,3 @@ -include("../manifest.py") +include("$(PORT_DIR)/boards/manifest.py") -require("mip") -require("ntptime") -require("urequests") +require("bundle-networking") diff --git a/ports/rp2/boards/PICO_W/mpconfigboard.cmake b/ports/rp2/boards/PICO_W/mpconfigboard.cmake index 681e0dec44ff..df9d70c016ea 100644 --- a/ports/rp2/boards/PICO_W/mpconfigboard.cmake +++ b/ports/rp2/boards/PICO_W/mpconfigboard.cmake @@ -3,4 +3,4 @@ set(MICROPY_PY_LWIP ON) set(MICROPY_PY_NETWORK_CYW43 ON) # Board specific version of the frozen manifest -set(MICROPY_FROZEN_MANIFEST ${CMAKE_SOURCE_DIR}/boards/PICO_W/manifest.py) +set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py) diff --git a/ports/rp2/boards/W5100S_EVB_PICO/manifest.py b/ports/rp2/boards/W5100S_EVB_PICO/manifest.py new file mode 100644 index 000000000000..02d1874b52b9 --- /dev/null +++ b/ports/rp2/boards/W5100S_EVB_PICO/manifest.py @@ -0,0 +1,3 @@ +include("$(PORT_DIR)/boards/manifest.py") + +require("bundle-networking") diff --git a/ports/rp2/boards/W5100S_EVB_PICO/mpconfigboard.cmake b/ports/rp2/boards/W5100S_EVB_PICO/mpconfigboard.cmake index 4746c6e267a1..5de986fabc4e 100644 --- a/ports/rp2/boards/W5100S_EVB_PICO/mpconfigboard.cmake +++ b/ports/rp2/boards/W5100S_EVB_PICO/mpconfigboard.cmake @@ -2,3 +2,4 @@ set(PICO_BOARD wiznet_w5100s_evb_pico) set(MICROPY_PY_NETWORK_WIZNET5K W5100S) set(MICROPY_PY_LWIP 1) +set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py) diff --git a/ports/rp2/boards/W5500_EVB_PICO/manifest.py b/ports/rp2/boards/W5500_EVB_PICO/manifest.py new file mode 100644 index 000000000000..02d1874b52b9 --- /dev/null +++ b/ports/rp2/boards/W5500_EVB_PICO/manifest.py @@ -0,0 +1,3 @@ +include("$(PORT_DIR)/boards/manifest.py") + +require("bundle-networking") diff --git a/ports/rp2/boards/W5500_EVB_PICO/mpconfigboard.cmake b/ports/rp2/boards/W5500_EVB_PICO/mpconfigboard.cmake index f7f2650bfa0e..dda5ba4e325b 100644 --- a/ports/rp2/boards/W5500_EVB_PICO/mpconfigboard.cmake +++ b/ports/rp2/boards/W5500_EVB_PICO/mpconfigboard.cmake @@ -2,3 +2,4 @@ set(PICO_BOARD wiznet_w5100s_evb_pico) set(MICROPY_PY_NETWORK_WIZNET5K W5500) set(MICROPY_PY_LWIP 1) +set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py) diff --git a/ports/stm32/boards/ARDUINO_PORTENTA_H7/manifest.py b/ports/stm32/boards/ARDUINO_PORTENTA_H7/manifest.py index 3041e77fdb04..6cb17197417f 100644 --- a/ports/stm32/boards/ARDUINO_PORTENTA_H7/manifest.py +++ b/ports/stm32/boards/ARDUINO_PORTENTA_H7/manifest.py @@ -1,9 +1,7 @@ include("$(PORT_DIR)/boards/manifest.py") # Networking -require("webrepl") -require("urequests") -require("ntptime") +require("bundle-networking") # Utils require("logging") diff --git a/ports/stm32/boards/NUCLEO_F429ZI/manifest.py b/ports/stm32/boards/NUCLEO_F429ZI/manifest.py new file mode 100644 index 000000000000..ebfecd4844ad --- /dev/null +++ b/ports/stm32/boards/NUCLEO_F429ZI/manifest.py @@ -0,0 +1,2 @@ +include("$(PORT_DIR)/boards/manifest.py") +require("bundle-networking") diff --git a/ports/stm32/boards/NUCLEO_F429ZI/mpconfigboard.mk b/ports/stm32/boards/NUCLEO_F429ZI/mpconfigboard.mk index 47b4432893c8..9e82be1dc735 100644 --- a/ports/stm32/boards/NUCLEO_F429ZI/mpconfigboard.mk +++ b/ports/stm32/boards/NUCLEO_F429ZI/mpconfigboard.mk @@ -9,3 +9,5 @@ TEXT1_ADDR = 0x08020000 MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 + +FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py diff --git a/ports/stm32/boards/NUCLEO_F439ZI/manifest.py b/ports/stm32/boards/NUCLEO_F439ZI/manifest.py new file mode 100644 index 000000000000..ebfecd4844ad --- /dev/null +++ b/ports/stm32/boards/NUCLEO_F439ZI/manifest.py @@ -0,0 +1,2 @@ +include("$(PORT_DIR)/boards/manifest.py") +require("bundle-networking") diff --git a/ports/stm32/boards/NUCLEO_F439ZI/mpconfigboard.mk b/ports/stm32/boards/NUCLEO_F439ZI/mpconfigboard.mk index 52702b5112c8..69b0f80a2d2f 100644 --- a/ports/stm32/boards/NUCLEO_F439ZI/mpconfigboard.mk +++ b/ports/stm32/boards/NUCLEO_F439ZI/mpconfigboard.mk @@ -9,3 +9,5 @@ TEXT1_ADDR = 0x08020000 MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 + +FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py diff --git a/ports/stm32/boards/NUCLEO_F746ZG/manifest.py b/ports/stm32/boards/NUCLEO_F746ZG/manifest.py new file mode 100644 index 000000000000..ebfecd4844ad --- /dev/null +++ b/ports/stm32/boards/NUCLEO_F746ZG/manifest.py @@ -0,0 +1,2 @@ +include("$(PORT_DIR)/boards/manifest.py") +require("bundle-networking") diff --git a/ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.mk b/ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.mk index 8b54dc84e113..9506b6759555 100644 --- a/ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.mk +++ b/ports/stm32/boards/NUCLEO_F746ZG/mpconfigboard.mk @@ -9,3 +9,5 @@ TEXT1_ADDR = 0x08020000 MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 + +FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py diff --git a/ports/stm32/boards/NUCLEO_F756ZG/manifest.py b/ports/stm32/boards/NUCLEO_F756ZG/manifest.py new file mode 100644 index 000000000000..ebfecd4844ad --- /dev/null +++ b/ports/stm32/boards/NUCLEO_F756ZG/manifest.py @@ -0,0 +1,2 @@ +include("$(PORT_DIR)/boards/manifest.py") +require("bundle-networking") diff --git a/ports/stm32/boards/NUCLEO_F756ZG/mpconfigboard.mk b/ports/stm32/boards/NUCLEO_F756ZG/mpconfigboard.mk index f656ed0e5841..90fc242f9ac6 100644 --- a/ports/stm32/boards/NUCLEO_F756ZG/mpconfigboard.mk +++ b/ports/stm32/boards/NUCLEO_F756ZG/mpconfigboard.mk @@ -9,3 +9,5 @@ TEXT1_ADDR = 0x08020000 MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 + +FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py diff --git a/ports/stm32/boards/NUCLEO_F767ZI/manifest.py b/ports/stm32/boards/NUCLEO_F767ZI/manifest.py new file mode 100644 index 000000000000..ebfecd4844ad --- /dev/null +++ b/ports/stm32/boards/NUCLEO_F767ZI/manifest.py @@ -0,0 +1,2 @@ +include("$(PORT_DIR)/boards/manifest.py") +require("bundle-networking") diff --git a/ports/stm32/boards/NUCLEO_F767ZI/mpconfigboard.mk b/ports/stm32/boards/NUCLEO_F767ZI/mpconfigboard.mk index 0fdc1a6dcd17..6ef9d42f9d37 100644 --- a/ports/stm32/boards/NUCLEO_F767ZI/mpconfigboard.mk +++ b/ports/stm32/boards/NUCLEO_F767ZI/mpconfigboard.mk @@ -10,3 +10,5 @@ TEXT1_ADDR = 0x08020000 MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 + +FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py diff --git a/ports/stm32/boards/NUCLEO_H743ZI/manifest.py b/ports/stm32/boards/NUCLEO_H743ZI/manifest.py new file mode 100644 index 000000000000..ebfecd4844ad --- /dev/null +++ b/ports/stm32/boards/NUCLEO_H743ZI/manifest.py @@ -0,0 +1,2 @@ +include("$(PORT_DIR)/boards/manifest.py") +require("bundle-networking") diff --git a/ports/stm32/boards/NUCLEO_H743ZI/mpconfigboard.mk b/ports/stm32/boards/NUCLEO_H743ZI/mpconfigboard.mk index 8a16c2f01032..8212725943a5 100644 --- a/ports/stm32/boards/NUCLEO_H743ZI/mpconfigboard.mk +++ b/ports/stm32/boards/NUCLEO_H743ZI/mpconfigboard.mk @@ -21,3 +21,5 @@ MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 MICROPY_VFS_LFS2 = 1 + +FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py diff --git a/ports/stm32/boards/OLIMEX_E407/manifest.py b/ports/stm32/boards/OLIMEX_E407/manifest.py new file mode 100644 index 000000000000..ebfecd4844ad --- /dev/null +++ b/ports/stm32/boards/OLIMEX_E407/manifest.py @@ -0,0 +1,2 @@ +include("$(PORT_DIR)/boards/manifest.py") +require("bundle-networking") diff --git a/ports/stm32/boards/PYBD_SF2/manifest.py b/ports/stm32/boards/PYBD_SF2/manifest.py index 0ee11baf4b8e..f096d1ad052e 100644 --- a/ports/stm32/boards/PYBD_SF2/manifest.py +++ b/ports/stm32/boards/PYBD_SF2/manifest.py @@ -1,3 +1,3 @@ include("$(PORT_DIR)/boards/manifest.py") include("$(PORT_DIR)/boards/manifest_pyboard.py") -require("webrepl") +require("bundle-networking") diff --git a/ports/stm32/boards/STM32F769DISC/manifest.py b/ports/stm32/boards/STM32F769DISC/manifest.py new file mode 100644 index 000000000000..ebfecd4844ad --- /dev/null +++ b/ports/stm32/boards/STM32F769DISC/manifest.py @@ -0,0 +1,2 @@ +include("$(PORT_DIR)/boards/manifest.py") +require("bundle-networking") diff --git a/ports/stm32/boards/STM32F769DISC/mpconfigboard.mk b/ports/stm32/boards/STM32F769DISC/mpconfigboard.mk index dfee1a7ac79e..6457fc6046bd 100644 --- a/ports/stm32/boards/STM32F769DISC/mpconfigboard.mk +++ b/ports/stm32/boards/STM32F769DISC/mpconfigboard.mk @@ -44,3 +44,5 @@ endif MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 + +FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py diff --git a/ports/stm32/boards/STM32F7DISC/manifest.py b/ports/stm32/boards/STM32F7DISC/manifest.py new file mode 100644 index 000000000000..ebfecd4844ad --- /dev/null +++ b/ports/stm32/boards/STM32F7DISC/manifest.py @@ -0,0 +1,2 @@ +include("$(PORT_DIR)/boards/manifest.py") +require("bundle-networking") diff --git a/ports/stm32/boards/STM32F7DISC/mpconfigboard.mk b/ports/stm32/boards/STM32F7DISC/mpconfigboard.mk index 8b54dc84e113..9506b6759555 100644 --- a/ports/stm32/boards/STM32F7DISC/mpconfigboard.mk +++ b/ports/stm32/boards/STM32F7DISC/mpconfigboard.mk @@ -9,3 +9,5 @@ TEXT1_ADDR = 0x08020000 MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 + +FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py diff --git a/ports/stm32/boards/VCC_GND_F407ZG/manifest.py b/ports/stm32/boards/VCC_GND_F407ZG/manifest.py new file mode 100644 index 000000000000..ebfecd4844ad --- /dev/null +++ b/ports/stm32/boards/VCC_GND_F407ZG/manifest.py @@ -0,0 +1,2 @@ +include("$(PORT_DIR)/boards/manifest.py") +require("bundle-networking") diff --git a/ports/stm32/boards/VCC_GND_F407ZG/mpconfigboard.mk b/ports/stm32/boards/VCC_GND_F407ZG/mpconfigboard.mk index c67807867ef1..a30a6137d3b3 100644 --- a/ports/stm32/boards/VCC_GND_F407ZG/mpconfigboard.mk +++ b/ports/stm32/boards/VCC_GND_F407ZG/mpconfigboard.mk @@ -8,3 +8,5 @@ TEXT1_ADDR = 0x08020000 MICROPY_PY_LWIP = 1 MICROPY_PY_USSL = 1 MICROPY_SSL_MBEDTLS = 1 + +FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py From 55a76f4edd894ee7c5709c66fcc6f1c3a8905723 Mon Sep 17 00:00:00 2001 From: stijn Date: Mon, 23 Jan 2023 11:33:27 +0100 Subject: [PATCH 3/8] windows/msvc: Remove variant suffix from executable filename. This is in line with the change made for other ports in d53c3b6a: since the default output directory already includes the variant name in it there's no need to add it to the executable as well. --- ports/windows/msvc/common.props | 1 + ports/windows/variants/dev/mpconfigvariant.props | 3 --- ports/windows/variants/standard/mpconfigvariant.props | 3 --- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/ports/windows/msvc/common.props b/ports/windows/msvc/common.props index 7700d9f0945b..d949e3df4526 100644 --- a/ports/windows/msvc/common.props +++ b/ports/windows/msvc/common.props @@ -6,6 +6,7 @@ standard build-$(PyVariant) + micropython diff --git a/ports/windows/variants/dev/mpconfigvariant.props b/ports/windows/variants/dev/mpconfigvariant.props index 0f7abf781560..14ce01a81613 100644 --- a/ports/windows/variants/dev/mpconfigvariant.props +++ b/ports/windows/variants/dev/mpconfigvariant.props @@ -1,8 +1,5 @@ - - micropython-dev - %(PreprocessorDefinitions);MICROPY_ROM_TEXT_COMPRESSION=1 diff --git a/ports/windows/variants/standard/mpconfigvariant.props b/ports/windows/variants/standard/mpconfigvariant.props index 3cbb1821f497..9296da44bc26 100644 --- a/ports/windows/variants/standard/mpconfigvariant.props +++ b/ports/windows/variants/standard/mpconfigvariant.props @@ -1,6 +1,3 @@ - - micropython - From 65941ea0e5c7cc68951b6db606ae81ae983379f7 Mon Sep 17 00:00:00 2001 From: stijn Date: Tue, 24 Jan 2023 10:56:26 +0100 Subject: [PATCH 4/8] windows/msvc: Make mpy-cross independent of micropython variant. The variant.props may have incompatible build options which break the mpy-cross build and in any case mpy-cross has nothing to do with variant support. --- ports/windows/msvc/common.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/windows/msvc/common.props b/ports/windows/msvc/common.props index d949e3df4526..55c9c934f22e 100644 --- a/ports/windows/msvc/common.props +++ b/ports/windows/msvc/common.props @@ -3,14 +3,14 @@ - + standard build-$(PyVariant) micropython - + From e145318a814c65658aaad80a2f9792077638c0a6 Mon Sep 17 00:00:00 2001 From: stijn Date: Tue, 24 Jan 2023 11:03:59 +0100 Subject: [PATCH 5/8] windows/msvc: Fix qstr generation dependency. The mpversion.h file must exist before py/ source can be preprocessed, but this went unnoticed because micropython.vcxproj always calls MakeVersionHdr before MakeQstrDefs. --- ports/windows/msvc/genhdr.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/windows/msvc/genhdr.targets b/ports/windows/msvc/genhdr.targets index 308a6a1f5fe2..7d60e08a0919 100644 --- a/ports/windows/msvc/genhdr.targets +++ b/ports/windows/msvc/genhdr.targets @@ -62,7 +62,7 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) { - + From 7e9a15966acf80ff50fdf5c52553dd56de164bb3 Mon Sep 17 00:00:00 2001 From: stijn Date: Mon, 30 Jan 2023 15:38:16 +0100 Subject: [PATCH 6/8] mpy-cross: Force forward slashes in paths. Code in tools/mpy-tool.py and py/frozenmod.c relies on the source file path encoded in a .mpy file to have forward slashes (e.g. by searching for '/__init__.py'). Enforce that when creating these files, thereby fixing import of .mpy files and frozen modules not working before because they could have backslashes when built with the windows port. --- mpy-cross/main.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mpy-cross/main.c b/mpy-cross/main.c index 4a21d75846e0..13bb17b13dba 100644 --- a/mpy-cross/main.c +++ b/mpy-cross/main.c @@ -182,6 +182,15 @@ STATIC void pre_process_options(int argc, char **argv) { } } +STATIC char *backslash_to_forwardslash(char *path) { + for (char *p = path; p != NULL && *p != '\0'; ++p) { + if (*p == '\\') { + *p = '/'; + } + } + return path; +} + MP_NOINLINE int main_(int argc, char **argv) { mp_stack_set_limit(40000 * (sizeof(void *) / 4)); @@ -242,7 +251,7 @@ MP_NOINLINE int main_(int argc, char **argv) { exit(usage(argv)); } a += 1; - source_file = argv[a]; + source_file = backslash_to_forwardslash(argv[a]); } else if (strncmp(argv[a], "-msmall-int-bits=", sizeof("-msmall-int-bits=") - 1) == 0) { char *end; mp_dynamic_compiler.small_int_bits = @@ -308,7 +317,7 @@ MP_NOINLINE int main_(int argc, char **argv) { mp_printf(&mp_stderr_print, "multiple input files\n"); exit(1); } - input_file = argv[a]; + input_file = backslash_to_forwardslash(argv[a]); } } From 6abf03b5d0b73e17260256580fa6f4881de18deb Mon Sep 17 00:00:00 2001 From: stijn Date: Tue, 24 Jan 2023 11:48:20 +0100 Subject: [PATCH 7/8] windows/msvc: Fix module freezing. Make this more generally useful and in line with what the mingw and unix ports do: 16bit dig size to work on 32bit ports, a self-contained qstrdefs.preprocessed.h because makemanifest.py uses that, and a dev variant which effectively puts this to use: previously the uasyncio module wasn't frozen but instead tests ran by importing it from the extmod/ directory. --- ports/windows/.appveyor.yml | 2 +- ports/windows/msvc/genhdr.targets | 6 ++++-- ports/windows/variants/dev/mpconfigvariant.props | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ports/windows/.appveyor.yml b/ports/windows/.appveyor.yml index 41b554b2d964..c1a114a0f897 100644 --- a/ports/windows/.appveyor.yml +++ b/ports/windows/.appveyor.yml @@ -34,7 +34,7 @@ before_build: - + "@ | Set-Content build.proj diff --git a/ports/windows/msvc/genhdr.targets b/ports/windows/msvc/genhdr.targets index 7d60e08a0919..7bd8364a9ed0 100644 --- a/ports/windows/msvc/genhdr.targets +++ b/ports/windows/msvc/genhdr.targets @@ -150,7 +150,9 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) { $(QstrGen).tmp - + + + @@ -167,7 +169,7 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) { - MICROPY_MODULE_FROZEN_MPY=1;MICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool;%(PreprocessorDefinitions) + MICROPY_MODULE_FROZEN_MPY=1;MICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool;MPZ_DIG_SIZE=16;%(PreprocessorDefinitions) diff --git a/ports/windows/variants/dev/mpconfigvariant.props b/ports/windows/variants/dev/mpconfigvariant.props index 14ce01a81613..be1f1ae51e5d 100644 --- a/ports/windows/variants/dev/mpconfigvariant.props +++ b/ports/windows/variants/dev/mpconfigvariant.props @@ -1,5 +1,8 @@ + + $(PyVariantDir)manifest.py + %(PreprocessorDefinitions);MICROPY_ROM_TEXT_COMPRESSION=1 From 850f09b109ebdaafe3dc7cf94b99278342227b81 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Thu, 26 Jan 2023 14:10:18 +0100 Subject: [PATCH 8/8] tools/mpy-tool.py: Initialize line_info_top. Without it the line number mapping doesn't work. Signed-off-by: Martin Milata --- tools/mpy-tool.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/mpy-tool.py b/tools/mpy-tool.py index 0b8a0403ca28..fe83305d7132 100755 --- a/tools/mpy-tool.py +++ b/tools/mpy-tool.py @@ -936,6 +936,10 @@ def freeze_raw_code(self, prelude_ptr=None, type_sig=0): " .line_info = fun_data_%s + %u," % (self.escaped_name, self.offset_line_info) ) + print( + " .line_info_top = fun_data_%s + %u," + % (self.escaped_name, self.offset_closure_info) + ) print( " .opcodes = fun_data_%s + %u," % (self.escaped_name, self.offset_opcodes) )