diff --git a/.github/workflows/circuitpython.yml b/.github/workflows/circuitpython.yml index 2adcb901..fca03ba0 100644 --- a/.github/workflows/circuitpython.yml +++ b/.github/workflows/circuitpython.yml @@ -210,7 +210,7 @@ jobs: run: timeout 300 ./builds/circuitpython/unix/coverage/micropython modules/mdns/tests/test_mdns.py # The ESP32-P4 host engine on CircuitPython: usbhost's C compiled against - # CircuitPython's own ESP-IDF 6 and Espressif's usb component, for the + # CircuitPython's own ESP-IDF 6.1 and Espressif's usb component, for the # DEV-KIT's board cell. Nothing else in CI compiles this path, since the # unix port builds usbhost to nothing, and a change to the shared engine # sources (modules/usbhost/src) can break it with every other check green. diff --git a/deps.lock b/deps.lock index c1bcac78..47c8df8b 100644 --- a/deps.lock +++ b/deps.lock @@ -16,9 +16,9 @@ SDL2 https://github.com/libsdl-org/SDL/releases/download/release-2.30.10/SD espressif__tinyusb https://github.com/micropython/tinyusb-espressif.git v0.21.0.1-micropython1 # CircuitPython is the second interpreter, and the one pin that is a source # tree rather than a toolchain. Always our own checkout in deps/, never a link -# to a sibling. 11.0.0-alpha.1 is commit 520805e12, the first release of the -# 11.0 line, whose core is MicroPython 1.29, like UPSTREAM. -circuitpython https://github.com/adafruit/circuitpython.git 11.0.0-alpha.1 +# to a sibling. 11.0.0-alpha.2 is commit d53b2277c, whose core is MicroPython +# 1.29, like UPSTREAM, and whose espressif port moved to ESP-IDF 6.1. +circuitpython https://github.com/adafruit/circuitpython.git 11.0.0-alpha.2 # ESP-IDF components for cameraif on CircuitPython's espressif port: the camera # sensor drivers and the two components they need, from Espressif's component # registry, at the versions MicroPython's P4 build resolves. CircuitPython diff --git a/docs/build-plan.md b/docs/build-plan.md index 5242da1f..3dd295e7 100644 --- a/docs/build-plan.md +++ b/docs/build-plan.md @@ -331,7 +331,7 @@ interpreter is shared: the module names and `modules.lock`, the workspace links, the output layout and the build record. What differs is one function: - **The checkout.** CircuitPython is pinned in `deps.lock` like a toolchain - (`11.0.0-alpha.1`, whose core is MicroPython 1.29) and cloned into + (`11.0.0-alpha.2`, whose core is MicroPython 1.29) and cloned into `deps/circuitpython`, always our own clone, never a link to a sibling checkout. A build fetches only the submodules its target needs, with CircuitPython's own `tools/ci_fetch_deps.py` (a board's name, or `tests` @@ -347,7 +347,7 @@ links, the output layout and the build record. What differs is one function: objects under a directory named like the module's, and two worktrees checked out under the same branch name would otherwise share one. - **espressif brings its own ESP-IDF.** CircuitPython's espressif port builds - with the ESP-IDF in `ports/espressif/esp-idf` (6.0 for 11.0.0-alpha.1), not + with the ESP-IDF in `ports/espressif/esp-idf` (6.1 for 11.0.0-alpha.2), not the `esp-idf` in `deps.lock`. Before make, the build initialises that tree's submodules shallowly (ESP-IDF's CMake would otherwise clone them with their whole history, gigabytes for `esp32-wifi-lib` alone), runs its `install.sh` @@ -389,7 +389,7 @@ links, the output layout and the build record. What differs is one function: of each it passes Linux's 128 KB limit on one argument. The banner is CircuitPython's, unchanged: `Adafruit CircuitPython -11.0.0-alpha.1 on ; with `. A module that has to +11.0.0-alpha.2 on ; with `. A module that has to behave differently here can test `CIRCUITPY`, which every CircuitPython port sets, unix included; pygraphics also passes its own define from its `micropython.mk`, so it knows it came in as a user C module and not through diff --git a/modules/displayif/UPSTREAM b/modules/displayif/UPSTREAM index c209e369..aadddee3 100644 --- a/modules/displayif/UPSTREAM +++ b/modules/displayif/UPSTREAM @@ -11,9 +11,9 @@ CI builds the unix port from that pin. Nothing here repeats it, so it can't go s Verify locally with: git -C rev-parse HEAD # matches ../../UPSTREAM ## CircuitPython (usdl2 desktop path only, as a user C module) -Tested against: 11.0.0-alpha.1 (CircuitPython 11 is the first line whose +Tested against: 11.0.0-alpha.2 (CircuitPython 11 is the first line whose USER_C_MODULES block matches MicroPython 1.29's) - https://github.com/adafruit/circuitpython @ 520805e12 + https://github.com/adafruit/circuitpython @ d53b2277c ## SDL2 (desktop usdl2 backend) Minimum: >= 2.0 (SDL_* API used by src/ports/desktop/usdl2/) diff --git a/patches/circuitpython/0006-espressif-esp-idf-components-a-user-c-module-asks-for.patch b/patches/circuitpython/0006-espressif-esp-idf-components-a-user-c-module-asks-for.patch index e292671b..6d573537 100644 --- a/patches/circuitpython/0006-espressif-esp-idf-components-a-user-c-module-asks-for.patch +++ b/patches/circuitpython/0006-espressif-esp-idf-components-a-user-c-module-asks-for.patch @@ -26,9 +26,9 @@ is in the firmware. diff --git a/ports/espressif/CMakeLists.txt b/ports/espressif/CMakeLists.txt --- a/ports/espressif/CMakeLists.txt +++ b/ports/espressif/CMakeLists.txt -@@ -8,6 +8,20 @@ - set(COMPONENTS bt driver esp_driver_dac esp_driver_gpio esp_driver_gptimer esp_driver_i2c esp_driver_i2s esp_driver_ledc esp_driver_pcnt esp_driver_rmt esp_driver_sdmmc esp_driver_spi esp_driver_touch_sens esp_driver_tsens esp_driver_uart esp-tls esp_adc esp_event esp_netif esp_psram esp_security esp_wifi esptool_py freertos log lwip main mbedtls mdns pthread soc ulp wpa_supplicant esp_lcd vfs esp_stdio sdmmc esp-camera) - set(EXTRA_COMPONENT_DIRS "esp-protocols/components/mdns" "esp-camera") +@@ -13,6 +13,20 @@ if(CIRCUITPY_ESP_HOSTED) + list(APPEND COMPONENTS esp-hosted) + endif() +# ESP-IDF components a user C module needs that this list leaves out +# (USER_ESP_IDF_COMPONENTS, which the module's micropython.mk adds to), and @@ -45,12 +45,12 @@ diff --git a/ports/espressif/CMakeLists.txt b/ports/espressif/CMakeLists.txt +list(REMOVE_DUPLICATES COMPONENTS) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) + set(ENV{ESP_IDF_VERSION} "${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}") project(circuitpython) - diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile -@@ -879,13 +879,19 @@ +@@ -935,13 +935,19 @@ endif SDKCONFIGS := esp-idf-config/sdkconfig.defaults;$(DEBUG_SDKCONFIG);$(FLASH_SIZE_SDKCONFIG);$(FLASH_MODE_SDKCONFIG);$(FLASH_SPEED_SDKCONFIG);$(PSRAM_SDKCONFIG);$(PSRAM_SIZE_SDKCONFIG);$(PSRAM_MODE_SDKCONFIG);$(PSRAM_SPEED_SDKCONFIG);$(BLE_SDKCONFIG)$(NATIVE_SDKCONFIG);$(TARGET_SDKCONFIG);boards/$(BOARD)/sdkconfig @@ -66,12 +66,12 @@ diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile QSTR_GLOBAL_REQUIREMENTS += $(BUILD)/esp-idf/config/sdkconfig.h $(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig boards/$(BOARD)/mpconfigboard.mk CMakeLists.txt | $(BUILD)/esp-idf $(STEPECHO) "Create $@" -- $(Q)env IDF_PATH=$(IDF_PATH) IDF_COMPONENT_MANAGER=0 cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-$(IDF_TARGET).cmake -DIDF_TARGET=$(IDF_TARGET) -GNinja -+ $(Q)env IDF_PATH=$(IDF_PATH) IDF_COMPONENT_MANAGER=0 cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-$(IDF_TARGET).cmake -DIDF_TARGET=$(IDF_TARGET) $(USER_ESP_IDF_CMAKE_ARGS) -GNinja +- $(Q)env IDF_PATH=$(IDF_PATH) IDF_COMPONENT_MANAGER=0 cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-$(IDF_TARGET).cmake -DIDF_TARGET=$(IDF_TARGET) -DCIRCUITPY_ESP_HOSTED=$(CIRCUITPY_ESP_HOSTED) -GNinja ++ $(Q)env IDF_PATH=$(IDF_PATH) IDF_COMPONENT_MANAGER=0 cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-$(IDF_TARGET).cmake -DIDF_TARGET=$(IDF_TARGET) -DCIRCUITPY_ESP_HOSTED=$(CIRCUITPY_ESP_HOSTED) $(USER_ESP_IDF_CMAKE_ARGS) -GNinja $(Q)$(PYTHON) tools/check-sdkconfig.py \ CIRCUITPY_DUALBANK=$(CIRCUITPY_DUALBANK) \ CIRCUITPY_STORAGE_EXTEND=$(CIRCUITPY_STORAGE_EXTEND) \ -@@ -996,6 +1002,21 @@ +@@ -1124,6 +1130,21 @@ endif ifneq ($(CIRCUITPY_SDIOIO),0) ESP_IDF_COMPONENTS_LINK += sdmmc esp_driver_sdmmc esp_driver_sd_intf esp_hal_sd endif @@ -96,7 +96,7 @@ diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c -@@ -413,6 +413,9 @@ +@@ -436,6 +436,9 @@ void *esp_native_code_commit(void *buf, size_t len, void *reloc) { } #endif @@ -106,7 +106,7 @@ diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port void reset_port_early(void) { // esp-camera adds an I2C device on the ESP I2C bus, and keeps it there. This // is unlike busio.I2C, which adds and removes the device on each operation. -@@ -421,6 +424,13 @@ +@@ -444,6 +447,13 @@ void reset_port_early(void) { #if CIRCUITPY_ESPCAMERA espcamera_reset(); #endif diff --git a/patches/circuitpython/0007-audiomixer-level-one-passes-samples-through-unchanged.patch b/patches/circuitpython/0007-audiomixer-level-one-passes-samples-through-unchanged.patch deleted file mode 100644 index 2b0affaa..00000000 --- a/patches/circuitpython/0007-audiomixer-level-one-passes-samples-through-unchanged.patch +++ /dev/null @@ -1,32 +0,0 @@ -audiomixer: level 1.0 passes samples through unchanged without ARM - -On ARM Cortex-M4 and up, Mixer.c multiplies a sample by a voice's level -with smulwb, which is exact. Every other build (unix, the Xtensa ESP32 -ports) fell back to a float divide by (1 << 15) - 1. The level is a Q15 -number where 1.0 is 32768, so a voice at level 1.0 had a gain of -32768/32767, and any sample above about 32740 gained a step. A bare mixer -turned -32752 into -32753. - -A level of exactly 1.0 now copies the sample. Every other level keeps -the float multiply it had, so a quieter voice scales as before. - -diff --git a/shared-module/audiomixer/Mixer.c b/shared-module/audiomixer/Mixer.c -index 464117f..c7109c7 100644 ---- a/shared-module/audiomixer/Mixer.c -+++ b/shared-module/audiomixer/Mixer.c -@@ -108,8 +108,14 @@ static inline uint32_t mult16signed(uint32_t val, int32_t lomul, int32_t himul) - #else - uint32_t result = 0; - for (int8_t i = 0; i < 2; i++) { -- float mod_mul = (float)(i ? himul : lomul) / (float)((1 << 15) - 1); -+ int32_t mul = i ? himul : lomul; - int16_t ai = (val >> (sizeof(uint16_t) * 8 * i)); -+ if (mul == (1 << 15)) { -+ // Level 1.0 passes the sample through unchanged. -+ result |= (((uint32_t)ai) & 0xffff) << (sizeof(int16_t) * 8 * i); -+ continue; -+ } -+ float mod_mul = (float)mul / (float)((1 << 15) - 1); - int32_t intermediate = (int32_t)(ai * mod_mul); - if (intermediate > SHRT_MAX) { - intermediate = SHRT_MAX;