登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
轻量养虾,开箱即用!低 Token + 稳定算力,Gitee & 模力方舟联合出品的 PocketClaw 正式开售!点击了解详情
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
23
Star
48
Fork
2
Gitee 极速下载
/
micropython
代码
Wiki
统计
流水线
服务
JavaDoc
PHPDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
开发画像分析
我知道了,不再自动展开
标签
标签名
描述
提交信息
操作
v1.29.0-preview
367178f
2026-04-07 11:07
下载
v1.28.0
PWM on alif and stm32, new machine.CAN API, t-strings and weakref module This release of MicroPython sees `machine.PWM` support finally added to the stm32 port, as well as the alif port. This rounds out PWM support to all Tier 1 and Tier 2 microcontroller-based ports, making it easy to create and control PWM outputs in a consistent way. A new `machine.CAN` class that has been in development for a couple of years has now been finalised in this release, with added documentation, a common set of bindings, comprehensive tests, and an implementation for the stm32 port. This is a big step forward for a consistent way to use CAN across all of the ports, and implementations for other ports will follow soon. This release also sees the addition of template strings as per PEP 750 https://peps.python.org/pep-0750/. Template strings (or t-strings) are similar to f-strings, allowing expressions within the string literal. But unlike f-strings, t-strings do not concatenate the pieces of the literal, rather they remain as separate components within a `Template` object. MicroPython's t-strings match CPython almost exactly, except for a few minor differences (the a/ascii conversion specifier and space after a conversion specifier are not supported). Template strings are enabled at the "full feature" level, which includes the alif, mimxrt, samd (SAMD51 only) and webassembly (pyscript variant) ports. The t-string parsing code is an extension of the existing f-string parser, and in order to support nested t-string, f-strings now also support nested f-strings: f-strings within expressions within f-string literals. Another Python feature added in this release is the `weakref` module with `weakref.ref` and `weakref.finalize` classes. These classes allow registering a callback to be called when an object is reclaimed by the garbage collector. The semantics of this follow very closely the weakref semantics in CPython (except for the fact that MicroPython does not use reference counting). Due to the memory and garbage collector overhead, this module is currently only enabled on the webassembly pyscript variant, although it can be manually enabled on any port if needed. An outline of MicroPython's design values has been added to the main README. This aims to put into words some of the more intangible aspects of the project, in the hope that it will help strengthen and maintain those values moving forward. All MicroPython users and developers are encouraged to read these values, which can be found at https://github.com/micropython/micropython/blob/master/README.md#micropython-design-values In the native emitter component, the RISC-V 32-bit emitter has a new architecture flag "zcmp" which can be enabled for RV32 targets that support compressed instructions. When this flag is enabled, Zcmp opcodes are used for function prologues and epilogues. There have also been some optimisations to generated native code, as well as added support for inline Xtensa assembler on windowed cores (like the esp32). Furthermore, it's now possible to configure MicroPython (at build time) to be able to load native code from .mpy files without having the native emitter enabled. As usual, work has continued on the test suite, making it more robust to target failures, better able to skip tests that can't run on a target, and run consistently across a broader range of targets. All these things help maintain the high quality of the MicroPython code base. ROM filesystem support and the VfsRom class have been enabled on a few more ports, namely: mimxrt, nrf, renesas-ra and samd (both SAMD21 and SAMD51). The alif port sees the `alif_ensemble-cmsis-dfp` library updated to v1.3.4, support to put external flash to sleep, and improved support for deepsleep power saving modes, with wake-up from deepsleep via a falling GPIO or RTC alarm (the latter is available by the standard `timeout_ms` argument to `machine.deepsleep()`). As mentioned above, this port now has PWM support via the standard `machine.PWM` interface, and provides the `freq()`, `duty_u16()` and `duty_ns()` methods as well as the `invert` keyword argument in the PWM constructor. There are 11 independent timers with 22 PWM outputs. The esp32 port adds a new LDO driver, and enables Zcmp opcodes, both for ESP32-P4 SoCs. `os.dupterm()` reading has been improved (it's no longer necessary to call `os.dupterm_notify()`) and various bugs have been fixed. Support for ESP-IDF from v5.3 and up to v5.5.1 has been consolidated, and support for IDF below v5.3 has now been dropped. The mimxrt port now implements the standard `machine.Counter` and `machine.Encoder` classes, and adds a few new features such as: min/max counter values, index, reset and match pins, support for cycle counting and support for IRQ callbacks. The general documentation and mimxrt quick reference has been updated to describe these additions. This port has also updated the `nxp_driver` SDK to MCUX_2.16.100, added PSRAM support, added support for DP83867 PHY Ethernet, and increased the resolution of the RTC from 1 second to 1/32768 seconds. The rp2 port has updated `pico-sdk` to its 2.2.0 release, and as part of this switched all RNG sources from ROSC to the new `pico_rand` component. This port has also enabled Zcmp opcodes for RP2350 in RV32 mode. As mentioned above, the stm32 port now has the standard `machine.PWM` class available, which works across all 14 MCU families supported by this port. The `freq()`, `duty_u16()` and `duty_ns()` methods are available, as well as output inversion. A heuristic is used to statically assign a TIM and channel to each pin that can support PWM, and the heuristic is chosen to maximise the number of independent PWM outputs. The new `machine.CAN` implementation is available on MCUs with either a bxCAN or FD-CAN peripheral, although flexible data-rates are not yet supported. New boards added in this release are: - esp32 port: SPARKFUN_THINGPLUS_ESP32C5 and SEEED_XIAO_ESP32C6; - mimxrt port: PHYBOARD_RT1170; - rp2 port: CYTRON_NANOXRP_CONTROLLER, CYTRON_MOTION_2350_PRO, WAVESHARE_RP2350B_CORE, WAVESHARE_RP2040_LCD_0_96, WAVESHARE_RP2040_PLUS, WAVESHARE_RP2040_ZERO and SEEED_XIAO_RP2040; - stm32 port: NUCLEO_H753ZI and WEACTSTUDIO_MINI_STM32U585. The change in code size since the previous release for select builds of various ports is (absolute and percentage change in the text section): bare-arm: -52 -0.092% minimal x86: -321 -0.173% unix x64: -104 -0.012% (standard variant) stm32: +7028 +1.782% (PYBV10 board) esp32: +844 +0.048% (ESP32_GENERIC board) mimxrt: +10072 +2.685% (TEENSY40 board) renesas-ra: +1816 +0.289% (EK_RA6M2 board) nrf: +1788 +0.947% (PCA10040 board) rp2: +356 +0.104% (RPI_PICO board) rp2: -1552 -0.172% (RPI_PICO2_W board) samd: +3492 +1.288% (ADAFRUIT_ITSYBITSY_M4_EXPRESS board) The leading causes of these changes in code size are: - bare-arm, minimal x86, unix x64: make some tuple and list helper- functions inline - stm32: add new `machine.PWM` and `machine.CAN` classes - esp32: use detailed error strings for TLS sockets, various small port-specific fixes - mimxrt: support for VfsRom filesystem, support for t-strings, add new `machine.Counter` and `machine.Encoder` classes - renesas-ra: support for VfsRom filesystem - nrf: support for VfsRom filesystem - rp2: switch RNG source to pico_rand, reduce footprint of pin structures - samd: support for VfsRom filesystem, support for t-strings Thanks to everyone who contributed to this release: Alessandro Gatti, Algy Tynan, Alon Bar-Lev, Andrew Leech, Angus Gratton, Anson Mansfield, Antonio Galea, Artem Makarov, Chris Webb, Damien George, Daniël van de Giessen, Didier C, Dryw Wade, Elvis Pfutzenreuter, EngWill, FH, Fin Maaß, iabdalkader, Jack Whitham, Jacob Williams, Jeff Epler, jetpax, Jos Verlinde, Koudai Aono, Kwabena W. Agyeman, Matt Trentini, Matthias Urlichs, mdaeron, Michel Le Bihan, Ned Konz, Oliver Joos, Paul Grayson, Peter Harper, Phil Howard, robert-hh, stijn, sync-on-luma, Thomas Kiss, Thomas Propst, Yuuki NAGAO. MicroPython is a global Open Source project, and contributions were made from the following timezones: -0800, -0700, -0600, -0500, -0400, -0300, +0000, +0100, +0200, +0300, +0800, +0900, +1000, +1100. The work done in this release was funded in part through GitHub Sponsors, and in part by George Robotics, Espressif, Arduino, OpenMV, and Planet Innovation. What follows is a detailed list of changes, generated from the git commit history, and organised into sections. Main components =============== all: - fix spelling of Micropython -> MicroPython - use enum instead of bool argument to mp_handle_pending - remove warning about the project being in beta stage - add a section describing MicroPython's values py core: - misc: remove unused mp_check function - emitnative: optimise register clearing - asmrv32: reserve a flag for the Zcmp RV32 CPU extension - asmrv32: use Zcmp opcodes for function prologues and epilogues - persistentcode: decouple native code loading from emitters' presence - persistentcode: detect the target architecture from compiler defines - emitglue: flush caches when loading native code without emitters - misc: add byte-swapping macros - emitglue: check for bytecode with MICROPY_PY_FUNCTION_ATTRS_CODE - mpconfig: enable MICROPY_PY_FUNCTION_ATTRS_CODE when marshal enabled - persistentcode: support saving functions with children - objfun: support __code__ on functions with children - vstr: make vstr_ins_byte/char functions inline to reduce code size - vstr: add vstr_ins_strn helper function - vstr: don't check for byte_len>0 in vstr_ins_blank_bytes - lexer: use null char as lexer EOF sentinel - lexer: add support for nested f-strings within f-strings - lexer: move f-string completion code to more logical location - runtime: make import-all support non-modules via __dict__/__all__ - runtime: reorder mp_handle_pending_behaviour_t enum - runtime: rename mp_handle_pending_internal to mp_handle_pending - misc: remove unused CHECKBUF macros - objmodule: move decl of mp_obj_module_get_globals to objmodule.h - objfun: move decl of mp_obj_fun_get_name to objfun.h - objfun: rename mp_obj_fun_get_name to mp_obj_fun_bc_get_name - objlist: move all list helper declarations to objlist.h - objlist: make three list helper functions inline - objtuple: move all tuple helper declarations to objtuple.h - objtuple: make mp_obj_tuple_get an inline function - emitinlinextensa: refactor handling of selected opcodes - objarray: avoid double zero init on sized bytearrays - objstr: avoid double zero init on sized bytes - stream: use detailed error strings for TLS sockets - objzip: adjust zip iter code to not use mp_obj_tuple_del - objtuple: remove unused mp_obj_tulpe_del function - gc: trace all marked heads in debug log - gc: differentiate between root and subtree pointers for debug log - misc: fix truncating cast to char - emitinlinextensa: add inline assembler support for windowed cores - emitinlinextensa: refactor handling of selected narrow opcodes - asmthumb: do not clobber index register on viper load/store - asmrv32: do not clobber index register on viper load/store - objtype: expose mp_native_base_init_wrapper_obj - objexcept: check for incompletely constructed exceptions - objstr: factor code with a helper function to create empty str/bytes - objstr: fix b"".hex() so it returns an empty str object - lexer: fix parsing of f'{{' - add support for PEP 750's t-strings - objlist: add helpers for creating/ensuring list args - objtemplate: correctly cast qstr literals when printing - modweakref: implement weakref module with ref and finalize classes - emitglue: fix macro logic that selects cache flushing code extmod: - modopenamp: rework trace buffer setup procedure - modselect: handle pending events before entering poll - modlwip: fix latent bug with partially created socket object - modlwip: adjust logic for determining a listening socket - modlwip: narrow error_lookup_table type to int8_t - modlwip: keep TCP data on remote RST - modmarshal: support marshal.dumps of functions with children - ensure stream ioctl's are a no-op for unknown requests - modlwip: always set the lwip_socket_ioctl() return value - vfs_reader: process pending events during file reads - modos: raise an error at a negative argument of os.urandom() - mbedtls: factor out mbedtls_hardware_poll() to common code - keep LWIP timer running if lwip poll_sockets() is called - add generic machine.CAN helpers & docs - machine_pwm: fix use of object when pointer is needed - nimble/modbluetooth_nimble: handle port init failures - modlwip: ensure socket is finalisable if error during creation - modlwip: call user callback on newly-received UDP or RAW packet shared: - readline: handle \r and \n correctly as a newline drivers: no changes specific to this component/port mpy-cross: - mpconfigport: explicitly disable native code loading - enable t-strings lib: - nxp_driver: update mimxrt SDK to MCUX_2.16.100 - pico-sdk: update pico-sdk to 2.2.0 release - libhydrogen: update to latest release - alif_ensemble-cmsis-dfp: update to v1.3.4 - micropython-lib: update submodule to latest - cyw43-driver: update driver to latest version v1.1.1 Support components ================== docs: - library/network.WLAN: fix typo for ESP32 protocol constants - library: document that sleep(0)/sleep_ms(0) run the scheduler - mimxrt: add docs for mimxrt.Flash - library/network.PPP: document the optional poll() argument - develop/writingtests: document parameters of run_test.py - add documentation for the mimxrt Encoder/Counter class - library: document string.templatelib module - esp32: replace 'esptool.py' by 'esptool' in command line example - library/re: document non-capturing grouping - add generic machine.CAN helpers & docs - library/machine.PWM: add alif,stm32 to list of ports with invert - library/machine.PWM: document hardware PWM layout - update copyright year range to include 2026 - reference/speed_python: update native emitter limitations - library/weakref: add documentation for weakref module examples: no changes specific to this component/port tests: - ports/esp32/check_err_str.py: preallocate global variable - basics/string_fstring.py: test fstring nested replacement fields - run-tests.py: skip list sort stress test for ESP8266 - extmod/vfs_blockdev_invalid.py: handle low memory conditions - target_wiring: provide an ESP8266 target wiring module - run-tests.py: discover RV32 extension inlineasm tests - run-natmodtests.py: explicitly open prelude file - basics/try_finally: fix try/finally flow tests under CPython 3.14 - float/math_fun: fix domain error tests with CPython 3.14 - float/complex1.py: fix CPython 3.14 deprecation - run-tests.py: re-add stress_schedule.py for GitHub Actions - thread/stress_schedule.py: decrease backoff time - micropython: add new schedule_sleep.py test - run-tests.py: re-enable some asyncio tests for the native emitter - thread/stress_schedule.py: remove decorator/inaccurate comment - multi_net/tcp_client_rst.py: improve and extend test - factor out common helper functions to separate Python module - multi_net: skip all ssl/tls tests on axTLS - multi_net: use random.getrandbits instead of random.randrange - extmod/machine_spi_rate.py: use target wiring for SPI instances - target_wiring: add SPI instance for mimxrt, nrf, renesas-ra, samd - target_wiring/README: add README describing target_wiring specs - run-tests.py: exit with error code 2 if test runner fails - test_utils.py: abort test if serial port fails at start - run-tests.py: abort test run if enter_raw_repl fails many times - run-tests.py: broaden the check for raw REPL failure - micropython: add a test for checking viper value clobbering - extmod/os_urandom.py: add test for os.urandom - micropython: add a test for throwing incomplete exception - cpydiff: add a section for throwing incomplete exceptions - run-tests.py: add an argument for showing which tests would run - run-tests.py: make skip logic work irregardless of test path - run-tests.py: use normal discovery if tests dir passed explicitly - cmdline: make tests succeed irregardless of invocation path - run-tests.py: output consistent test file paths - run-multitests.py: improve error handling for communication error - net_inet: use the letsencrypt TLS root cert for all tests - run-internalbench.py: add option for running against CPython - extmod_hardware/machine_pwm.py: add alif pin config - basics/builtin_str_hex.py: remove corresponding .exp file - extmod_hardware/machine_encoder.py: add a MIMXRT configuration - extmod_hardware/machine_encoder.py: separate the connection test - extmod_hardware/machine_counter.py: separate the connection test - add full feature and coverage tests for PEP 750 template strings - run-tests.py: ignore known-flaky test failures - ports/stm32/can: update pyb.CAN tests for FDCAN - extmod_hardware/machine_pwm.py: round expected timing calculation - extmod_hardware/machine_pwm.py: add pin settings for stm32 port - extmod_hardware/machine_pwm.py: convert test to use target_wiring - basics: add tests for weakref.ref and weakref.finalize - basics: add test for weakref having exception in callback - feature_check/tstring.py: remove check for string.templatelib tools: - mpy_ld.py: fix R_RISCV_GOT32_PCREL handling - mpy_ld.py: fix handling of R_RISCV_TLSDESC_LOAD_LO12 - mpy_ld.py: add RV64 natmod support - ci.sh: run natmod tests as part of CI for Unix/RV64 - ci.sh: put embedding build rules in ci.sh - ci.sh: update Unix/MIPS target to Ubuntu 24.04 LTS - ci.sh: update Unix/Arm target to Ubuntu 24.04 LTS - ci.sh: use CPython 3.11 for Unix/RV64 - ci.sh: update Unix/x86 target to Ubuntu 24.04 LTS - mpy_ld.py: optimise MPY trampoline sizes if possible - mpy_ld.py: write architecture flags to output natmod if needed - codeformat.py: use input files when formatting python code - ci.sh: increase qemu_arm test run timeout CI: - workflows: bump actions/upload-artifact from 4 to 6 - workflows: bump actions/cache from 4 to 5 - workflows: introduce and use ci_esp32_idf_ver helper - workflows: add esp32 to code size report - workflows: use same Ubuntu for code_size as ports_esp32 - workflows: bump actions/cache from 4 to 5 - workflows: add check for misspelling of "MicroPython" - install Python 3.11 for Windows CI runs - workflows: bump actions/upload-artifact from 6 to 7 - add a Generative AI Usage declaration to the PR template - revert "Run esp32&zephyr daily to keep mstr branch caches hot" - build oldest & newest ESP-IDF versions in CI The ports ========= all ports: - remove incorrect and unnecessary mp_handle_pending declaration - refactor os.urandom() - don't pass -nostdlib in CFLAGS alif port: - Makefile: do not hardcode the python interpreter name - Makefile: enable job server support on Ubuntu LTS - ospi_flash: remove workaround for P10_7 OSPI pinmux issue - boards/OPENMV_AE3: update romfs partition size - boards/OPENMV_AE3: make JTAG pins controllable as GPIOs - fix ALIF_TOOLS to use $(TOP) and remove unused ALIF_CONFIG - modmachine: disable IRQs before going to sleep - ospi_flash: add ospi_flash_sleep helper function - boards/OPENMV_AE3: save power upon deepsleep - boards/OPENMV_AE3: allow user button to wake from sleep - boards/ALIF_ENSEMBLE: add all SW1 pins and enable pull-ups on them - boards/ALIF_ENSEMBLE: add an off-profile - machine_rtc: factor out RTC helper functions - modmachine: implement timeout_ms argument to deepsleep - boards/OPENMV_AE3: configure sensor interrupts as GPIO input - machine_pwm: implement machine.PWM - irq: add missing IRQ priorities bare-arm port: no changes specific to this component/port cc3200 port: - mods/pybpin: reduce footprint of AF pin structures embed port: no changes specific to this component/port esp8266 port: - boards/ESP8266_GENERIC: remove OTA board variant - modesp: allocate executable memory when needed esp32 port: - boards/ESP32_GENERIC_S3: reinstate old FLASH_4M variant - machine_sdcard: fix SDMMC slot assignment for non-default slots - mpconfigport: enable Zcmp opcodes for ESP32P4 - machine_pin: rename legacy CONFIG_ESP32_SPIRAM_SUPPORT option - machine_uart: change default UART(1) pins on ESP32 with SPIRAM - esp32_rmt: update FIXME on RMT module - modesp32: update available RTC pins for ESP32C6 - add LDO driver for ESP32-P4 - mphalport: actually read from dupterm in mp_hal_stdin_rx_chr() - increase minimum CMake version to 3.16 - fix linker errors with CMake <3.25 and libbtree - esp32_rmt: release GIL while waiting for TX done - only check the lockfile currently used by the build - drop support for ESP-IDF <v5.3 - fix build for ESP-IDF version 5.3 - add helpers for creating/ensuring list args - build oldest & newest ESP-IDF versions in CI - boards/SPARKFUN_THINGPLUS_ESP32C5: add SF Thing Plus ESP32-C5 - boards/SEEED_XIAO_ESP32C6: add new XIAO board definition - esp32_common.cmake: add missing C flags to user C module sources mimxrt port: - add support for VfsRom filesystem - pin: reduce footprint of pin structures - machine_adc: initialize LPADC2 for rt117x - machine_adc: support ADC channel groups on rt117x - eth: add DP83867 PHY driver support - boards/MIMXRT1170_EVK: remove obsolete pin defines - eth: improve Dual Ethernet configuration - add ALT11 pin mode support for MIMXRT1176 - increase resolution of RTC to 1/32768 seconds - add PSRAM implementation - Makefile: add CXXFLAGS, and libstdc++ to LDFLAGS - machine_uart: use a wrapper function to handle IRQ idle support - Makefile: make board linker scripts configurable - boards/PHYBOARD_RT1170: add PHYBOARD-RT1170 board support - boards/PHYBOARD_RT1170: update use of mp_handle_pending() - implement Quadrature Encoder and Counter classes - boards/make-pins.py: add the XBAR tag to the AF names - boards: add missing declarations of XBARA1 for two boards - boards/ADAFRUIT_METRO_M7: remove unused WiFi/BLE declarations - machine_encoder: remove executable mode bit minimal port: no changes specific to this component/port nrf port: - main: allocate executable memory when needed - add support for VfsRom filesystem - modules/machine/pin: reduce footprint of pin structures - mpconfigport: remove duplicate help and open from builtins module pic16bit port: - mpconfigport: remove dummy builtins.open function powerpc port: - mpconfigport: remove dummy builtins.open function qemu port: - Makefile: allow usage of a custom QEMU binary to run code - Makefile: allow overriding the test natmods list - enable loading natmods on RV64 - mphalport: ensure mp_hal_delay_ms(0) handles pending tasks renesas-ra port: - add support for VfsRom filesystem - pin: reduce footprint of pin structures - boards/ARDUINO_PORTENTA_C33: increase TinyUSB queue size rp2 port: - mpconfigport: enable Zcmp opcodes for RP2350 in RV32 mode - CMakeLists.txt: set the appropriate mpy-cross flags on all targets - machine_pin: reduce footprint of pin structures - add pico_platform_common to sdk components - remove build patch for Findpioasm.cmake - fix linker scripts to match SDK 2.2.0 - boards/POLOLU_ZUMO_2040_ROBOT: remove header file - switch all RNG sources from ROSC to pico_rand - keep LWIP timer running if lwip poll_sockets() is called - modules/rp2.py: don't corrupt globals on asm_pio() exception - boards/CYTRON_NANOXRP_CONTROLLER: add support for NanoXRP board - boards/CYTRON_MOTION_2350_PRO: add Cytron Motion 2350 Pro board - boards/WAVESHARE_RP2350B_CORE: add Waveshare RP2350B Core board - boards/WAVESHARE_RP2040_LCD_0_96: add Waveshare RP2040 LCD 0.96 - boards/WAVESHARE_RP2040_PLUS: add Waveshare RP2040 Plus 4M and 16M - boards/WAVESHARE_RP2040_ZERO: add Waveshare RP2040 Zero board - rp2_dma: disable DMA IRQ before clearing handler function - boards/SEEED_XIAO_RP2040: add XIAO RP2040 board definition samd port: - add support for VfsRom filesystem for SAMD21 and SAMD51 - pin_af: reduce footprint of pin structures - boards: add more flash choices for Adafruit M4 boards stm32 port: - main: enable all AHB5 GRP1 clocks in low power mode - sdcard: use high speed mode for SD transfers on H5/H7/N6 - add support for all STM32F412xx MCUs - boards: add linker script for STMF412xE with 512k flash - boards/NUCLEO_H753ZI: add NUCLEO_H753ZI board support - boards/NUCLEO_H7x3: fix st-flash and add openocd configuration - boards/NUCLEO_H7x3: add UART1, remove UART5, slow down PLL1Q - default to --connect-under-reset if flashing via deploy-stlink - convert port to use new event waiting functions - boards: add UARTs to NUCLEO F746ZG and NUCLEO F439ZI - update STM32U5 suppport - boards: add WeAct STM32U585 board support - boards/stm32l072xz.ld: correct comment in linker script - pin: reduce footprint of pin structures - support more stm32g4 variants - pyb_can: fix initialising CAN2 clearing CAN1 filters - can: clarify can_clearfilter() arguments - expose FDCAN2 on board NUCLEO_G474RE - add helpers for creating/ensuring list args - add can_get_state() function, use from pyb.CAN - implement index-aware STM32G4 FDCAN HAL TX functions - add machine.CAN implementation - fix printing value of pyb.CAN auto_restart on FDCAN hardware - timer: use HAL macro to determine if TIM is 32-bit - timer: expose functions to convert id to reg and enable TIM clock - machine_pwm: implement machine.PWM class - machine_pwm: use heuristic to assign TIMx_CHy to a pin - boards: disable some features on boards with small flash - boards/stm32f091_af.csv: split TIM2_CH1 from TIM2_ETR - boards/stm32n657_af.csv: add TIM alt funcs to PA0-PA3 - mpthreadport: increase minimum thread stack size to 2.5k - boards/PYBD_SF2: free up some space in internal flash unix port: - alloc: map executable memory for code loading when needed - mpconfigport: enable natmod loading for RISC-V builds - modtime: handle pending events during sleep(0) - unix_mphal: ensure mp_hal_delay_ms handles pending tasks webassembly port: - convert port to use new event waiting functions - Makefile: add test//% target - variants/pyscript: enable weakref module and add tests windows port: - compile printf.c for the msvc port zephyr port: - Kconfig: resolve build problem with multiple FatFs libs - main: put GC heap in noinit linker area - modzsensor: add additional sensor type constants - add support for RISC-V RV32IMC native code emitter - mpconfigport: remove duplicate builtins.open definition - use nodelabel when printing device name - fix macro for getting erase_block_size
e0e9fbb
2026-04-06 21:12
下载
v1.28.0-preview
099cc9f
2025-12-15 07:15
下载
v1.27.0
ESP32C5, ESP32P4 & STM32U5 support, enhanced test suite, port Tier levels This release of MicroPython adds support for ESP32-C5 and ESP32-P4 microcontrollers. The ESP32-P4 can work either standalone as a general purpose processor, or with an external wireless co-processor, currently either an ESP32-C5 or ESP32-C6. Board profiles are provided for all three of these configurations, as well as for the new ESP32-C5. Support for the low-power and high performing STM32U5xx series is also added in this release, supporting USB, ADC, DAC, UART, I2C, SPI and RTC, with a board profile for the NUCLEO-U5A5ZJ-Q. Rigorous and ongoing hardware-based testing is an important part of MicroPython, and with the increasing number of supported hardware platforms -- along with a growing test suite -- it's important to make the tests run as smoothly and as automated as possible. This release makes progress here by making many improvements to the test suite, such as: - auto-detecting if the target has unicode support - automatically including float tests when possible - always including stress tests - improving the skipping of tests that use slice and the micropython module - supporting different expected outputs when running native tests - making tests behave in low-memory condition - tweaking some tests so they can run on minimal builds - making all test runners use the `-t` argument to select the target - converting some tests to use `unittest` - converting some port-specific tests to cross-port tests - adding a test for serial (REPL) reliability and throughput - updating to use CPython 3.8.2 as the reference Python version - adding more internal benchmark tests. In order to support testing on more hardware targets in a scalable way, this release introduces board-specific `target_wiring.py` configuration. This feature allows defining in one location (one file) all the needed test-related hardware connections for a given port or board, definitions which are then imported and used by the tests that need them. Along with providing default definitions, this scheme allows custom hardware to easily specify its own wiring set up for the tests. To start with, all of the `machine.UART` tests have been converted to use `target_wiring.py`. With all the improvements to the test suite, the MicroPython continuous integration (CI) tests now run on the unix minimal variant, and as many tests as possible now run on the zephyr port CI. MicroPython now defines port Tier levels, which categorizes the 20 existing ports into four groups according to their stage of development. This aims to set expectations for the level of support and development each port receives. And also lower the bar of entry for new ports so they can enter at a low Tier and gradually rise up to Tier 1. See the top-level `README.md` and the docs at https://docs.micropython.org/en/latest/develop/support_tiers.html This release also sees MicroPython drop support for Python 2.7 in its build scripts and tools. Python 2.7 has been EOL since January 2020 and all modern operating systems support Python 3. There have been quite a few other improvements, optimizations and bug fixes to the core runtime, including: better 32-bit RISC-V code generation for the native emitter and Zba opcode support, support for relative imports in custom `__import__` callback, `bool` and `len` unary operation support for `dict` views, support for start and end position in `re` match and search methods and IPv6 support in `asyncio.start_server()`. Most ports (except esp32) now support soft and hard IRQ callbacks for `machine.Timer` objects. And the `sys` module is now enabled at all feature levels by default. Some third party libraries have been updated in this release: LittleFS is now at v2.11.2, TinyUSB is at 0.19.0-24, and stm32lib has N6 at 1.2.0, WB at 1.23.0 and newly added U5 support. The mimxrt's nxp_driver submodule has been restructured to match the official mcux-sdk. The alif port sees the addition of `machine.RTC.datetime()` to get and set the RTC, as well as `time.time_ns()`. Also a fix for USB device address setting on fast USB hosts, and fixing of `machine.SPI.init()` to only change requested settings. The esp32 port has been updated to use ESP-IDF v5.5.1, and, as mentioned, now supports ESP32-C5 and ESP32-P4. TinyUSB integration has been improved, with a bug fix for Zero Length Packets that affected REPL reliability, along with a fix for blank USB HID reports on boards with PSRAM. `network.PPP` has had some important fixes to its thread safety, and the `espnow` module can now set the rate without giving an error. I2S has been enabled on all ESP32-C6 boards and a new `esp32.wake_on_gpio()` function has been added to support waking up the SoC via GPIO pins. The qemu port now supports 64-bit RISC-V and adds the VIRT_RV64 board definition, and also adds MPS2_AN500 (Cortex-M7) and MPS3_AN547 (Cortex-M55) boards. These all aid in testing MicroPython on different architectures. For the rp2 port DMA channels are now properly stopped when they are freed, PIO now supports pin wrapping and fixes the use of RP2350B upper-bank pins, and pin alternate functions have been fixed for pins greater than 31. UART_AUX, XIP_CS1, CORESIGHT_TRACE and HSTX alternate functions have been added for RP2350 MCUs. The stm32 port adds support for STM32U5xx series MCUs, as well as STM32F469xx. STM32G0xx sees the addition of DAC support, and fixes to ADC, Timer(4) and RTC wakeup. STM32G4xx now has a hardware I2C implementation, and STM32L4xx supports I2CTarget. LAN now works on STM32N6xx MCUs, including support for gigabit Ethernet with the RTL8211 PHY. There is also now optional support for using TinyUSB as the USB stack, to replace the existing STM USB stack. Although the latter is still the default USB stack the intention is to eventually in a future release switch over to use TinyUSB, which allows defining USB devices in Python. The unix and windows ports have had their main REPL loop replaced with the standard REPL loop code that is used by all the bare-metal ports. This makes it more consistent, and in particular it now supports raw REPL. The zephyr port upgraded Zephyr to v4.2.0, now has the `machine.ADC` class, a new VFS interface to the native Zephyr filesystem, support for a GC split heap, added set/get sensor attributes to `zsensor`, and supports hard IRQ timer callbacks. It will now format the default flash partition if necessary on boot, following other bare-metal ports. New boards include PocketBeagle 2, XIAO BLE NRF52840 SENSE, and NXP MIMXRT1020 EVK. New boards added in this release are: ESP32_GENERIC_C2 FLASH_2M variant, ESP32_GENERIC_C5, ESP32_GENERIC_P4 with standard, C5_WIFI and C6_WIFI variants, SIL_MANT1S and SOLDERED_NULA_MINI (esp32 port), NUCLEO_H7A3ZI_Q, NUCLEO_U5A5ZJ_Q, STM32F469DISC and WEACTSTUDIO_MINI_STM32H743 (stm32 port). The change in code size since the previous release for select builds of various ports is (absolute and percentage change in the text section): bare-arm: -180 -0.316% minimal x86: +867 +0.470% unix x64: +2608 +0.309% stm32: -68 -0.017% cc3200: +112 +0.060% esp8266: +472 +0.067% esp32: +36210 +2.120% mimxrt: +280 +0.075% renesas-ra: +104 +0.017% nrf: +124 +0.066% rp2: +3836 +1.117% (RPI_PICO board) rp2: +1020 +0.111% (RPI_PICO_W board) samd: +596 +0.220% The leading causes of these changes in code size are: - bare-arm: add MICROPY_USE_GCC_MUL_OVERFLOW_INTRINSIC, avoid empty extensible module lists. - minimal x86: enable the sys module. - unix: use standard bare-metal REPL, update micropython-lib submodule (includes argparse improvements). - stm32: support soft IRQ timer callbacks (a refactoring), add MICROPY_USE_GCC_MUL_OVERFLOW_INTRINSIC. - cc3200: correctly format leading zeros with separators, add support for start and end position in `re`, and other minor improvements to the core. - esp8266: support hard IRQ timer callbacks, correctly format leading zeros with separators. - esp32: use IDF 5.5.1 (+30k), update RMT to use the new IDF API. - mimxrt: update TinyUSB, add support for start and end position in `re`. - renesas-ra: correctly format leading zeros with separators, add support for start and end position in `re`. - nrf: print SPI baudrate, polarity and phase, improved timeout handling for UART, correctly format leading zeros with separators. - rp2: enable `hashlib.md5`, update TinyUSB. - samd: update TinyUSB, correctly format leading zeros with separators. Thanks to everyone who contributed to this release: Alessandro Gatti, Alex Tran, Andrew Leech, Angus Gratton, Anson Mansfield, Ayush Singh, Chris Liechti, Chris Mason, Chris Webb, Christian Clauss, Craftzman7, Damien George, Daniël van de Giessen, David Lechner, David Schneider, Dryw Wade, Elvis Pfutzenreuter, ennyKey, Florent, garywill, iabdalkader, Ihor Nehrutsa, Jared Hancock, Jeff Epler, Jimisola Laursen, John Smith, Jos Verlinde, Josip Šimun Kuči, Kwabena W. Agyeman, Matt Trentini, Maureen Helm, Meir Armon, Mike Tolkachev, Mike Wang, Ned Konz, Patrick Van Oosterwijck, Peter Harper, Phil Howard, robert-hh, Steve Sanbeg, stijn, Thomas Watson, Tico06, Vdragon, Vincent1-python, Yanfeng Liu, Yilin Sun, yuan_mo, Yuuki NAGAO. MicroPython is a global Open Source project, and contributions were made from the following timezones: -0800, -0700, -0600, -0500, -0400, -0300, +0000, +0100, +0200, +0300, +0530, +0800, +0900, +1000, +1100. The work done in this release was funded in part through GitHub Sponsors, and in part by George Robotics, Espressif, Arduino, OpenMV, and Planet Innovation. What follows is a detailed list of changes, generated from the git commit history, and organised into sections. Main components =============== all: - remove Python 2.7 support - use "static inline" consistently in function definitions - replace legacy name with MicroPython and MPy as applicable - simplify mp_int_t/mp_uint_t definition - define and describe the port Tier levels - update ruff configuration to target Python 3.8 py core: - asmrv32: make lt/le comparisons emitter shorter - binary: add MICROPY_PY_STRUCT_UNSAFE_TYPECODES - misc: add explicit dependency on py/mpconfig.h - objringio: detect incorrect constructor calls - mkrules.cmake: clean genhdr and frozen_mpy dirs - parse: remove explicit checks for invalid folding operations - objtype: make mp_obj_new_type a static function - misc: add a way to detect sanitizer builds - asmthumb: fix T3 encoding of conditional branches - objtype: use locals_ptr directly instead of getting it from the slot - mpconfig: rename MICROPY_PY___FILE__ to MICROPY_MODULE___FILE__ - mpconfig: move MICROPY_MODULE___ALL__ option to other module options - mpconfig: enable CRYPTOLIB, HASHLIB_MD5, HASHLIB_SHA1 if SSL enabled - builtinimport: guard code needing sys.path with MICROPY_PY_SYS_PATH - mpconfig: enable the sys module at all feature levels by default - obj: fix a comment regarding make_new slot - obj: remove unused map new/free function declarations - parsenum: fix parsing LLONG_MIN in longlong configuration - mkrules.mk: force ".pp" files to always rebuild - makeversionhdr.py: always abbreviate Git hashes to same length - obj: update with_finaliser version to match mp_obj_malloc_var - gc: clean up usage of GC_ALLOC_FLAG_HAS_FINALISER flag - compile: throw SyntaxError instead of asserting - stream: add a stream.readinto1() method for machine.UART - stream: support additional arguments for mp_stream_write1_obj - remove unneeded future imports - obj: document undocumented MP_TYPE_FLAG values - py.cmake: add nlraarch64 - mpstate: make it possible for mpy-cross to set emitter options - asmrv32: use RV32 Zba opcodes if possible - emitinlinerv32: add Zba opcodes to the inline assembler - stream: reuse write implementation for readinto - objrange: allow return of non-small ints - mkrules.mk: add %.sz rule to print size of an object file - objint: fix converting float to int with OBJ_REPR_B - runtime: support importing a method from an instance - add MICROPY_USE_GCC_MUL_OVERFLOW_INTRINSIC - modmath: make MICROPY_PY_MATH_POW_FIX_NAN also fix pow(x, NaN) cases - mpconfig: introduce SIZE_FMT macro - runtime: fix printing of failed allocation amounts - scheduler: allow selective handling in mp_handle_pending - misc: use _Static_assert for MP_STATIC_ASSERT where possible - misc: don't warn about a GNU extension for static assert macro - py.mk: regenerate moduledefs.h if makemoduledefs.py changes - makemoduledefs.py: avoid empty extensible module lists - objmodule: avoid interning a string unnecessarily - mpprint: correctly format leading zeros with separators - persistentcode: add architecture flags compatibility checks - persistentcode: add architecture flags check for RV32 platforms - modsys: add architecture flags to MicroPython metadata - objlist: make a small code size optimization in mp_quicksort - emitinlinerv32: refactor opcode arguments validation - emitinlinerv32: refactor load/store opcodes validation - asmrv32: refactor register-indexed load/store emitters - asmrv32: generate better comparison sequences - objcode: remove `mp_obj_code_t.lnotab` field from v2 preview - emitnative: generate shorter RV32 code for exception handling - builtinimport: support relative import in custom __import__ callback - objdict: implement bool and len unary ops for dict views - compile: allow NULL emitter table entries - emitglue: add hook for RV32 arch to flush D-cache for native emitter - asmbase: cast prior to bitwise invert when the type is widened - emitinlinerv32: change mask arg of is_in_signed_mask to uint32_t - builtinhelp: don't print removed sentinel entries extmod: - modre: add support for start- and endpos - modlwip: support `family` specification in getaddrinfo - modframebuf: fix crash in scroll() for large inputs - modframebuf: save code size in setpixel - modtime: move tuple creation to common localtime implementation - modlwip: remove unused include and functions - modplatform: expose CPU features/extensions - machine_uart: return from read()/write() at the first timeout - machine_timer: support hard IRQ soft timer callbacks - vfs_reader: check that open() resulted in a file-like object - modopenamp: check that mp_vfs_open actually returned a stream - moductypes: error if small ints are not big enough - vfs_blockdev: check return type is an integer - asyncio: add IPv6 support to start_server() - modwebsocket: enable split frames and test them - modwebsocket: save a few bytes of text by using bit checks - asyncio: pass globals in __import__ call shared: - runtime/pyexec: unconditionally reset lock depth - tinyusb: fix build errors with CDC support disabled - tinyusb: fix hang from new tx_overwritabe_if_not_connected flag - tinyusb/mp_usbd_cdc: rewrite USB CDC TX loop - runtime/mpirq: factor out mp_irq_dispatch() and use it - runtime/softtimer: add support for hard callbacks - runtime/mpirq: check separate hard IRQ stack correctly - runtime/pyexec: remove legacy USB IRQ enable code - runtime: set exit code according to the SystemExit exception - tinyusb/mp_usbd: reorder the mp_usbd_init/deinit functions - runtime/pyexec: set __file__ for file input when enabled - runtime/pyexec: provide support for compile-only mode - runtime/pyexec: call mp_hal_stdio_mode_orig/raw as appropriate - runtime/pyexec: set PYEXEC_FORCED_EXIT flag for SystemExit - tinyusb: add macro to override TinyUSB callbacks - tinyusb: remove macro guard for tx_overwritabe_if_not_connected - tinyusb: add optional port-specific hook on USBD init - tinyusb: remove USBD_RHPORT constant drivers: no changes specific to this component/port mpy-cross: - remove unneeded future imports - add RISC-V RV64IMC support in MPY files - main: add support for RV32 Zba opcodes - main: replace mp_stack calls with mp_cstack_init_with_sp_here - main: parse raw integer arch flags values too lib: - tinyusb: update to version 0.18.0 - libm_dbl: allow building when DBL_EPSILON is defined in <float.h> - stm32lib: update N6, U5 & WB - littlefs: update LittleFS to v2.11.2 - tinyusb: update to version 0.19.0-24 - micropython-lib: update submodule to latest Support components ================== docs: - always use sphinx_rtd_theme - document the cross-port Timer hard= option - library/os: document dupterm_notify function - README: update doc build dependency - README: document sphinx-autobuild for local preview - develop/gettingstarted: document the additional unix test targets - develop/gettingstarted: document %.sz and %.pp targets - label table columns as "CPython output" and "MicroPython output" - develop/porting: use mp_cstack_init_with_sp_here in docs - mimxrt/pinout: use Dxx pin identifiers for Teensy boards - library/os: clarify ilistdir tuples size element - add constants and documentation for espnow data rates - library: document OrderedDict.popitem()'s CPython differences - library: fix typos under I2CTarget irq method description - library: add machine.DAC documentation - library/machine.Timer: explain the id parameter in more detail examples: no changes specific to this component/port tests: - run-tests.py: move tests to skip with native emitter to a list - run-tests.py: run tests-with-regex-output as normal tests - micropython: remove big ints dependence for viper boundary tests - run-tests.py: automatically include float tests when possible - run-tests.py: always include stress/ tests directory in tests - run-tests.py: generalise addition of port specific test directory - run-tests.py: autodetect if the target has unicode support - basics: skip tests of io module individually using SKIP - misc/rge_sm.py: remove unused code from the test - run-tests.py: add support for .native.exp expected output files - misc/print_exception.py: use "raise e" instead of no-arg "raise" - micropython/opt_level_lineno.py: force test func to use bytecode - add .native.exp output files for tests that differ with native - require SSL certificate file to be available for test to run - stress/recursive_iternext: rewrite to find its own limit - micropython: make tests behave in low memory condition - run-tests.py: enable Arm inlineasm FPU tests if possible - run-tests.py: factor code for device shortcuts to a function - run-multitests.py: change -i argument to -t - run-natmodtests.py: change -p/-d arguments to -t - run-perfbench.py: change -p/-d arguments to -t - net_inet/tls_num_errors.py: make alloc of emg-exc-buf optional - multi_net: require SSL cert file to be available for test to run - multi_net: simplify SKIP when imports don't exist - add test for heap lock in REPL - ports/rp2: decrease test lower bound for thread lightsleep time - run-tests.py: detect target sys.implementation._build if possible - run-tests.py: add support for board-specific target_wiring config - convert all machine.UART tests to use target_wiring - target_wiring/ZEPHYR_NUCLEO_WB55RG.py: add nucleo_wb55rg - add a test for invalid syntax in @micropython.asm - cpydiff: document lack of OSError errno subtype mapping - cpydiff: document ENOTSUP vs EOPNOTSUPP - cpydiff: test for PEP487 __init_subclass__ - internal_bench/class_instance: benchmark instantiation - internal_bench/var: benchmark checked attribute access - internal_bench/var: benchmark ordered map accesses - run-perfbench.py: fix issues when -s/-m is used with failed tests - cmdline: add tests for using -m combined with sys.atexit - README: update docs for run-perfbench.py now that it uses -t - generalise rp2 timer test into a cross-port test - test hardware timers as well as software timers - ports/unix: add coverage test for readinto1 stream method - test extremes of range() and document differences to CPython - ports/webassembly: move JsProxy identity test to separate file - basics/int_big_to_small.py: bifurcate test using small-int-max - use OBJ_REPR_B compatible mpy file headers - stress/fun_call_limit.py: allow to run with OBJ_REPR_B - ports/webassembly: expand test for registerJsModule - run-tests.py: skip certain tests when using --via-mpy - remove .py.exp files that match with CPython 3.8.2 or newer - stress: improve qstr_limit test to run on minimal targets - misc/sys_exc_info.py: don't rely on slicing - run-tests.py: improve skip detection for tests using slice - run-tests.py: skip more tests that need slice - extmod: improve skip detection of extmod tests - extmod/vfs_posix_paths.py: use tuple instead of set - micropython: improve skipping of tests using micropython module - import: skip import tests where needed - extmod/asyncio_heaplock.py: improve skip detection of test - run-tests.py: don't include cmdline,io tests for minimal targets - basics/subclass_native_init.py: skip if __init__ not supported - run-tests.py: update list of tests that use float - stress/bytecode_limit.py: tweak to run on minimal builds - ports/unix: improve skip detection for os.getenv and time module - basics: skip exception_chain and self_type_check on unix minimal - serial_test.py: add test for serial throughput - extmod: test websocket too-big packet transmission - cpydiff: document unsupported float format with grouping char - run-tests.py: raise OSError on invalid file open for injected FS - move ports/esp32/resolve_on_connect.py to net_inet - net_inet/resolve_on_connect.py: convert to use unittest - net_inet: skip tests on axTLS when necessary - net_inet/tls_num_errors.py: switch to tls mod and require mbedTLS - net_inet/tls_text_errors.py: add exp file to run on axTLS - net_hosted/ssl_verify_callback.py: skip if no verify_callback - extmod/time_res.py: properly skip functions not in time module - run-tests.py: allow port:<dev> specification in run-multitests.py - micropython: extend MPY import tests for RV32 - run-tests.py: pass auto-detected architecture flags to mpy-cross - ports/qemu: add arch flags MPY import checks test - serial_test.py: allow up to 2 seconds between bytes - extmod/machine_i2s_rate.py: adjust pins when running on ESP32-C3 - import: make import_override and pkg7 tests behave under CPython - import: remove .py.exp files where they match CPython - extmod_hardware/machine_encoder.py: fix initial rotation count - extmod_hardware/machine_encoder.py: use target_wiring for encoder - run-tests.py: add general newline normalization function - multi_espnow: add test case for espnow rate changes - serial_test.py: factor common reset code into send_script func - serial_test.py: add a serial echo test - net_inet: update micropython.org certificate for SSL tests - basics/builtin_help.py: test correct handling of deleted entries tools: - mpremote: fix encoding error in PyboardCommand - codeformat.py: iterate lines instead of modifying list in-place - codeformat.py: print filename + linenumber when dedenting fails - ci: add UBSan to longlong CI build - ci.sh: extend Arm testing to include hardfp targets - mpy-tool.py: allow dumping MPY segments into their own files - ci.sh: skip unreliable thread/thread_gc1.py test in Github CI - add an environment variable MICROPY_MAINTAINER_BUILD - mpremote: don't apply Espressif DTR/RTS quirk to TinyUSB CDC dev - remove unneeded future imports - ci.sh: make this script runnable as command - ci.sh: fix missing `set -e` when run as a script - metrics.py: compute mpy-cross size as part of size metrics - ci.sh: add `--bash-completion` option - mpremote: workaround ESP DTR/RTS reset quirk at disconnect time - ci.sh: enable all possible tests on zephyr CI - ci.sh: enable the full test suite for unix minimal variant - metrics.py: use all CPUs during comparison builds - ci.sh: manipulate pipefail better - ci.sh: add and use new ci_code_size_report function - ci.sh: exit with error if zcat fails during ci_esp8266_setup - metrics.py: when cleaning also clean mpy-cross - ci.sh: let code_size_build be customized via environment - metrics.py: allow pre_cmd to set up environment - ci.sh: return to old branch after code_size_build - ci.sh: re-add IGNORE_ERRORS to ci_code_size_build - ci: fix typo of pipefail - ci.sh: init micropython-lib submodule for zephyr build - ci.sh: cross build 64-bit windows on Linux - metrics.py: tersely show the commits in the size report - ci.sh: use a better default reference ref in code_size_build - autobuild: use same length Git hash abbreviation in file names - mpremote: fix exception when using pts - mpy-tool.py: add architecture flags to disassembly output - cc1: apply ruff formatting to cc1 script - cc1: fix ruff lint check with list length - ci.sh: build ESP32_GENERIC_C5 as part of esp32 CI - mpy-tool.py: add Compiler Explorer JSON output - ci.sh: add zsh and fish shell completion support - ci.sh: install latest ARM toolchain for stm32 CI - ci.sh: build all stm32 MCU families in stm32 CI functions - autobuild: make firmware destination directory configurable CI: - workflows: run webassembly and zephyr workflows if tests/ change - workflows: bump actions/checkout from 4 to 5 - workflows: bump actions/github-script from 7 to 8 - workflows: bump actions/setup-python from 5 to 6 - workflows: bump actions/checkout from 4 to 5 - workflows: retry Windows VC2017 & 2019 install steps - workflows: run esp32&zephyr daily to keep mstr branch caches hot - workflows: add 32-bit OBJ_REPR_B CI job - workflows: use new ci.sh style for calling functions - workflows: switch to macos-26 for unix CI - workflows: free up more disk space on zephyr workflow - workflows: bump actions/checkout from 5 to 6 - workflows: test mpy-cross debug emitter The ports ========= all ports: - remove unneeded future imports - guard calls to machine_*_deinit_all() with #if where appropriate alif port: - machine_rtc: implement RTC.datetime to get and set the RTC - mphalport: implement mp_hal_time_ns - fatfs_port: implement get_fattime - mbedtls: implement the mbedTLS time function - modtime: implement the rest of the time module - mpconfigport: enable cryptolib and hashlib.md5/sha1 - alif.mk: add MPY_CROSS_FLAGS setting - tinyusb_port: fix setting of USB device addr for fast hosts - machine_spi: fix init() to only change requested settings - boards/OPENMV_AE3: fix switch name to match OpenMV RT1062 and N6 - tinyusb_port: update dcd_init function to match TinyUSB v0.18.0 - main: replace mp_stack_set with mp_cstack_init_with_top - tinyusb_port: add missing license header bare-arm port: no changes specific to this component/port cc3200 port: - mpconfigport: use MICROPY_CONFIG_ROM_LEVEL_CORE_FEATURES - mptask: replace mp_stack_set_top with mp_cstack_init_with_top embed port: no changes specific to this component/port esp8266 port: - main: use new cstack API and add a stack margin of 64 bytes - modmachine: support hard IRQ timer callbacks - boards: replace stackctrl.o with cstack.o in obj file list esp32 port: - support building against IDFv5.5 - network_ppp: use thread-safe API for PPPoS input - network_ppp: use non-thread-safe API inside status callback - network_ppp: correctly clean up PPP PCB after close - network_ppp: stop polling if stream becomes None - network_ppp: stop polling if PPP was disconnected - boards: reduce flash usage of ESP32-C6 boards - boards: build ESP32-C2 and C3 with -Os instead of -O2 - boards: enable I2S for ESP32_GENERIC_C6 and other C6 boards - revert "esp32/mpconfigport: Disable I2CTarget on ESP32-C6 to .." - usb: fix building with USB CDC disabled - update esp_tinyusb component to v1.7.6 - add IDF Component Lockfiles to git repo - machine_uart: convert machine.UART objects to static instances - machine_uart: handle properly the timeout_char argument - machine_uart: call uart_wait_tx_done() only with driver installed - machine_timer: warn that hard timers are not implemented - machine_i2c: update to support both v1 and v2 of the IDF driver - machine_i2c: use IDF function for calculating main timeout - update tools/metrics_esp32.py to use JSON output - boards: add new board variant for esp32c2 devices with 2MiB flash - update to use ESP-IDF v5.5.1 - boards: apply additional IRAM savings - modesp32: add esp32.wake_on_gpio() function - boards: add Silicognition ManT1S board definition - esp32_rmt: update RMT module to use the new RMT API - add support for ESP32-C5 SoCs - boards: add ESP32_GENERIC_C5 board definition - fix USB deinit/reinit path via soft reset - take global dependencies out of mpconfigport.h - remove dependency on esp_tinyusb - fix USB Zero Length Packet issue with patched tinyusb - README: update the README details to account for newer chips - modespnow: fix espnow rate setting - add constants and documentation for espnow data rates - support building with network and/or bluetooth disabled - add support for ESP32-P4 - boards/ESP32_GENERIC_P4: add board definition for ESP32P4 - usb_serial_jtag: flush usb_serial_jtag TXFIFO from ISR - mphalport: enable D-cache flushing on P4 for native code - boards/SOLDERED_NULA_MINI: add new board definition - fix board images for ESP32_GENERIC_[C2|C5|P4] - boards/ESP32_GENERIC_P4: add variants to board.json and .md files - don't disable component manager when updating submodules - boards: enable ESP32P4_REV_MIN_0 option for P4 boards - main: update esp_hosted component to latest version 2.7.0 mimxrt port: - restructure nxp_sdk to match official mcux-sdk - boards: re-generate MIMXRT1052 clock config files - mphalport: fix building with USB CDC disabled - main: replace mp_stack_set calls with mp_cstack_init_with_top minimal port: no changes specific to this component/port nrf port: - modules/machine/spi: print SPI baudrate, polarity and phase - main: replace mp_stack_set calls with mp_cstack_init_with_top - drivers/usb: provide macros for nrf errata pic16bit port: no changes specific to this component/port powerpc port: - mpconfigport: remove definitions of _FMT macros - main: replace mp_stack calls wih mp_cstack_init_with_sp_here qemu port: - Makefile: allow overriding floating point mode by boards - arm: add definition for the MPS2_AN500 machine - mcu/arm/errorhandler: add ARMv7-M debug registers - mcu/arm/mps2.ld: add .ARM.exidx section to the linkerscript - riscv64: add new QEMU RV64 port - enable Zba opcodes for the VIRT_RV32 board - mpconfigport: remove definitions of _FMT macros - main: replace mp_stack calls with mp_cstack_init_with_sp_here - uart: implement uart_rx_any function - mcu/arm: implement a SysTick driver - mcu/riscv: implement ticks using the RDTIME control register - mphalport: implement stdin poll and mp-hal ticks functions - mpconfigport: enable time, select and stdio buffer - uart: fix UART0 address for MPS3 - mcu/arm: enable the FPU init for ARMv8-M - boards: add new MPS3_AN547 board definition renesas-ra port: - timer: support soft IRQ timer callbacks - main: replace mp_stack_set with mp_cstack_init_with_top rp2 port: - mphalport: fix building with USB CDC disabled - mpconfigport: enable Zba opcodes in RISC-V mode - machine_timer: use mp_irq_dispatch() to reduce duplication - boards: add missing RP2350 RISC-V variants - pendsv: fix PendSV_Handler dispatch check when threading enabled - fix RP2350 and RP2350B pin alt functions - boards/WEACTSTUDIO_RP2350B_CORE: add board.pinout - main: add guard around machine_i2s_init0() - add HSTX alternate function - rp2_dma: properly close DMA channels - rp2_pio: fix support for pin wrapping and RP2350B upper-bank pins - mpconfigport: enable MD5, SHA1 and cryptolib on all boards samd port: - mphalport: fix building with USB CDC disabled - main: replace mp_stack_set calls with mp_cstack_init_with_top - machine_bitstream: tune ticks for SAMD51 and set pin to output stm32 port: - dac: fix 12-bit DAC issue on STM32H5 - dac: add support for DAC feature on STM32G0 - dac: fix DAC write for MCUs that have D-Cache - Makefile: add .gc.blocks.table section to generated binary - eth_phy: fix typo in header guard macro - enable I2CTarget for STM32L4 - boards/ARDUINO_OPTA: reset ETH PHY on board init - boards/NUCLEO_F401RE: change flash latency for NUCLEO-F401RE - boards/NUCLEO_G474RE: change flash latency for NUCLEO-G474RE - i2c: add hardware I2C implementation for STM32G4 - uart: enable UART FIFO for STM32N6 - uart: fix LPUART init failure with low baudrate - boards: set RCC_HSE_BYPASS for relevant NUCLEO boards - main: use defined constants to enable N6 clocks during low power - make-stmconst.py: fix missing peripheral consts in stm module - powerctrlboot: refactor clock settings for STM32G0 - adc: fix pyb.ADC issue for STM32G0 - machine_adc: fix machine.ADC so it works on STM32G0 - timer: fix Timer(4) issue for STM32G0 - timer: enable RTCAPB_CLK for STM32G0 - rtc: fix RTC.wakeup issue for STM32G0 - adc: get ADC working on STM32N6 MCUs - timer: support soft IRQ timer callbacks - rtc: fix passing invalid argument to RTC callback - boards/OPENMV_N6: define all OpenMV N6 pins - boards: add PG13 AF7 (USART3_RTS) to N6 AF file - boards/OPENMV_N6: define RTS pin for UART3 - usbd_hid_interface: add runtime header - boards/OPENMV_N6: switch to object REPR_C - main: remove unused include of stackctrl.h - boards/OPENMV_N6: fix float implementation - boards: add missing AF options to N6 AF file - flash: change Flash sector size for STM32H7A3 - adc: use macros defined by HAL for H7 - usbd_conf: change USB pin configuration for STM32H7A3 - boards/NUCLEO_H7A3ZI_Q: add NUCLEO_H7A3ZI_Q board support - add STM32U5 support - boards: add NUCLEO-U5A5ZJ-Q board support - machine_uart: implement TX/RX inversion parameter for UART on H7 - usb: add support for using TinyUSB stack - usb: add TinyUSB Mass Storage support - usb: add VBUS sensing configuration for TinyUSB on F4/F7 - eth: add support for Ethernet on N6 MCUs - lwip_inc: include HAL header to get MCU define - lwip_inc: further increase N6 lwIP memory - boards/NUCLEO_N657X0: enable Ethernet - eth_phy: add support for 1000Mbit PHY - eth_phy: add support for RTL8211 ETH PHY - eth_phy: move PHY initialization to a dedicated function - eth_phy: add support for RTL8211 inititialization - eth: add support for gigabit RGMII peripheral interface - eth: make TX and RX buffer sizes a multiple of 8 - eth: move DMA TX/RX index variables to normal RAM - eth: don't pad eth_dma_t struct on H5 and N6 MCUs - eth: implement zero-copy of lwIP pbufs for TX path - network_lan: allow a board to configure the default LAN PHY - boards/OPENMV_N6: enable RGMII Ethernet - mpconfigboard_common: define TinyUSB MCU type for N6 - add support for STM32F469xx MCUs - boards/STM32F469DISC: add new board definition files - boards/STM32F469DISC: add board.json file - boards/WEACTSTUDIO_MINI_STM32H743: add WeAct H743VI board support - usbd_conf: clean up USBD hardware initialization functions - fix init sequence of USB hardware and TinyUSB stack - rtc: make sure RTC is using LSE on N6 MCUs - usbd_conf: fix build for boards with USB disabled - system_stm32: fix clock config for STM32G4 - boards/NUCLEO_G474RE: restore disabled modules on g474re unix port: - increase stack sizes if running with sanitizers - don't crash if heap locked in prompt_write_history - unlock heap before readline - modsocket: use type-checking mp_obj_get_int - Makefile: add additional testing targets - modsocket: set file descriptor to -1 on close - main: ensure atexit function is called with -m <module> - Makefile: run all possible tests when using --via-mpy - variants/minimal: enable C stack checking - Makefile: allow out-of-tree tests - modtime: add type casting for mktime return value - main: use standard pyexec REPL for unix and windows ports - enable compile-only mode with shared pyexec REPL - main: replace execute_from_lexer with pyexec in do_file and do_str - enable exit code handling for sys.exit() - modsocket: add IP ADD and DROP MEMBERSHIP to socket constants webassembly port: - enable C-stack checking - do GC in return path rather than entry path - improve identity and fix bug with lost JsProxy refs - remove MICROPY_PY_BOUND_METHOD_FULL_EQUALITY_CHECK - objjsproxy: fix logic that determines if asyncio is active - asyncio: fix ThenableEvent to handle rejected thenables - objjsproxy: support arbitrary number of args with kwargs windows port: - msvc: make the PP defs for manifest freezing global zephyr port: - upgrade to Zephyr v4.2.0 - CMakeLists.txt: enable sys.implementation._build - machine_timer: support hard IRQ timer callbacks - mpconfigport: enable MICROPY_PY_MATH_POW_FIX_NAN - boards: add PocketBeagle 2 rev A1 A53 support - main: replace mp_stack_set with mp_cstack_init_with_sp_here - remove defaulting to newlib - add boards files for rp2350's m33 on pico 2 - machine_adc: add ADC support - modzsensor: add set/get sensor attributes to zsensor - boards: add PocketBeagle 2 rev A0 m4 support - boards: add PocketBeagle 2 rev A1 m4 support - mount all disks and flash partition, formatting if necessary - add erase block size to FlashArea.areas entries - boards: add XIAO BLE NRF52840 SENSE board - boards: add NXP MIMXRT1020 EVK board - introduce Zephyr native filesystem VFS interface - CMakeLists.txt: fix FS config options being ignored - boards: setup rpi_pico to use Zephyr FS instead of MPY FS - modules: add Zephyr FileSystem support to _boot.py - allow a custom dts - add support for GC split-heap
78ff170
2025-12-09 22:44
下载
v1.26.1
Patch release for ESP32 native USB support This is a patch release containing the following commits: - esp32: update esp_tinyusb component to v1.7.6 - tools: add an environment variable MICROPY_MAINTAINER_BUILD - esp32: add IDF Component Lockfiles to git repo - shared/tinyusb: fix hang from new tx_overwritabe_if_not_connected flag - shared/tinyusb/mp_usbd_cdc: rewrite USB CDC TX loop - tools/mpremote: don't apply Espressif DTR/RTS quirk to TinyUSB CDC dev
647c8b9
2025-09-11 12:21
下载
v1.27.0-preview
7e8705f
2025-08-10 06:42
下载
v1.26.0
I2CTarget, improved floats and native emitter, STM32N6 & ESP32C2 support This release of MicroPython sees the introduction of `machine.I2CTarget`, which allows Python code to implement an I2C target device. It's available on the alif, esp32, mimxrt, rp2, samd, stm32 and zephyr ports. In the simplest case it can create an I2C register/memory device that connects to a bytearray (or similar buffer) and allows an I2C controller to read from and write into that bytearray. For more complex scenarios the `I2CTarget` class exposes a set of interrupts which can be acted upon by Python code, allowing an arbitrary I2C device to be created. See the documentation for more details and examples. Floating point support has been improved in a few ways in this release. First, the formatting (printing) of floats has been rewritten to significantly improve the `repr` reversibility of floating-point numbers. That is, formatting and then re-parsing a float should return the original value. In MicroPython the percentage of floats that correctly repr and parse back was around 28% (single precision) and 38% (double precision), but has now been improved (in the standard build configuration) to 98.5% and 99.8% (single and double respectively). In addition to printing out more accurate floats, that helps a lot when saving floats to .mpy files, because it means they can be loaded back to the same value. Second, there is now support in the compiler for handling floats as constants. Floats can now be folded (along with integers) in arithmetic operations, and be part of `const` assignments. This helps to optimize bytecode because constant float expressions can now be evaluated in the compiler instead of at runtime. The third float improvement involves object representation C, where floats are stored within the immediate object value rather than on the heap. In this object module, the float can only take up 30 bits, so the last two bits of the single precision number are lost. Previously they were just truncated, but now a heuristic is applied when recovering the float value from the object such that the last two bits are copied from the previous two. This alleviates a bias towards zero and in general improves floating point calculations when using this representation. The native and viper emitter backends have been improved to emit more optimal machine code, for example to use more compact instructions in loads and stores. This is for all supported architectures: ARM, Thumb, Xtensa, RISC-V 32, x86 and x64. Thumb v1 (for example RP2040) now supports long jumps greater than 12 bits, allowing larger Python functions to be compiled to this native architecture. Also, the inline Xtensa assembler now implements most of the LX3 opcodes, with additions including addx2, subx2, ssl and ssr, among others. Two new MCUs are supported by this release: STM32N6xx and ESP32-C2 (aka ESP8684). The STM32N6xx is a new STMicroelectronics MCU running at 800MHz with a large amount of RAM and machine-learning accelerators. MicroPython now supports this MCU with USB, XSPI memory-mapped external flash, a filesystem, basic peripherals and deepsleep. The ESP32-C2 is by Espressif and is a small and low cost RISC-V MCU with WiFi and BLE. MicroPython running on this MCU supports a REPL, filesystem, GPIO, I2C, ADC, PWM, timers, WiFi and BLE. The date range supported by the `time` module has now been standardized to work the same across all platforms. The functions `time()`, `localtime()` and `mktime()` now work properly on a reasonable range of dates, from at least 1970 up to 2099, regardless of the Epoch used by the platform. The MicroPython virtual machine is now able to avoid heap-allocating slices when subscripting bytearray and memoryview objects, for example expressions like `bytearray_obj[a:b] = c`. The slice object is now allocated on the C stack, helping to reduce memory churn and allowing such expressions to work when the heap is locked, for example during a hard interrupt handler. This improvement goes in the general direction of MicroPython using the heap as little as possible, making execution more deterministic. Other improvements to the core runtime include support for using `__all__` in star imports, support for PEP487's `__set_name__` special method, support for the _b/o/x specifier in `str.format`, and arrays can now be extended from any iterable, not just from an object with the buffer protocol. A new MicroPython-specific `sys.implementation._thread` attribute has been added, which exists when threading is enabled and tells which threading model is used (GIL or unsafe/no-GIL). The `framebuf` module now supports blit'ing read-only data to a `FrameBuffer`, which helps when implementing custom fonts that can now be stored in ROM. The DTLS implementation in the `tls` module now enables DTLS HelloVerify and Anti Replay protection (for the mbedTLS backend), allowing proper DTLS servers to be implemented. The lwIP socket layer now has a queue of incoming UDP and raw packets (previously it only had room for one outstanding packet), allowing for more robust and efficient UDP protocols. Mpremote has had a few improvements. There is a new `fs tree` command which mimics the Unix `tree` command, and includes the `-s` and `-h` options to show the file sizes in the output. The `df` command has been enhanced to use the new no-argument `vfs.mount()` query, and shows a much better summary of the mounted filesystems. The `mip install` command now uses hashes to skip files that exist. The location of the user `config.py` file is now more portable across many different OSes and configuration styles, thanks to the use of the `platformdirs` helper package. There is also support for targets without the `errno` module, improved disconnect handling, and better ESP-device detection for USB-CDC ports. The `mpy_ld.py` linker can now resolve fixed-address symbols if requested, for example on ESP8266 it can link to ROM-provided functions. There is also now support for ABS32 text relocations on ARMv6M (RP2040). These improvements extend the set of C extensions that can be compiled for such targets. Libraries that have been updated in this release include: lwIP updated to STABLE-2_2_1_RELEASE, LittleFS updated to v2.11, libhydrogen updated to the latest release, and stm32lib updated to include support for STM32N6. There have been many improvements to the test suite, to both the tests and the test runners. This is in part to aid the new Octoprobe test framework, which provides hardware-in-the-loop testing. The continuous integration testing now also includes an undefined behaviour sanitizer (UBSan) build, an address sanitizer (ASan) build, a long-long unix variant, and also testing of object representation C. MicroPython has a lot of tests! The alif port now supports pin interrupts, has improved SPI transfers, and I2C configuration now allows changing the SCL and SDA pins. The esp32 port is updated to use ESP-IDF v5.4.2, and now supports ESP32-C2. Most ESP32-based boards now auto-detect the size of their flash on boot and automatically create an appropriate vfs partition based on the size of the flash. This allows the same firmware image to work on boards with various flash sizes. This port has also added a new `esp32.PCNT` class along with `machine.Counter` and `machine.Encoder`, which can count input edges, including motor rotation. The PWM class has been improved, and its API now matches other ports. There is support for the LAN8670 PHY, and a new `esp32.idf_task_info()` function (useful with the new `utop` package in micropython-lib). The `UART.sendbreak()` method has been rewritten so that it doesn't reconfigure the UART during its execution. The nrf port has had fixes and improvements to its UART REPL to make it more robust, and work with mpremote. It also now uses the correct iRAM address for native code execution on nRF52 MCUs. The nrf implementation of `machine.enable_irq()` and `machine.disable_irq()` has been reworked so it uses the code common with all other ports, and this is a breaking change (on nrf boards only) due to the signature change of `enable_irq()`. Previously the signature was `enable_irq()`, and now the signature matches other ports, and the docs, and is `enable_irq(state)`, where `state` is the return value from `disable_irq()`. The rp2 port now enables compressed error messages by default, which reduces firmware size by about 3000 bytes. The pico-sdk alarm pool is now used (again, instead of custom soft-time code) for power-saving delays, and lightsleep has been improved. Open drain mode has been fixed on RP2350 with more than 32 GPIOs, and support for hard IRQ timer callbacks has been added. The webassembly port has seen improvements to its FFI interface with JavaScript: it improves "has" and "get" proxying, fixes binding of self to JavaScript methods, implements equality for `JsProxy` objects, and reuses `JsProxy` references when possible to improve equality relationships of JavaScript objects on the Python side. The zephyr port has been updated to use Zephyr v4.0.0, and many improvements have been made: PWM support has been added, UARTs are now interrupt driven with ring-buffers and can set the baudrate and other parameters, GPIO supports open-drain mode, SoftI2C and SoftSPI have been enabled, and the `zephyr.FlashArea` class now contains constants which enumerate the available partitions. REPL reliability has also been improved and it now supports ctrl-C in the default configuration. BLE can now create services at runtime using the standard `BLE.register_services()` method. Other small things have been added to make the zephyr port match the behaviour of other bare-metal ports, including: `boot.py` and `main.py` are now executed at start-up, `/lib` is added to `sys.path` as appropriate, stdin/out/err have been enabled in the `sys` module, along with the ability to import .mpy files, and await/async keywords are enabled. This port now uses the standardized ROM configuration levels, with the default being the "basic" level. New boards added in this release are: GARATRONIC_PYBSTICK26_ESP32C3 and SPARKFUN_IOT_REDBOARD_ESP32 (esp32 port), SPARKFUN_REDBOARD_TURBO and SPARKFUN_SAMD21_DEV_BREAKOUT (samd port), NUCLEO_N657X0 and OPENMV_N6 (stm32 port), beagleplay_cc1352p7, nrf5340dk, nrf9151dk and rpi_pico (zephyr port). The change in code size since the previous release for select builds of various ports is (absolute and percentage change in the text section): bare-arm: -96 -0.168% minimal x86: -207 -0.112% unix x64: -376 -0.045% stm32: +3776 +0.966% cc3200: +392 +0.212% esp8266: +3484 +0.498% esp32: +19064 +1.122% mimxrt: +3600 +0.970% renesas-ra: +1296 +0.207% nrf: +1140 +0.607% rp2: +556 +0.245% (RPI_PICO board) rp2: +2252 +0.245% (RPI_PICO_W board) samd: +3296 +1.233% The leading causes of these changes in code size are: - bare-arm, minimal: various code size improvements including optimized integer var-arg handling - unix: remove static PATH variable (bss size reduction), implement DTLS HelloVerify and Anti Replay protection (size increase) - stm32: implement `machine.I2CTarget`, improve accuracy of float formatting and range of time functions, improve native emitter and inline assembler, update LittleFS to v2.11. - cc3200: enable `io.IOBase` at core feature level, avoid heap-allocating slices when subscripting built-ins. - esp8266: add more LX3 opcodes to the inline assembler, update LittleFS to v2.11, native emitter improvements, add float constant folding. - esp32: update to IDF 5.4.2 (+10k), implement `machine.I2CTarget`. - mimxrt: implement `machine.I2CTarget`, improve accuracy of float formatting, improve native emitter, add float constant folding, update LittleFS to v2.11. - renesas-ra: improve accuracy of float formatting, native emitter improvements, add float constant folding. - nrf: improve accuracy of float formatting, enable `io.IOBase`, standardize the range of time functions. - rp2 (RPI_PICO): enable compressed error messages (-3k), implement `machine.I2CTarget`, improve accuracy of float formatting. - rp2 (RPI_PICO_W): enable compressed error messages (-3k), implement `machine.I2CTarget`, implement DTLS HelloVerify and Anti Replay. - samd: implement `machine.I2CTarget`, improve accuracy of float formatting, improve native emitter, float constant folding. Thanks to everyone who contributed to this release: Alessandro Gatti, Andrea Giammarchi, Andrew Leech, Angus Gratton, Anson Mansfield, Anton Blanchard, Ayush Singh, Chris Webb, Christian Lang, Damien George, Daniel Campora, Daniël van de Giessen, David Schneider, David Yang, Detlev Zundel, Dryw Wade, dubiousjim, Elvis Pfutzenreuter, ennyKey, Garatronic, Herwin Grobben, iabdalkader, IhorNehrutsa, Jeff Epler, Jim Mussared, Jonathan Hogg, Jos Verlinde, Koudai Aono, Malcolm McKellips, Matt Trentini, Maureen Helm, Meir Armon, Patrick Joy, Peter Harper, Phil Howard, purewack, Rick Sorensen, robert-hh, root, SiZiOUS, stijn, TianShuang Ke, Vdragon, Yanfeng Liu, Yoctopuce dev, Yuuki NAGAO. MicroPython is a global Open Source project, and contributions were made from the following timezones: -0600, -0500, -0400, -0300, +0000, +0100, +0200, +0300, +0530, +0800, +0900, +1000, +1100. The work done in this release was funded in part through GitHub Sponsors, and in part by George Robotics, Espressif, Arduino, OpenMV, Yoctopuce, Microbric and Planet Innovation. What follows is a detailed list of changes, generated from the git commit history, and organized into sections. Main components =============== all: - rename the "NORETURN" macro to "MP_NORETURN" - bump Ruff version to v0.11.6 - go back to using default ruff quote style py core: - objrange: match CPython range slicing - objstr: fix handling of OP_MODULO with namedtuple - dynruntime.mk: fix use of musl's libm.a when LINK_RUNTIME=1 - mkrules.cmake: add CMake support for compressed error messages - make struct-initializing macros compatible with C++ - malloc: add mutex for tracked allocations - modthread: initialize thread state nlr_top to NULL - makeversionhdr.py: change utcfromtimestamp() to fromtimestamp() - mpconfig: enable io.IOBase at core feature level - emitinlinethumb: refactor string literal as array initializer - objstr: add support for the :_b/o/x specifier in str.format - emitnative: improve Viper register-indexed code for Arm - emitnative: improve Viper register-indexed code for Thumb - emitnative: refactor Viper register-indexed load/stores - asm: remove unused generic ASM API opcode definitions - asmthumb: generate proper sequences for large register offsets - emitnative: clean up int-indexed Viper load/store code - persistentcode: allow a port a custom commit function and track data - asmxtensa: replace printf messages with exceptions - asmxtensa: make the generated code dumper work on mpy-cross - emitinlinextensa: add the rest of LX3 opcodes to the assembler - asmxtensa: emit prologue jump only when constants table is in use - scheduler: only run scheduler callbacks queued before run started - emitnative: let Viper int-indexed code use appropriate operands - asmthumb: extend load/store generators with ARMv7-M opcodes - asmxtensa: extend existing specialised load/store operations range - emitnative: remove redundant RV32 Viper int-indexed code - asmarm: extend int-indexed 32-bit load/store offset ranges - asmarm: give a proper name to the temporary register - asmxtensa: extend BCCZ range to 18 bits - asmxtensa: extend BCC range to 18 bits - asmthumb: implement long jumps on Thumb/armv6m architecture - dynruntime.mk: enable single-precision float by default on armv6/7m - parsenum: reduce code size in check for inf/nan - parsenum: further reduce code size in check for inf/nan - objarray: allow extending array with any iterable - parsenum: fix parsing complex literals with negative real part - objfloat: change MSVC workaround for NAN being a constant - mpz: avoid undefined behavior decrementing NULL - objlist: reduce code size in slice operations - mpprint: remove unused "PF_FLAG_NO_TRAILZ" flag - asmbase: fix assertion error with viper code - fix undefined left shift operations - modio: fix the case where write fails in BufferedWriter.flush - repl: skip private variables when printing tab completion options - runtime: add support for using __all__ in star import - obj: fix nan handling in object REPR_C and REPR_D - misc: fix fallback implementation of mp_popcount - misc: introduce macros to check values' bits size - asmrv32: implement the full set of Viper load/store operations - asmarm: implement the full set of Viper load/store operations - asmxtensa: implement the full set of Viper load/store operations - asmthumb: remove redundant load/store opcode implementations - asmx86: implement the full set of Viper load/store operations - asmx64: implement the full set of Viper load/store operations - asmthumb: clean up integer-indexed load/store emitters - emitnative: let emitters know the compiled entity's name - runtime: initialize profile fields in mp_thread_init_state - profile: fix printing lineno in frame objects - bc: factor out helper for line-number decoding - showbc: use line-number decoding helper - objcode: implement co_lines method - obj: add functions to retrieve large integers from mp_obj_t - vm: avoid heap-allocating slices when subscripting built-ins - mpprint: rework integer vararg handling - objint_longlong: add arithmetic overflow checks - smallint: update mp_small_int_mul_overflow() to perform the multiply - parsenum: extend mp_parse_num_integer() to parse long long - objcode: remove co_lnotab from v2 preview - mkrules.mk: mute blobless errors - modsys: add sys.implementation._thread attribute - obj: fix REPR_C bias toward zero - obj: add new type flag to indicate subscr accepts slice-on-stack - objint_longlong: fix left shift of negative values - mpconfig: define new HEX_FMT formatting macro - cast type names to qstr explicitly - fix mp_printf integer size mismatches - objcell: fix printing of cell ID/pointer - mpprint: fix printing pointers with upper bit set - objint_mpz: fix pow3 where third argument is zero - objint_longlong: fix overflow check in mp_obj_int_get_checked - objint_longlong: fix longlong interoperability with floats - objtype: add support for PEP487 __set_name__ - mphal: add stddef.h header for size_t - objboundmeth: add option to use mp_is_equal instead of == comparison - parsenum: refactor float parsing code - formatfloat: improve accuracy of float formatting code - parse: add support for math module constants and float folding - asmthumb: don't corrupt base register in large offset store - parse: fix missing nlr_pop call in complex path of binary_op_maybe extmod: - machine_usb_device: add exception text wrappers - modbluetooth: use newer mp_map_slot_is_filled function - asyncio: fix early exit of asyncio scheduler - create common cyw43 driver config header - cyw43: move the LWIP responder fix into common CYW43 config - moductypes: refactor string literal as array initializer - modlwip: implement a queue of incoming UDP/raw packets - vfs_lfsx: fix errno value raised from chdir - modjson: detect unterminated composite entities - network_cyw43: disconnect STA if making inactive - modlwip: add optional flags argument for recv and recvfrom - modbluetooth: add timeout to deinit - modframebuf: add support for blit'ing read-only data - modnetwork: consolidate definition of common drivers - modre: use specific error message if regex is too complex - machine_pulse: optimise time_pulse_us for code size - modlwip: fix crash when calling recv on listening socket - network_lwip: add sys_untimeout_all_with_arg helper function - mbedtls: implement DTLS HelloVerify cookie support - mbedtls: implement recommended DTLS features, make optional - mbedtls: undefine ARRAY_SIZE if defined by platform - vfs_lfsx: allow overriding the LFS2 on-disk version format - vfs_posix: add additional readonly checks - vfs_posix: add MICROPY_VFS_POSIX_WRITABLE option - modlwip: print timeout with correct format string - modtls_mbedtls: do gc_collect and retry ssl_init on any error - machine_i2c_target: add new machine.I2CTarget class shared: - tinyusb: use device event hook to schedule USB task - timeutils: standardize supported date range on all platforms - netutils: cast the ticks value before printing drivers: - ninaw10/machine_pin_nina: add exception text wrappers - esp-hosted: rename Bluetooth HCI backend driver - ninaw10: rename Bluetooth HCI backend driver - cyw43: remove old BTHCI UART backend - esp-hosted: replace EVENT_POLL_HOOK with mp_event_wait_ms - support special QSPI direct-read protocol mpy-cross: - main: exit with error if arch not specified with emit=native - main: document emit=host option in help lib: - lwip: update lwIP to STABLE-2_2_1_RELEASE - littlefs: update LittleFS to v2.10.2 - littlefs: reuse existing CRC32 function to save space - littlefs: fix string initializer in lfs1.c - littlefs: update LittleFS to v2.11 - libhydrogen: update to latest release - berkeley-db-1.xx: update submodule to latest - libm_dbl: support FLT_EVAL_METHOD == 16 - stm32lib: update library for N6 v1.1.0 - pico-sdk: fix Pico SDK fetching develop picotool - micropython-lib: update submodule to latest Support components ================== docs: - zephyr: add quick reference for PWM support - zephyr: add zephyr FlashArea IDs docs - fix SparkFun capitalization - esp32: improve PWM documentation and examples - esp32/quickref: add PWM lightsleep example - reference/mpremote: document the 'fs tree' command - library/time: amend the documentation of time.mktime() - esp32/quickref: mention the different timer counts - esp32: mention the use of Timer(0) by UART.IRQ_RXIDLE - add a description of recv/recvfrom flags argument - rp2: document the new rp2 Timer hard= option - develop/natmod: add notes on Picolibc and natmods - reference/speed_python: document schedule/GIL limitation of native - document PEP487 __set_name__ implementation - library/bluetooth: document all allowed args to UUID constructor - library/rp2.StateMachine: add a note about PIO in and jmp pins - library/btree: fix method links to explicitly specify class - library: document the new machine.I2CTarget class - esp32: add documentation for esp32.PCNT - library/machine: add docs for Counter and Encoder - reference/mpremote: document location of config file examples: - natmod/random: fix build for Xtensa - natmod/framebuf: fix build for Xtensa - natmod/deflate: fix build for Xtensa - natmod/btree: fix build for Xtensa - rp2/pio_uart_rx.py: fix use of PIO constants - natmod/btree: fix build on RV32 with Picolibc - natmod: use LINK_RUNTIME=1 when building for armv6m - usercmodule: cast arguments for printf - bluetooth/ble_advertising.py: fix decoding UUIDs tests: - basics/builtin_range.py: add more tests for range slicing - extmod: skip binascii tests when hexlify/unhexlify don't exist - extmod/vfs_lfs_ilistdir_del.py: skip test if not enough memory - extmod/vfs_mountinfo.py: don't import unused errno module - extmod/vfs_posix.py: fix test on Android - net_hosted: only run network loopback test on supported targets - ports/rp2: convert rp2.DMA test to a unittest - ports/rp2: tune rp2.DMA test so it runs in all configurations - extmod: rename ssl tests that only use the tls module - net_inet: update micropython.org certificate for SSL tests - extmod/vfs_rom.py: clear sys.path before running test - multi_net: add test that requires queuing UDP packets - ports/rp2: update machine idle test to revert skip for RP2350 - ports/rp2: add a test case for light sleeping from CPU1 - cpydiff: document format separator difference - extmod/vfs_lfs_error.py: test value of all OSError's errno - cpydiff: explain the numeric literal parsing difference - cpydiff: document that uPy requires space after number+period - cpydiff: add test of underscore-in-literals - cpydiff: ensure all have two levels of category - run-tests.py: add list of passed/skipped tests to _result.json - micropython/viper_ptr: add tests for arch edge cases - float/math_constants.py: test actual e and pi constant values - run-tests.py: change _results.json to have a combined result list - multi_net: add test coverage for socket recv flag MSG_PEEK - multi_net: add test coverage for socket recv flag MSG_DONTWAIT - run-natmodtests.py: allow injected code customisation - run-tests.py: automatically skip tests that are too large - run-tests.py: remove filename arg from prepare_script_for_target - run-tests.py: unconditionally enable native tests if asked - extmod/random_extra_float.py: skip when funcs not available - run-tests.py: factor out helper function to create test report - run-multitests.py: create a _result.json at end of run - run-natmodtests.py: create a _result.json at end of run - run-perfbench.py: create a _result.json at end of run - run-natmodtests.py: consider a test skipped if mpy doesn't exist - ports/rp2: add tests for rp2-specific timer options - cpydiff: document complex() parsing difference - extmod: add platform_basic.py for basic coverage test of platform - run-tests.py: add support for ctrl keys in REPL tests - cmdline: add a test for REPL paste mode - micropython: improve viper ptr boundary tests - run-tests.py: allow injected code customisation - misc: improve test coverage of py/profile.c - extmod/machine_uart_tx.py: support STM32WB boards - extmod_hardware: add UART config for STM32WB boards - extmod_hardware/machine_uart_irq_rxidle.py: ignore inital IRQ - extmod_hardware/machine_uart_irq_rxidle.py: test multiple writes - ports/stm32: tweak tests to run on a wider set of boards - extmod/select_poll_eintr.py: skip test if target can't bind - basics/fun_code_full: test code objects with full feature set - basics/fun_code_colines: test decoded co_lines values - extmod/asyncio_iterator_event.py: use format instead of f-string - micropython: add missing SystemExit after printing SKIP - run-tests.py: consider tests ending in _async.py as async tests - extmod: close UDP sockets at end of test - add specific tests for "long long" 64-bit bigints - extmod/json_loads_int_64.py: add test cases for LONGINT parse - thread: rename thread_lock4 test to thread_lock4_intbig - skip bm_pidigits perf test if no arbitrary precision int support - basics/fun_code_lnotab: test removal of co_lnotab from v2 - extmod/select_poll_eintr.py: pre-allocate global variables - thread/stress_aes.py: reduce test time on PC targets - run-tests.py: detect threading and automatically run thread tests - thread: allow thread tests to pass with the native emitter - net_inet: update micropython.org certificate for SSL tests - run-tests.py: use TEST_TIMEOUT as timeout for bare-metal tests - extmod_hardware/machine_uart_irq_break.py: remove send_uart - multi_bluetooth: synchronise MTU exchange in BLE MTU tests - multi_net: update DTLS multi-net test - extmod: add (failing) test for VfsPosix in readonly mode - micropython: rename viper boundary tests that depend on big int - basics: add tests for PEP487 __set_name__ - internal_bench/class_create: benchmark class creation - internal_bench/var: benchmark descriptor access - run-internalbench.py: allow running internalbench on hardware - run-natmodtests.py: automatically skip tests that are too large - multi_bluetooth: extend the deep sleep test timeout - run-multitests.py: escape encoding errors instead of crashing - cpydiff: remove passing types_float_rounding test - micropython: test that viper offset stores don't clobber base reg - extmod_hardware: add self unittest for I2CTarget - multi_extmod: add I2CTarget multi tests - extmod_hardware: add basic tests for machine.Counter and Encoder tools: - mpremote: use zlib.compressobj instead of zlib.compress - mpremote/tests: add tests for errno behavior - mpremote: refactor error handling to apply generally to any errno - mpremote: fix possibly-missing EOPNOTSUPP errno name - mpremote/tests: add test for rm -r on /remote vfs - mpremote: prevent deletion of /remote files via rm -r - ci.sh: update URL for xtensa-lx106-elf-standalone.tar.gz - mpremote: for mip install, use hash to skip files that exist - verifygitlog.py: apply stricter rules on git subject line - verifygitlog.py: disallow a leading slash in commit subject line - verifygitlog.py: allow long co-author and sign-off names - gen-cpydiff.py: improve stdout vs stderr interleaving - gen-cpydiff.py: fix RST heading generation - gen-cpydiff.py: ensure every item has at least 2 TOC levels - mpremote: add new 'fs tree' command - mpremote/tests: add tests for 'fs tree' command - pyboard.py: avoid initial blocking read in read_until() - pyboard.py: introduce timeout_overall for read_until() - pyboard.py: add write_timeout and catch errors in enter_raw_repl - mpy_ld.py: resolve fixed-address symbols if requested - ci.sh: remove natmod build restrictions for Xtensa - ci.sh: clean the correct MPY files when batch compiling - ci.sh: allow errors in code-size build to fail the CI - boardgen.py: ensure board pin locals_dict has consistent order - ci.sh: fix nanbox CI test runs - mpy_ld.py: support R_ARM_ABS32 relocation in text - mpremote: improve df command to use new no-arg vfs.mount() query - ci.sh: add functions for sanitizer builds - autobuild: build alif boards as part of auto-build - ci.sh: disable "stack use after return" in ASan build - mpremote: fix disconnect handling on Windows and Linux - ci.sh: increase test timeout to 60s in coverage jobs - mpremote: support OSError's on targets without errno - ci.sh: always call `apt-get update` before `apt-get install` - pyboard.py: align execpty prefix - ci.sh: increase timeout for unix qemu test runs - ci.sh: increase timeout for stackless clang test runs - ci.sh: skip thread/stress_heap.py test on macOS test run - ci.sh: skip thread/stress_recurse.py on unix qemu test runs - ci.sh: change averaging to 1 for run-perfbench.py test - pyboard.py: add timeout argument to Pyboard.exec_/exec - ci.sh: test building all natmod examples with all ARM-M archs - mpremote: fix errno.ENOTBLK attribute error on Windows - mpremote: update ESPxxx detection for USB-CDC ports - mpremote: add platformdirs dependency to requirements.txt - mpremote: locate config.py location across different host OSes CI: - workflows: split QEMU/Arm builds into separate entries - workflows: use windows-latest runner for all Windows CI jobs - workflows: add sanitize_undefined workflow to unix port CI - workflows: run the address sanitizer (ASan) build during CI - workflows: remove the unix "settrace" CI job - workflows: use Python 3.11 for unix coverage testing - workflows: add new CI job to test unix port with GIL enabled - workflows: build unix port for docs and run workflow more often - workflows: add a CI job to build ESP32-C2 and ESP32-C6 boards The ports ========= all ports: - fix SparkFun capitalization - update board.json files for vendor/product consistency - eliminate define of {U,}INT_FMT where redundant - define new HEX_FMT formatting macro alif port: - create common cyw43 driver config header - Makefile: create firmware.zip with files needed for deploying - boards/ALIF_ENSEMBLE: add board.json and deploy instructions - README: update README with build instructions - Makefile: allow specifying a custom build directory - machine_pin: add support for machine.Pin IRQ - machine_spi: improve transfer function to poll events - lwip_inc: refactor lwipopts.h to use extmod's common options - machine_i2c_target: implement I2CTarget class - machine_i2c: allow changing I2C SCL/SDA pins bare-arm port: no changes specific to this component/port cc3200 port: no changes specific to this component/port embed port: - port: fix alloca include for Windows platforms esp8266 port: - main: print error information on crash-induced reboots - modmachine: use common machine_time_pulse_us implementation esp32 port: - enable compressed error messages by default - esp32_common.cmake: skip BTree module when requested - tools: update metrics_esp32 script for ESP-IDF >=v5.4.x - esp32_common.cmake: use the tinyusb source files from ESP-IDF - machine_timer: fix timer.value() for an uninitialized timer - esp32_common.cmake: allow adding defines and compiler flags - main: make the entry point function name configurable - machine_uart: correctly manage UART queue and event task - network_common: raise a memory error on ESP_ERR_NO_MEM - network_ppp: restructure to match extmod/network_ppp_lwip - machine_pwm: improve PWM and make its API match other ports - mpconfigport: document how to get more debug info - mpthreadport: fix double delete of tasks on soft reset - update to use ESP-IDF v5.4.1 - network_lan: add support for LAN8670 PHY - modesp32: implement esp32.idf_task_info() - machine_i2c: fix default I2C pins for C3, S3 - network_lan: add PHY_GENERIC device type - boards/SPARKFUN_IOT_REDBOARD_ESP32: add SparkFun board - modsocket: add optional flags argument for recv and recvfrom - machine_timer: do not free interrupt from ISR - re-use allocated timer interrupts and simplify UART timer code - update ADC driver update to the new esp_adc API - main: auto detect the size of flash and auto create vfs partition - boards: convert all boards to auto detect flash size - README: update README to describe auto filesystem sizing - modesp32: make wake_on_ulp available only on SoCs that support it - modesp32: make wake_on_touch available only on SoCs supporting it - modesp32: make wake_on_ext0 available only on SoCs supporting it - modesp32: make wake_on_ext1 available only on SoCs supporting it - modesp32: fix access to ext0_pin only if defined - boards/GARATRONIC_PYBSTICK26_ESP32C3: add pybstick26-esp32c3 defn - panichandler: support building against IDFv5.4.2 - machine_uart: improve sendbreak so it doesn't reconfig the UART - update to use ESP-IDF v5.4.2 - add support for ESP32-C2 (aka ESP8684) - add "Free RAM" optimisation config flags - fix first line ESP32-C2 serial output after reset or deepsleep - machine_i2c: factor default pin macros to header file - machine_i2c_target: implement I2CTarget class - modesp32: add esp32.PCNT class - modules/machine.py: add Counter and Encoder classes - mpconfigport: disable I2CTarget on ESP32-C6 to reduce code size - machine_timer: enable timer clock source for ESP32C6 - machine_timer: fix machine.Timer() tick frequency on ESP32C2,C6 mimxrt port: - machine_uart: enable CTS SION so it can be read - cyw43_configport: update cyw43 config to use new BTHCI UART - create common cyw43 driver config header - machine_i2c_target: support I2C target mode minimal port: no changes specific to this component/port nrf port: - use correct IRAM address for native code execution on nRF52 - only process interrupt chars on UARTs used for REPL - fix UART write on parts that can't write more than 255 bytes - boards: use 64 byte raw-paste buffer on PCA10028 and PCA10040 - use common implementation of machine disable/enable IRQ - revert "nrf/Makefile: Enable LTO by default only on newer gcc." - drivers/bluetooth: change soft-device download URL to self hosted pic16bit port: no changes specific to this component/port powerpc port: no changes specific to this component/port qemu port: - Makefile: allow passing flags to test_natmod via RUN_TESTS_EXTRA renesas-ra port: - replace MICROPY_EVENT_POLL_HOOK with mp_event_wait - mpconfigport: enable MICROPY_TIME_SUPPORT_Y1969_AND_BEFORE rp2 port: - add exception text wrappers - enable compressed error messages by default - create common cyw43 driver config header - move the LWIP responder fix into common CYW43 config - Makefile: add deploy target that uses picotool load - rp2_dma: fix default value used in pack_ctrl on RP2350 - add temporary workaround for GCC 15.1 build failure - use pico-sdk alarm pool instead of soft timer for sleep - modmachine: add debug code for mp_machine_lightsleep - modmachine: add mutual exclusion for machine.lightsleep() - disable the LWIP tick timer when not needed - machine_pin: replace macros with Pico SDK functions - machine_pin: fix simulated open drain with more than 32 GPIOs - boards/SPARKFUN_XRP_CONTROLLER_BETA: fix default I2C to use I2C1 - make FLASH LENGTH match PICO_FLASH_SIZE_BYTES in .ld files - machine_timer: support hard IRQ timer callbacks - rp2_flash: add MICROPY_HW_FLASH_MAX_FREQ to replace fixed max freq - rp2_flash: add default MICROPY_HW_FLASH_MAX_FREQ - CMakeLists.txt: make board's pins.csv configurable - CMakeLists.txt: make linker script configurable - mpnetworkport: deregister all sys timeouts when netif is removed - modmachine: do not use deprecated XOSC_MHZ and XOSC_KHZ - rp2_pio: configure jmp_pin for PIO use if it's isolation is set - CMakeLists.txt: fix flash size check logic - rp2_pio: fix use of PIO2 in prog data structure - machine_i2c: factor default pin macros to header file - machine_i2c_target: implement I2CTarget class - rp2_flash: add binary info for ROMFS samd port: - boards/SAMD_GENERIC_Dxxx: add Microchip URL to board.json - machine_i2c: add the timeout keyword argument to the constructor - modtime: change time.time_ns() to follow the RTC time - boards/SAMD_GENERIC_D51xxx: fix VFS settings for internal flash - samd_spiflash: improve the flash type detection - samd_qspiflash: remove the attempt to handle a unknown device - boards: add two SparkFun SAMD21 boards - boards: change the SparkFun vendor name to SparkFun - machine_i2c_target: support I2C target mode stm32 port: - main: replace mp_stack_set calls with new mp_cstack_init_with_top - cyw43_configport: update cyw43 config to use new BTHCI UART - create common cyw43 driver config header - allow QSPI to work on STM32G4 - machine_adc: enable ADC re-read errata handling for STM32WB55 - boards/ARDUINO_PORTENTA_H7: free reserved timer - main: add support for additional GC blocks - boards/ARDUINO_GIGA: define additional GC blocks in SDRAM - uart: enable UART FIFO for H7 MCUs - adc: apply re-read errata for WB55 - adc: simplify ADC calibration settings - adc: fix core temperature reading on WB55 - machine_adc: fix internal ADC channel reading on WB MCUs - uart: suppress additional RX idle IRQs on F4/L1 - irq: change SPI IRQ priority to be higher than DMA IRQ - dma: extend STM32H5 DMA use to SPI3 and SPI4 - machine_adc: add machine.ADC implementation for STM32L1 - boards/make-pins.py: support up to GPIO-O - add support for STM32N6xx MCUs - main: disable D-cache when debugging N6 - lwip_inc: increase lwIP memory on N6 - boards: add board support files for N6 - mboot: add support for STM32N6xx MCUs - spi: fail spi_init if pins can't be configured - boards/OPENMV_N6: add new board definition files - boards/NUCLEO_N657X0: add new board definition files - stm32.mk: error out if compiling for cortex-m55 on old gcc - add casts when printing small integers - i2c: move I2C IRQ handlers from stm32_it.c to i2c.c - i2cslave: change irq handler name to i2c_slave_irq_handler - i2cslave: add functions to read/write I2C data - i2cslave: support i2c_slave_process_tx_end callback on F4 - i2cslave: account for slow addr_match callback - machine_i2c_target: implement I2CTarget class unix port: - variants: enable os.uname() in coverage build for tests - main: remove PATH_MAX from realpath - mpthreadport: work around lack of thread cancellation on Android - coveragecpp: verify struct-initializing macros' C++-compatibility - modsocket: expose MSG_PEEK flag for recv & recvfrom - coverage: add coverage test for mp_sched_schedule_node - coverage: add coverage test for left adjusted print - README: add some small documentation about sanitizers - variants/coverage: enable sys.settrace - coverage: initialize more code_state fields - coverage: add missing MP_OBJ_FROM_PTR casts - Makefile: drop include path of "i686-linux-gnu" - coverage: expand mp_printf coverage tests - variants: add a 'longlong' variant to test 64-bit bigints in CI - allow the GIL to be enabled - variants/longlong: use REPR_C on this variant - mpconfigport: include time.h to get definition of time_t - mpthreadport: ensure consistent type of PTHREAD_STACK_MIN - coverage: avoid type checking an invalid string - coverage: cast type names to qstr explicitly - coverage: cast values to fit %x formatting code - coverage: cast values to int for format printing - coverage: provide argmuents of expected integer types - coverage: remove unused printf arguments webassembly port: - objpyproxy: avoid throwing on symbol or iterator has-check - objpyproxy: avoid throwing on implicit symbols access - proxy_c: provide constants for fixed JsProxy refs - objjsproxy: fix binding of self to JavaScript methods - objjsproxy: implement equality for JsProxy objects - proxy_js: reuse JsProxy ref if object matches windows port: no changes specific to this component/port zephyr port: - fix prj.conf for v4.1-rc1 - fix call to thread_analyzer_print for v4.0 - remove reference to CONFIG_MMC_VOLUME_NAME for v4.0 - upgrade to Zephyr v4.0.0 - machine_pwm: implement PWM support - boards: enable PWM on beagleconnect_freedom - create options to enable frozen modules - boards: add nrf5340dk board configuration - boards: add nrf9151dk board configuration - create ability to use device_next with CDC ACM as REPL - introduce auto-listing of FlashArea Partitions - boards: enable ADC on beagleconnect_freedom - modbluetooth_zephyr: allow BLE to create services at runtime - mpconfigport: fix mp_int_t and mp_uint_t to work on 64-bit archs - boards: add support for BeaglePlay CC1352p7 - boards/beagleconnect_freedom: enable networking - boards/beagleconnect_freedom: remove board overlay - machine_uart: complete UART driver and make it interrupt driven - machine_pin: configure OUT pin also as input so it's readable - boards: disable WDT on qemu boards and networking for cortex_m3 - README: update URL describing QEMU network settings - prj.conf: use UART for console as default, not CONSOLE_SUBSYS - update generated header path - main: execute boot.py and main.py like other ports - main: add /flash/lib or /sd/lib to sys.path on start up - enable sys.stdin/out/err - src: increase UART input buffer to 512 bytes and reduce latency - src: fix USB device_next driver to work with zephyr 4.0.0 - machine_pin: add Pin.OPEN_DRAIN constant - machine_pin: allow constructing a Pin with an existing Pin - mphalport: implement C-level pin HAL - mpconfigport: enable machine.SoftI2C and machine.SoftSPI - mpconfigport: enable import of mpy and a few related features - mpconfigport: enable MICROPY_NLR_THUMB_USE_LONG_JUMP - boards/frdm_k64f: improve board configuration - boards/nucleo_wb55rg: enable BLE, I2C, SPI and add filesystem - boards/rpi_pico: add board configuration for rpi_pico - mpconfigport: enable sys.maxsize - mpconfigport: enable emergency exception buffer - machine_timer: make machine.Timer id argument optional - machine_pin: retry configuring gpio with just GPIO_OUTPUT - mpconfigport_minimal: use MICROPY_CONFIG_ROM_LEVEL_MINIMUM - mpconfigport: use MICROPY_CONFIG_ROM_LEVEL_BASIC_FEATURES - machine_i2c_target: implement I2CTarget class
4ce2dd2
2025-08-09 21:31
下载
v1.26.0-preview
28901b2
2025-04-21 15:07
下载
v1.25.0
ROMFS, alif port, RISCV inline assembler, DTLS, mpremote recursive remove After more than three years in development, the "ROMFS" feature has been finalised, its filesystem format specified, and the VFS driver and supporting code are included in this release of MicroPython. This feature builds on bytecode version 6 (available for many years now), which supports executing bytecode in-place, that is, without the need to copy it to RAM. ROMFS defines a read-only, memory-mappable, extensible filesystem that can contain arbitrary resources, including precompiled mpy files, and allows executing bytecode directly from the filesystem. This makes importing significantly faster and use a lot less memory. Also, data resources such as fonts can be used in-place on a ROMFS without loading into RAM. ROMFS is currently enabled only on selected boards: PYBD-SFx, all alif-port boards, a new ESP8266_GENERIC variant called FLASH_2M_ROMFS, and all stm32 Arduino boards. Other boards will have ROMFS enabled in the future, or it can be manually enabled on user-defined boards. To build and deploy a ROMFS, mpremote has a new `mpremote romfs` command, with "query", "build", and "deploy" sub-commands, which can build and deploy a directory structure to a ROMFS partition on a target device. These initial ROMFS features will be extended in the future, but for now they provide a way to try out this long-anticipated feature. This release also introduces a brand new "alif" port supporting Alif Ensemble MCUs. These MCUs offer multiple ARM cores, including Ethos-U55 machine-learning processors, and a comprehensive set of peripherals. Current features of the MicroPython alif port include USB support via TinyUSB, dual-core support using OpenAMP, octal SPI flash with XIP, the machine classes Pin, UART, SPI and I2C, and cyw43 WiFi and BLE support. Two alif board definitions are currently available: ALIF_ENSEMBLE for the official Alif Ensemble E7 DevKit, and OPENMV_AE3 for OpenMV's upcoming AE3-based camera board. MicroPython's inline assembler now supports 32-bit RISC-V assembly code via the newly implemented `@micropython.asm_rv32` decorator. This allows writing small snippets of RISC-V machine code that can be called directly from Python code. It is enabled on the rp2 port when the RP2350 is running in RISC-V mode. Datagram TLS (DTLS) is now supported by the `tls` module and enabled on the alif, mimxrt, renesas-ra, rp2, stm32 and unix ports. An `SSLContext` can be created in DTLS mode using `tls.PROTOCOL_DTLS_CLIENT` or `tls.PROTOCOL_DTLS_SERVER` as the mode option, and this context can then be used to wrap a normal UDP socket to get a secure UDP connection. The mpremote command-line tool now supports recursive remove via the new `rm -r` option; for example, `mpremote rm -rv :` can be used to remove all files and directories in the current working directory of the target device. mpremote also now supports relative URLs in the `package.json` file, installing from the local filesystem, and has optimised readline support in `mpremote mount`. Improvements to the core interpreter include: full support for tuples and start/end arguments in the `str.startswith()` and `str.endswith()` methods; enabling of the two-argument version of the built-in `next()` function on most of the ports; a new `sys.implementation._build` entry which holds the build name of the target; and `vfs.mount()` with no arguments now returns a list of mounted filesystems. The `marshal` module has been added with `dumps()` and `loads()` functions, which currently support code objects and, in combination with `function.__code__`, allow converting functions to/from a bytes object. This module is not enabled by default but can be used in custom build configurations. The MicroPython native linker `mpy_ld.py` now includes support for linking in static libraries automatically. This allows the native-module build scripts to look for required symbols from libraries such as `libgcc` and `libm` that are provided by the compiler. This now makes it possible to use standard C functions like `exp()` in native modules. Also, native modules now support 32-bit RISC-V code. The esp32 port now supports IDF v5.3 and v5.4, and support for versions below v5.2.0 has been dropped. Dynamic USB device support is now enabled on ESP32-S2 and ESP32-S3 MCUs, allowing configuration of the USB device at runtime. I2S has been enabled on all ESP32-C3 boards, the `Pin.toggle()` method has been added, and the I2C bus identifier is now an optional argument (by default, bus 0 is used). Additionally, memory management has been improved for the allocation of TLS sockets to attempt to automatically free any existing unused TLS memory when needed. The mimxrt port now enables exFAT filesystem support and the PPP driver for boards with lwIP networking, and has support for a UF2 bootloader, making it easier to deploy firmware. The `machine.RTC.now()` method has been dropped (use `datetime()` instead), `ADC.read_uv()` has been added, and `machine.I2C` has support for the `timeout` keyword argument. The I2C, SPI and UART classes now support default buses, so the first argument to these constructors is no longer needed if the default bus is used. Some inconsistencies with PWM output have been fixed, along with an allocation bug for the UART RX and TX buffers. The rp2 port sees the introduction of many new RP2350 boards, including the Pico 2 W, as well as support for PSRAM with size autodetection. The PIO interface now supports `side_pindir` selection, and SPI allows the MISO pin to be unspecified. Both the I2C and SPI classes now have the bus identifier as an optional argument with a default based on the board configuration. WPA3 is now supported on the Pico W and Pico 2 W in both AP and STA modes. Lost WiFi events due to code executing on the second core have now been fixed, mDNS has been fixed, and `rp2.bootsel_button()` and USB sleep now work on RP2350. ROMFS support has been added but is not enabled on any board by default; see commit 50a7362b3eff211a5051eeaecc88bdde045c90d1 for information on how to enable it manually. The samd port has added full support for 9-bit data in the UART peripheral and supports default buses and pins for I2C, SPI and UART. DAC for two channels has been fixed on SAMD51, and UART buffering has had a few bug fixes. The stm32 port now deinitialises I2C and SPI buses on soft-reset, which may be a breaking change for certain applications; be sure to always initialise I2C and SPI instances when creating them. The CAN code has been refactored, and a few minor bugs have been fixed there. Corrupt littlefs filesystems are now handled properly at startup: instead of a failed mount leading to a hard fault, the code attempts to mount again with default block device parameters, and if that also fails, it prints a message and continues the boot process. ROMFS is enabled on PYBD-SFx boards and all Arduino boards and can be enabled on other boards by manual configuration; see commit bea7645b2e55881c4f42e6cfbe2a6433c5986794 for details. The PYBD-SF6 firmware now supports both original boards and new boards with larger SPI flash. WPA3 is now supported on boards using the cyw43-driver. mboot now includes a version string which is placed at the very end of the flash section allocated for this bootloader (usually 32k); this version can be retrieved using the `fwupdate.get_mboot_version()` function. The zephyr port has had `machine.Timer` and `machine.WDT` implemented. New boards added in this release are: ALIF_ENSEMBLE and OPENMV_AE3 (alif port), MAKERDIARY_RT1011_NANO_KIT (mimxrt port), MACHDYNE_WERKZEUG, RPI_PICO2_W, SEEED_XIAO_RP2350, SPARKFUN_IOTNODE_LORAWAN_RP2350, SPARKFUN_IOTREDBOARD_RP2350, SPARKFUN_PROMICRO_RP2350, SPARKFUN_THINGPLUS_RP2350, SPARKFUN_XRP_CONTROLLER, SPARKFUN_XRP_CONTROLLER_BETA and WEACTSTUDIO_RP2350B_CORE (rp2 port), ADAFRUIT_NEOKEY_TRINKEY, ADAFRUIT_QTPY_SAMD21, SAMD_GENERIC_D21X18, SAMD_GENERIC_D51X19 and SAMD_GENERIC_D51X2 (samd port), WEACT_F411_BLACKPILL (stm32 port). The change in code size since the previous release for select builds of various ports is (absolute and percentage change in the text section): bare-arm: +4 +0.007% minimal x86: -90 -0.049% unix x64: +16941 +2.046% stm32: -96 -0.025% cc3200: +280 +0.152% esp8266: +964 +0.138% esp32: +10956 +0.654% mimxrt: +7508 +2.065% renesas-ra: -160 -0.026% nrf: +168 +0.090% rp2: +7944 +0.872% samd: +1112 +0.418% The leading causes of these changes in code size are: - minimal, stm32, renesas-ra: various small code-size optimisations - unix: enable VfsRom, update mbedTLS to v3.6.2, enable DTLS - cc3200: implement `Pin.toggle()` method - esp8266: enable function attributes, implement `Pin.toggle()`, allow enumerating connected stations in AP mode, update requests package - esp32: lots of small fixes and improvements - mimxrt: enable exFAT, add `function.__code__` and function constructor - nrf: various small features such as `sys.implementation._build`, two-argument built-in `next()`, no-argument `vfs.mount()` - rp2: update mbedTLS to v3.6.2, enable DTLS, update cyw43-driver to 1.1.0 - samd: support UART 9-bit data, add `function.__code__` and function constructor, provide default IDs for UART, I2C and SPI Performance of the VM and runtime is effectively unchanged since the previous release. Thanks to everyone who contributed to this release: Alessandro Gatti, Alex Brudner, Amirreza Hamzavi, Andrew Leech, Angus Gratton, Anson Mansfield, Carl Pottle, Christian Clauss, chuangjinglu, Corran Webster, Damien George, danicampora, Daniël van de Giessen, Dryw Wade, eggfly, Garry W, garywill, Glenn Moloney, Glenn Strauss, Graeme Winter, Hans Maerki, Herwin Grobben, I. Tomita, iabdalkader, IhorNehrutsa, Jan Klusáček, Jan Sturm, Jared Hancock, Jeff Epler, Jon Nordby, Jos Verlinde, Karl Palsson, Keenan Johnson, Kwabena W. Agyeman, Lesords, machdyne, Malcolm McKellips, Mark Seminatore, Markus Gyger, Matt Trentini, Mike Bell, Neil Ludban, Peter Harper, peterhinch, Phil Howard, robert-hh, Ronald Weber, rufusclark, Sebastian Romero, Steve Holden, stijn, StrayCat, Thomas Watson, Victor Rajewski, Volodymyr Shymanskyy, Yoctopuce. MicroPython is a global Open Source project, and contributions were made from the following timezones: -0800, -0700, -0600, -0500, -0400, +0000, +0100, +0200, +0300, +0330, +0700, +0800, +1000, +1100, +1300. The work done in this release was funded in part through GitHub Sponsors, and in part by George Robotics, Espressif, Arduino, LEGO Education, OpenMV and Planet Innovation. What follows is a detailed list of changes, generated from the git commit history, and organised into sections. Main components =============== py core: - objdeque: fix buffer overflow in deque_subscr - py.mk: add check that any specified USER_C_MODULES folder exists - usermod.cmake: add check that any specified USER_C_MODULES exists - usermod.cmake: if USER_C_MODULES is a folder add micropython.cmake - objfloat: workaround non-constant NAN definition on Windows MSVC - misc: fix msvc and C++ compatibility - emitglue: fix clear cache builtin warning on Clang for AArch32 - mkrules.mk: use partial clone for submodules if available - dynruntime.mk: delete compiled module file on clean - qstr: add qstr_from_strn_static() helper function - reader: provide mp_reader_try_read_rom() function - persistentcode: add support for loading .mpy files from a ROM reader - misc: add a popcount(uint32_t) implementation - emitinlinerv32: add inline assembler support for RV32 - obj: cast float literals to 64-bit to prevent overflow warning - obj: make literals unsigned in float get/new functions - asmarm: fix asm_arm_ldrh_reg_reg_offset to emit correct machine code - asmarm: allow function state to be larger than 255 - asmarm: fix locals address loading code generation with large imm - asmarm: fix halfword loads with larger offsets - mkrules.mk: move comment about partial clones outside make rule - persistentcode: initialize prelude_ptr to prevent compiler warning - parsenum: throw an exception for invalid int literals like "01" - emitnative: optimise Viper register offset load/stores on Xtensa - emitnative: emit shorter exception handler entry code on RV32 - emitnative: optimise Viper immediate offset load/stores on Xtensa - mkrules: add GIT_SUBMODULES_FAIL_IF_EMPTY flag for CMake ports - parsenumbase: favor clarity of code over manual optimisation - gc: split out running finalizers to a separate pass - gc: allow gc_free from inside a gc_sweep finalizer - add optional support for recursive mutexes, use for gc mutex - gc: reorder static functions for clarity - mkrules.mk: reset USER_C_MODULES when building mpy-cross dependency - emitnative: mark condition code tables as const - emitnative: load and store words just once for Viper code - objcode: factor code object out into its own file - objfun: implement function.__code__ and function constructor - persistentcode: add mp_raw_code_save_fun_to_bytes - mkrules.cmake: support passing CFLAGS_EXTRA in environment variable - emitinlinerv32: fix compilation with ESP-IDF v5.2 and later - emitinlinerv32: reduce the footprint of compiled code - emitinlinextensa: simplify register name lookup - parsenum: reduce code footprint of mp_parse_num_float - objstr: support tuples and start/end args in startswith and endswith - modsys: add sys.implementation._build entry - makeqstrdata.py: implement MicroPython compatibility - objarray: add MP_DEFINE_MEMORYVIEW_OBJ convenience macro - runtime: automatically mount ROMFS as part of mp_init - mpconfig: enable 2-argument built-in next() at basic feature level - dynruntime: make malloc functions raise MemoryError on failure - emitinlinerv32: move include of asmrv32.h to within feature guard extmod: - modlwip: fix IGMP address type when IPv6 is enabled - nimble: remove asserts of ediv_rand_present and adjust comments - modlwip: don't allow writing to a TCP socket that is connecting - network_ppp: add stream config parameter - network_ppp: allow stream=None to suspend PPP - vfs_blockdev: support bool return from Python read/write blocks - network_cyw43: fix isconnected() result on AP interface - network_cyw43: fix uninitialised variable in status('stations') - network_cyw43: allow configuring active AP interface - modframebuf: fix 0 radius bug in FrameBuffer.ellipse - modplatform: distinguish AArch64 from AArch32 - modplatform: add Clang to the known compilers list - modplatform: add Android to the recognised platforms list - extmod.mk: fix libmetal build prefix - modplatform: distinguish RISC-V 64 from RISC-V 32 - moductypes: fix large return values of addressof and INT_MAYBE - vfs: guard mutating fs functions with MICROPY_VFS_WRITABLE - vfs_rom: add VfsRom filesystem object - vfs_reader: add support for opening a memory-mappable file - modsocket: add missing static in private function definitions - moddeflate: add missing size_t cast - modlwip: fix incorrect peer address for IPv6 - lwip-include: factor common lwIP config into lwipopts_common.h - mbedtls: try GC before failing to setup socket on esp32, unix - modmarshal: add new marshal module - vfs_rom: remove ability to create VfsRom from an address - lwip-include: increase number of lwIP timers when mDNS enabled - modtls_mbedtls: wire in support for DTLS - vfs_rom: add bounds checking for all filesystem accesses - modvfs: add vfs.rom_ioctl function and its ioctl constants - vfs: add mp_vfs_mount_romfs_protected() helper - network_cyw43: add WPA3 security constants - moddeflate: keep DeflateIO state consistent on window alloc fail - vfs: refactor mp_vfs_mount to enable no-args mount overload - vfs: return mount table from no-args vfs.mount call - vfs_rom: implement minimal VfsRom.getcwd() method - implement UPDATE_SUBMODULES in CMake - extmod.mk: add cyw43_spi.c to list of sources - extmod.mk: switch from drivers/cyw43/cywbt to lib/cyw43-drivers shared: - tinyusb: set MSC max endpoint size based on device speed - runtime/gchelper_generic: fix AArch32 build on Clang - timeutils: add missing mp_uint_t casts - runtime/pyexec: add helper function to execute a vstr drivers: - memory/spiflash: add a config option to soft-reset SPI flash - add MP_QSPI_IOCTL_MEMORY_MODIFIED to indicate flash changed - memory/spiflash: allow a board/port to configure chip params - memory/spiflash: allow a board/port to detect SPI flash - bus/qspi: make num_dummy configurable for quad reads mpy-cross: no changes specific to this component/port lib: - micropython-lib: update submodule to latest - pico-sdk: update to version 2.1.0 - mbedtls: update to mbedtls v3.6.2 - pico-sdk: update to version 2.1.1 - cyw43-driver: update driver to latest version v1.1.0 - alif_ensemble-cmsis-dfp: add new submodule for Alif SDK v1.3.2 - alif-security-toolkit: add new submodule for Alif Security Toolkit Support components ================== docs: - reference/packages: fix description of --target option in mip - specify the recommended network.WLAN.IF_[AP|STA] constants - add a "Reset and Boot Sequence" reference page - rp2: add a small factory reset page - esp32: add a factory reset page - library: note link between machine.soft_reset() and sys.exit() - change copyright line to mention "authors and contributors" - update machine.TouchPad docs for ESP32-S2 and ESP32-S3 - fix some comments and error messages with doubled-up words - library/binascii: add docs for binascii.crc32 method - fix the quickref documentation of rtc.datetime() - reference/isr_rules: describe issue with hard ISRs and globals - esp32: update tutorial flashing steps to match deploy.md - esp32: defer to the download page for flashing steps - update copyright year range to include 2025 - samd/pinout: add pinout for Adafruit NeoKey Trinkey and QT Py - samd/pinout: add pinout for the Generic SAMD board types - esp32: add documentation for SPI Ethernet devices on esp32 port - note which ports have default or optional network.PPP support - reference: add strings vs bytes to speed optimisation tips - library/espnow: clarify usage of the "rate" configuration key - library/marshal: document the marshal module - fix double 'the' in documentation - library/machine.Pin: show availability of low, high and toggle - samd: update the SAMD documentation describing default IDs/pins - rp2: add network information to the rp2 quickref - library/vfs: document no-args mount output - reference/mpremote: update docs for mpremote rm -r - note that machine.USBDevice is now available on esp32 port examples: - natmod/re: fix build on RV32 with alloca tests: - basics/deque2.py: add tests for deque subscript-from-end - run-tests.py: simplify the way target-specific tests are given - run-tests.py: change --target/--device options to --test-instance - run-tests.py: add mimxrt and samd platforms - use the recommended network.WLAN.IF_[AP|STA] constants - cpydiff: fix test case for modules_json_nonserializable - net_hosted: improve and simplify non-block-xfer test - multi_espnow: add channel setting test, add some docs - add basic wlan test - misc/sys_settrace_features.py: add note about CPython 3.12 issue - extmod: workaround CPython warning in asyncio_new_event_loop test - run-tests.py: add support for tests to use unittest - run-tests.py: print .out file when there is no .exp file - ports/stm32_hardware: convert DMA test to use unittest - net_hosted: convert connect-nonblock-xfer test to use unittest - extmod: convert machine1.py test to use unittest - extmod_hardware: add a test for machine.PWM freq and duty - extmod: add test for uctypes.addressof function - run-tests.py: set name of injected test module to '__main__' - fix all file ioctl's to support only MP_STREAM_CLOSE - extmod: add VfsRom test - inlineasm: make room for RV32IMC inline asm tests - run-tests.py: detect inlineasm support and add tests if needed - run-tests.py: set __main__ module to __injected_test - run-tests.py: implement getcwd on __FS hook filesystem - extmod/vfs_rom.py: import errno for test - README: update TLS certificate generation instructions - multi_net: update TLS test certificates and keys - extmod/re_sub.py: fix test execution on Python 3.13 - basics/nanbox_smallint.py: fix incorrect use of int() in test - add a test for SSL socket memory leaks - ports/rp2: add test for SLEEP_ENx registers over lightsleep - multi_wlan: remove esp8266 port workaround - run-natmodtests.py: autodetect the test target architecture - run-tests.py: give more information when CPython crashes - multi_net: add test for DTLS server and client - four typos in tests directory - run-tests: remove any 'expected' file from a unittest run - multi_pyb_can: add multitests for pyboard CAN controller - cpydiff: remove builtin_next_arg2.py difference - extmod/vfs_mountinfo.py: add test for no-args mount output - cpydiff: update CPy diff for assign expr in nested comprehensions - cpydiff: remove types_str_endswith - ports/alif_hardware: add flash testing script - update UART and SPI tests to work on Alif boards - run-tests: print a note if it looks like unittest.main() missing tools: - mpremote: fix UnboundLocalError in Transport.fs_writefile() - ci.sh: fix commit msg checking when PR branch HEAD behind master - ci.sh: fix reference commit for code size comparison - mpremote: make sure stdout and stderr output appear in order - mpremote: add test for forced copy - mpremote: support trailing slash on dest for non-recursive copy - ci.sh: remove explicit macOS pkg-config install - ci.sh: re-enable vfs_posix tests on unix qemu MIPS CI - boardgen.py: provide macro defns for number of cpu/board pins - mpy_ld.py: add native modules support for RV32 code - verifygitlog.py: show invalid commit subjects in quotes - ci.sh: run test_full for qemu port CI - autobuild: don't allow a board to change its ID - pyboard.py: wait a bit before accessing the PTY serial port - autobuild: template the generation of esp32 port deploy.md - mpremote: avoid initial blocking read in read_until() - mpremote: introduce timeout_overall for read_until() - ci.sh: add natmod tests for QEMU/Arm - ci.sh: build MIMXRT1060_EVK with MSC enabled as part of mimxrt CI - mpremote: support mip install from package.json on local fs - pyboard.py: make get_time use machine.RTC instead of pyb.RTC - ci.sh: build the W5100S_EVB_PICO board with no threads - mpremote: add support for relative urls in package.json files - mpremote: optimise readline support in mount - mpremote/tests: add test for RemoteFile.readline - mpy-tool.py: add support for self-hosting of mpy-tool - mpy-tool.py: support calling main() from an external script - mpremote: add romfs query, build and deploy commands - mpy_ld.py: allow linking static libraries - ci.sh: build Xtensa natmods as part of the CI process - ci.sh: do not assume the Python interpreter is called "python" - mpremote: make mip install skip /rom*/lib directories - mpy_ld.py: give better error for unsupported ARM absolute relocs - ci.sh: manually install picotool for rp2 builds - gen-cpydiff.py: fail CPython diff generation if output matches - mpremote: allow .img for ROMFS file and validate ROMFS image - mpremote: add recursive remove functionality to filesystem cmds - mpremote/tests: add tests for mpremote rm -r CI: - upgrade codespell to v2.4.1 - upgrade to ruff v0.9.6 - workflows: workaround using CPython 3.12 in MSYS2 builds - workflows: bump codecov/codecov-action from 4 to 5 - workflows: use Python 3.11 for unix settrace jobs - workflows: use ubuntu-22.04 for unix qemu CI - workflows: stop using ubuntu-20.04 - workflows: include the Python version in the ESP-IDF cache key - workflows: add Alif port to CI - cache Zephyr workspace installation - pull the Zephyr CI docker image from GitHub container reg - add caching of ccache for Zephyr The ports ========= all ports: - make PWM duty_u16 have an upper value of 65535 across all ports - fix some comments and error messages with doubled-up words - fix machine.RTC.init() method so argument order matches the docs alif port: - tinyusb_port: add Alif TinyUSB DCD driver - tinyusb_port: disable USB IRQ on deinit - tinyusb_port: implement SOF event - add initial port to Alif Ensemble MCUs - system_tick: use a UTIMER for system ticks and timing - mphalport: enable efficient events and implement quiet timing - system_tick: integrate soft timer - modmachine: enable machine.Timer - se_services: add SE services interface - mpconfigport: enable os.urandom() - mpconfigport: enable MICROPY_PY_RANDOM_SEED_INIT_FUNC - modalif: add alif.info() function - modmachine: implement machine.unique_id(), fix machine.reset() - usbd: implement proper USB serial number - machine_adc: add basic ADC support - mcu: add ToC config for dual images - support building the port for HE or HP or both cores - support running the port on the HE core - implement Open-AMP port backend - irq: define more IRQ priorities - system_tick: implement optional LPTIMER support for systick - system_tick: implement optional ARM SysTick support for systick - mpconfigport: select SysTick on HE core - mpu: add custom MPU_Load_Regions function - ospi_flash: generalise flash driver to support MX chips - ospi_flash: enter XIP mode when flash is idle - mpu: define constants for MPU regions - mpmetalport: add Open-AMP MPU region - ospi_flash: fix XIP for 8-bit instructions (ISSI) - ospi_flash: support flash device auto-detection in runtime - ospi_flash: configure dummy cycles - ospi_flash: add negative clock pin - ospi_flash: enable pull-up IO2/WP - ospi_ext: optimize XIP speed - ospi_flash: use OSPI in XIP mode only - ospi_flash: add 16-bit words swap flash setting - se_services: use EUI extension for unique id - modmachine: implement proper low-power modes - add support for pin alternate function selection - machine_i2c: add machine.I2C peripheral support - machine_spi: add machine.SPI peripheral support - machine_rtc: add basic machine.RTC support - ospi_flash: use mp_hal_pin_config to configure OSPI pins - se_services: add a secondary MHU channel - mpmetalport: use MHU to notify remote cores - link with libnosys - mpmetalport: only notify after metal subsystem is init'd - mpuart: use mp_hal_pin_config for TX/RX configuration - alif_flash: distinguish between total flash size and FS size - alif_flash: make flash respond to the buffer protocol - mpu: add function to set read-only bit on MRAM MPU region - vfs_rom_ioctl: add vfs_rom_ioctl with support for OSPI and MRAM - modules: make HE core set /rom as current dir - mphalport: add mp_hal_pin_config_irq_falling helper - mpuart: generalise UART driver to suppot all UART instances - integrate lwIP and mbedTLS - integrate cyw43 WLAN driver - integrate cyw43 Bluetooth with NimBLE - mcu: remove json config files - mcu: pre-process Alif ToC config file - mpuart: enhance UART to support bits/parity/stop and more IRQs - machine_uart: add machine.UART peripheral support - support more fine-grained pin alternate function selection - ospi_flash: don't invalidate cache after erasing/writing - ospi_flash_settings: use 8-bit DFS for XIP - ospi_flash: restore XIP settings after erase and write - mpu: add MPU region for OSPI1 XIP memory range - boards/ALIF_ENSEMBLE: add Alif Ensemble board config - boards/OPENMV_AE3: add OpenMV AE3 board definition bare-arm port: no changes specific to this component/port cc3200 port: - mods/pybpin: implement Pin.toggle() method embed port: no changes specific to this component/port esp8266 port: - use the recommended network.WLAN.IF_[AP|STA] constants - mpconfigport: enable function attributes - Makefile: fix local toolchain builds on recent Linux systems - network_wlan: make WLAN.config('channel') use wifi_get_channel - network_wlan: make WLAN.config(channel=x) use wifi_set_channel - machine_pin: implement Pin.toggle() method - network_wlan: allow enumerating connected stations in AP mode - implement vfs.rom_ioctl with support for external flash - boards: add FLASH_2M_ROMFS variant with 320k ROM partition - rename ROMFS partition config variables to include "part0" esp32 port: - move the linker wrap options out of the project CMakeLists - add some notes about the different CMake files - machine_hw_spi: reject invalid number of bits in constructor - machine_pwm: use IDF functions to calculate resolution correctly - network_wlan: add missing WLAN security constants - machine_pwm: restore PWM support for ESP-IDF v5.0.x and v5.1.x - workaround native code execution crash on ESP32-S2 - use the recommended network.WLAN.IF_[AP|STA] constants - modsocket: fix getaddrinfo hints to set AI_CANONNAME - fix setting WLAN channel in AP mode - use hardware version for touchpad macro defines - fix machine.TouchPad startup on ESP32-S2 and S3 - update machine.TouchPad docs for ESP32-S2 and ESP32-S3 - add missing network.STAT_CONNECT_FAIL constant - fix link failure due to link library order - add basic espressif IDF v5.3 compatibility - fix machine_touchpad compiling on IDFv5.3 - pass V=1 or BUILD_VERBOSE through to idf.py when building - use capability defines to configure features - mpconfigport: use the appropriate wait-for-interrupt opcode - drop support for ESP-IDF below V5.2.0 - remove IDF-version-specific sdkconfig - simplify thread cleanup - enable machine.USBDevice to configure USB at runtime - machine_timer: restrict timer numbers for ESP32C6 to 0 and 1 - boards: remove remaining "id" entries from board.json - template the generation of esp32 port deploy.md - boards: update the product name for some UM boards - add support for IDF v5.4 - disable component manager when running 'make submodules' - don't add TinyUSB files to an ECHO_SUBMODULES build - README: fix board in octal-SPIRAM example make command - boards: enable I2S on ESP32C3 boards - machine_sdcard: fix invalid result of SDCard.read/writeblocks - remove unneeded "memory.h" header file - machine_i2c: make I2C bus ID arg optional with default - README: make some minor improvements to the README - esp32_common.cmake: allow overriding linker.lf - machine_pin: implement Pin.toggle() method - implement vfs.rom_ioctl with support for external flash - merge the per-SoC "main" components back together - remove the ESP32 ringbuffer linker workaround - machine_sdcard: add SDCard pin assignments for ESP32-S3 support - machine_sdcard: add SDCard SPI mode support for ESP32-S2,C3,C6 - boards: enable machine.SDCard on all boards - machine_pwm: correctly stop LEDC timer - machine_pin: fix logic clearing USB_SERIAL_JTAG_USB_PAD_ENABLE - machine_pin: fix availability of USB Serial/JTAG pins on ESP32-C6 - implement UPDATE_SUBMODULES in CMake - Makefile: use $(Q) prefix on all commands - esp32_common.cmake: use native gchelper for RISC-V - esp32_common.cmake: clean up RISC-V directives - esp32_common.cmake: remove obsolete definition mimxrt port: - machine_pwm: fix a few inconsistencies with PWM output - switch to shared TinyUSB descriptor - mpconfigport: update FATFS config to align with other ports - machine_rtc: deprecate RTC.cancel in MicroPython v2 - machine_rtc: drop machine.RTC.now() method - irq: add CSI IRQ - machine_rtc: fix build with new SDKs - mpconfigport: remove hard-coded CMSIS header - add support for a UF2 bootloader - hal: update the LUT and re-enable PAGEPROGRAM_QUAD - flash: swap the order of disabling IRQ and disabling the cache - boards: update the deploy instructions for the UF2 bootloader - boards: add flash configuration constants to mpconfigboard.mk - hal: set the flexspi flash CLK frequency on boot - add optional MSC support - boards: reduce stack size for 1011 and 1015 MCUs - boards/ADAFRUIT_METRO_M7: reduce flash freq to 100MHz - hal/flexspi_nor_flash: fix typo in comment about frequency - boards/MAKERDIARY_RT1011_NANO_KIT: add new Makerdiary board - machine_adc: add ADC.read_uv() method - mpconfigport: enable support for exFAT - mpconfigport: enable PPP for boards with lwIP - machine_uart: remove duplicate init and make IRQ optional - hal/qspi_nor_flash_config: use a safe common CS timing - machine_uart: fix rx/tx buffer allocation bug - machine_i2c: support the timeout keyword argument - enable default devices for I2C, SPI and UART - boards: update deploy instructions - Makefile: fix dependencies for generation of flexram_config.s minimal port: no changes specific to this component/port nrf port: - drivers/ticker: reset slow ticker callback count on soft reboot - boards/ARDUINO_NANO_33_BLE_SENSE: update LED and timer config - modules: fix access of read-only buffer in Flash.writeblocks pic16bit port: - make it build with recent XC16 versions powerpc port: no changes specific to this component/port qemu port: - Makefile: include unittest in firmware - mpconfigport: enable VFS reader, loading .mpy files and io.IOBase - add test_natmod target for RV32 and use as part of CI pipeline - mpconfigport: enable VfsRom - main: make GC heap size configurable on a per-arch basis - boards: exclude Thumb2 tests and tests failing with native emitter - Makefile: add test_full target to run a comprehensive test suite - mcu/arm: dump exception cause and registers on machine error - disable native emitter for the MICROBIT board - Makefile: increase GC heap size to 140KiB - boards/SABRELITE.mk: remove exception for omitted tests - boards: change boards to use a subdirectory like other ports - Makefile: fix shell interpolation for automated natmod tests - boards/SABRELITE: increase MicroPython heap to 160k renesas-ra port: - mpconfigport: switch FATFS LFN to type 2 - Makefile: remove id_code section from binary file generation - modrenesas: expose the Flash block device to Python code rp2 port: - README: remove redundant `global` statement from example code - mpconfigport: switch FATFS LFN to type 2 - pass V=1 or BUILD_VERBOSE to rp2 build - modmachine: fix USB sleep on RP2350 MCUs - CMakeLists.txt: add components required by bootrom.h - cyw43_configport: define cyw43 pins - mphalport: add mp_hal_is_pin_reserved() function - boards/RPI_PICO2_W: add new Pico 2 W board definition - boards/RPI_PICO2_W: add RISCV variant for Pico 2 W - boards/SPARKFUN_PROMICRO: fix SparkFun Pro Micro RP2040 image - mpconfigport: enable RV32 inline assembly support - mphalport: fix mp_hal_pin_low/high() for pin>=32 - machine_bitstream: tweak MP_HAL_BITSTREAM_NS_OVERHEAD for RP2350 - boards/SPARKFUN_PROMICRO_RP2350: add SparkFun Pro Micro RP2350 - boards/SPARKFUN_THINGPLUS_RP2350: add SparkFun Thing Plus RP2350 - migrate to the new mp_thread_recursive_mutex_t - modmachine: make lightsleep preserve SLEEP_EN0 and SLEEP_EN1 - rp2_flash: workaround multicore lockout not being reset - rp2_pio: add side_pindir support for PIO - boards: add SparkFun IoT Node LoRaWAN board - modules: fix memory leak and logic bug in handling of _pio_funcs - fix build failure if threads are disabled - boards/MACHDYNE_WERKZEUG: add support for Machdyne Werkzeug - boards/SPARKFUN_XRP_CONTROLLER_BETA: add SparkFun XRP Controller - machine_i2c: make I2C bus ID arg optional with default - implement vfs.rom_ioctl with support for external flash - modrp2: fix rp2.bootsel_button() function for RP2350 - boards/SPARKFUN_IOTREDBOARD_RP2350: add support for IoT RedBoard - boards/WEACTSTUDIO_RP2350B_CORE: add WeAct Studio RP2350B Core - boards/SPARKFUN_XRP_CONTROLLER: add SparkFun XRP Controller - boards/SPARKFUN_XRP_CONTROLLER_BETA: fix XRP Controller Beta URL - boards/SEEED_XIAO_RP2350: add new Seeed XIAO board definition - boards: fix SparkFun vendor name - boards/SPARKFUN_IOTNODE_LORAWAN_RP2350: add SD card support - machine_i2c: require an I2C bus ID when no default is available - machine_spi: make SPI ID optional - machine_spi: allow MISO to be unspecified - mpnetworkport: fix lost CYW43 WiFi events when using both cores - mpnetworkport: refactor out cyw43_has_pending global variable - pendsv: account for PendSV running on both cores, and without CYW43 - machine_uart: fix unintended UART buffer allocation on init() - implement UPDATE_SUBMODULES in CMake - print an error message if pico-sdk submodule is missing - Makefile: use $(Q) prefix on all commands - cyw43_configport: fix cyw43 mDNS by properly starting mDNS on netif - add support for PSRAM with auto-detection - mpconfigport: configure heap for PSRAM - rp2_flash: support flash writes from PSRAM - rp2_flash: configure optimal flash timings samd port: - machine_uart: add full support for 9-bit data - boards/SAMD21_XPLAINED_PRO: add specific deploy instructions - mboot: provide a UF2 bootloader for SAMD21 Xplained Pro - boards/SAMD21_XPLAINED_PRO: use the SPI flash for the file system - samd_flash: make flash read/write methods access self parameters - mboot/README.md: add information about the bootloader source - machine_dac: fix SAMD51 DAC for two channels - samd_qspiflash: correct QSPI baud calculation - boards: add generic SAMD21x18 board definitions - boards: add generic SAMD51x19 board definitions - boards: add generic SAMD51x20 board definitions - Makefile: add support for board variants - boards: add support for the Adafruit QT Py board - boards: add support for the Adafruit NeoKey Trinkey board - machine_i2c: support default instance and SCL/SDA pin values - machine_spi: support default instance and SCK/MOSI/MISO pin values - machine_uart: support default instance and TX/RX pin values - boards: add missing TX/RX, SCL/SDA and SCK/MOSI/MISO pin names - boards: provide default IDs for UART, I2C and SPI - machine_uart: fix unintended UART buffer allocation on init() - machine_uart: fix lock-up in loopback mode if read buffer is full stm32 port: - boards: update Arduino board configs for SPI reset and bootloader - boards: rename SDRAM frequency config option to make units clear - sdram: make SDRAM refresh count configurable by a board - spi: add spi_deinit_all function - pyb_i2c: add pyb_i2c_deinit_all function - main: deinitialize SPI and I2C on soft-reset - mpconfigport: switch FATFS LFN to type 2 - boards/STM32F429DISC: fix SDRAM configuration - pin: add option to exclude legacy Pin methods and constants - pin: add config option to exclude Pin alternate function - pin: exclude Pin.cpu/Pin.board if they contain no entries - extint: fix EXTI IRQ handlers for H5 MCUs - boards/WEACT_F411_BLACKPILL: add WeAct F411 'blackpill' boards - generate PLL tables from pre-processed headers - fix extraction of hse/hsi/pllm values from preprocessed source - mboot: add mboot version string - mpconfigboard_common: add MICROPY_HW_SPI_IS_STATIC macro - spi: retain the state of special SPI buses on soft reboot - boards: reserve SPI bus when it's used for external flash storage - boards: support 'FDCAN' in board pin CSVs - pyb_can: fix CAN-FD BRS baud initialisation - pyb_can: make pyb.CAN baud calculation a little more forgiving - pyb_can: include requested CAN baudrate in matching error - can: fix clearing filters on CAN3 (bxCAN) - fdcan: fix extended CAN ID filtering for stm32g4 - boards/ARDUINO_NICLA_VISION: fix CAN pin assignment - boards: update Arduino boards to reserve timers and fix USB PID - eth: make ETH DMA buffer attributes configurable - sdcard: fix unchecked uint32_t overflow in SD card driver - sdcard: drop the pyb.SDCard timeout from 60 to 30 seconds - implement vfs.rom_ioctl with support for internal/external flash - boards: enable ROMFS partitions on PYBD_SFx boards - rename ROMFS partition config variables to start at index 0 - boards/ARDUINO_GIGA: enable 4MiB ROMFS partition in ext flash - boards/ARDUINO_NICLA_VISION: enable 4MiB ROMFS part in ext flash - boards/ARDUINO_PORTENTA_H7: enable 4MiB ROMFS part in ext flash - can: refactor can.h API to not depend on pyboard can types - qspi: implement MP_QSPI_IOCTL_MEMORY_MODIFIED ioctl - main: catch and report corrupted lfs filesystem at startup - boards: add F427 AF CSV file - stm32_it: add handler for timer 20 interrupt - timer: use APB2 to calculate timer 20 source frequency - timer: add support for STM32H5 Timer 1 - qspi: add qspi_memory_map_exit and restart - boards/PYBD_SF2: restart qspi memory-mapped mode during startup - vfs_rom_ioctl: allow ROMFS configuration to be dynamic - qspi: allow SPI flash size to be decided at runtime - mboot: allow USB strings to be dynamic - modmachine: add SPI flash size to machine.info dump - boards/PYBD_SF6: support boards with larger SPI flash unix port: - force _FILE_OFFSET_BITS=64 to fix 32-bit file ABI - enable VfsRom on standard and coverage variants - use the bare metal mbedTLS config in the coverage buiid - add recursive mutex support - main: add coverage test for mounting ROMFS filesystem at startup webassembly port: no changes specific to this component/port windows port: - force _FILE_OFFSET_BITS=64 to fix 32-bit file ABI zephyr port: - machine_wdt: add watchdog timer implementation - machine_timer: add machine.Timer class implementation
f498a16
2025-04-15 22:28
下载
v1.24.1
Patch release for mpremote, rp2 IGMP, esp32 PWM, SDCard, and AP channel This is a patch release containing the following commits: - tools/mpremote: fix UnboundLocalError in Transport.fs_writefile() - esp32/machine_pwm: use IDF functions to calculate resolution correctly - pic16bit: make it build with recent XC16 versions - py/objdeque: fix buffer overflow in deque_subscr - extmod/modlwip: fix IGMP address type when IPv6 is enabled - esp32/machine_pwm: restore PWM support for ESP-IDF v5.0.x and v5.1.x - esp32: workaround native code execution crash on ESP32-S2 - tools/mpremote: make sure stdout and stderr output appear in order - tools/mpremote: add test for forced copy - tools/mpremote: support trailing slash on dest for non-recursive copy - esp32/modsocket: fix getaddrinfo hints to set AI_CANONNAME - extmod/vfs_blockdev: support bool return from Python read/write blocks - extmod/network_cyw43: fix isconnected() result on AP interface - extmod/network_cyw43: fix uninitialised variable in status('stations') - extmod/network_cyw43: allow configuring active AP interface - esp32: fix setting WLAN channel in AP mode - esp32: use hardware version for touchpad macro defines - esp32: fix machine.TouchPad startup on ESP32-S2 and S3 - extmod/modframebuf: fix 0 radius bug in FrameBuffer.ellipse - nrf/drivers/ticker: reset slow ticker callback count on soft reboot - py/objfloat: workaround non-constant NAN definition on Windows MSVC
ecfdd5d
2024-11-29 20:53
下载
v1.25.0-preview
44dc6eb
2024-10-28 08:08
下载
v1.24.0
内容可能含有违规信息
f212bbe
2024-10-25 22:43
下载
v1.24.0-preview
2926001
2024-05-31 14:35
下载
v1.23.0
Dynamic USB devices, revamped webassembly port, openamp, tls, vfs modules This release of MicroPython adds support for dynamic USB devices defined in Python, adds new `openamp`, `tls` and `vfs` modules, completely revamps the webassembly port to add proxying between JavaScript and Python, and implements significant code size optimisations for frozen modules. There are also many other enhancements and bug fixes. Keep reading for a more detailed summary of the main changes. After a lot of design, development and testing, MicroPython now has full support for user-defined USB devices. The interface is via a new `machine.USBDevice` class, and this allows the user to specify the USB descriptors and implement Python callbacks for USB endpoint transfers. With this, any USB device can be implemented in pure Python. While the `machine.USBDevice` interface is low-level and complete, there is a higher-level USB library in `micropython-lib` that allows easier implementation of devices, with examples for keyboard, mouse, MIDI and serial CDC. This feature is currently available on rp2 and samd ports, and other ports will follow in the future. Support for the OpenAMP (asymmetric multiprocessing) protocol has been added through the new `openamp` module. This allows MicroPython to control other CPU cores in the system, to load and start processes and communicate with them through endpoints. This feature is currently available on the mimxrt and stm32 ports. Two other new modules have been added: `vfs` and `tls`. The `vfs` module contains all VFS (virtual filesystem) related functions and classes, such as `mount`, `umount` and `VfsFat`. These were originally in the `os` module but having them there is not compatible with CPython, so they have been moved to their own dedicated module. They still exist in the `os` module for now but will eventually be removed from there, so it's recommended to start using the `vfs` module from now on. Similarly the new `tls` module is an evolution of the `ssl` module, whereby all the existing functionality in `ssl` has been moved to the `tls` module. This is done because MicroPython's SSL interface is becoming increasingly different to CPython's and moving this SSL/TLS functionality to a new `tls` module gives it room to grow and obtain new features that are useful for embedded applications. And compatibility with normal Python is still retained via a pure Python implementation of the `ssl` module. One new feature in the new `tls` module is the ability to register a certificate verification callback. Other additions include more methods on the `deque` object so it is doubly-ended and supports iteration, and support for half-float 'e' format in `struct.pack`/`struct.unpack`. Dynamic native modules have had some additional runtime methods exposed, and the .mpy sub-version has been increased from v6.2 to v6.3 (native code in .mpy files will need to be recompiled, but bytecode does not and is still compatible). There has also been significant code size optimisations for frozen modules. A new internal `mp_proto_fun_t` type has been defined which allows the common case of bytecode functions (as opposed to native code) to be stored in frozen code without any additional overhead of the `mp_raw_code_t` descriptor structure. All firmware builds using frozen modules will see a significant decrease in size. Code size has also improved further for very small targets by adding an option to remove the qstr hash bytes. Internally in the source code the "STATIC" macro definition has been removed. Code should now just use "static" instead. If you have C/C++ code that uses "STATIC" then either replace it with "static", or provide your own #define to define "STATIC" as "static". See commit decf8e6a8bb940d5829ca3296790631fcece7b21 for details. Mbedtls has been updated to version 3.5.1. And network interface constants, such as `IF_STA` and `SEC_WPA2`, have now been consolidated across ports so they all live at the `WLAN` class level, for example `network.WLAN.SEC_WPA2` (existing constants at the `network` module level have been retained for backwards compatibility, but the new ones should be preferred from now on). The esp32 port has seen some important bug fixes in the BLE component, to deinitialise without crashing, and increase the BLE task stack size. This port also uses the new I2S IDF driver, and supports IDF 5.0.5 and 5.2. There is support to enter the bootloader via `machine.bootloader()` and a new `esp32.mcu_temperature()`, for ESP32-C3/S2/S3 devices. The rp2 port has added the new `machine.USBDevice` dynamic USB driver, and has had firmware performance optimisations applied to critical parts of the runtime and VM, giving about a 10% performance boost. There is now direct memory access to PIO and SPI FIFOs via proxy arrays, and bugs have been fixed with threads, lightsleep and UART IRQ latency. The stm32 port has integrated support for the new `openamp` module, which is enabled on all Arduino boards. And firmware for Arduino boards now freeze in additional Arduino-specific library code. There have been fixes for internal flash writes on STM32H5 and STM32H7 MCUs (bank selection and flashing of the last word in a buffer), an important fix to a SPI DMA caching bug, an I2C clock enable fix for I2C4 on STM32F7 MCUs, and a fix for the FDCAN source clock frequency on STM32G4 MCUs. Mboot has added support for a new raw filesystem, to allow simpler and more robust firmware updates. The webassembly port has seen a significant overhaul in its structure, and is now built as a JavaScript .mjs module that exports a user-friendly JavaScript-level API which is inspired by the API provided by Pyodide (which is a version of CPython that runs in the browser). This change is motivated by the need to use MicroPython as an engine within Pyscript, which is a platform for Python in the browser. New features in the webassembly port include proxying of objects between Python and JavaScript, a `js` module to interface with the JavaScript namespace, a `jsffi` module for miscellaneous proxy helpers, top-level async code, JavaScript driven asyncio support, automatic growing of the Python heap, integration of JavaScript and Python finalisation for global memory management, more `time` module functions, and support for build variants (following the unix port). The change in code size since the previous release for various ports is (absolute and percentage change in the text section): bare-arm: -220 -0.383% minimal x86: -341 -0.184% unix x64: +20168 +2.527% stm32: -1692 -0.430% cc3200: +256 +0.139% esp8266: -8880 -1.260% esp32: -3328 -0.194% mimxrt: -408 -0.112% renesas-ra: -464 -0.074% nrf: -640 -0.341% rp2: +5380 +1.626% samd: +3224 +1.229% The leading causes of these changes in code size are: - bare-arm, minimal: disabling qstr hashing - unix: updating mbedtls to version 3.5.1 - stm32: optimising size of frozen modules - cc3200: addition of new `vfs` module, and bug fixes in the VM and array type - esp8266: disabling unused `MICROPY_DEBUG_PRINTERS` and optimising frozen modules - esp32, mimxrt, renesas-ra, nrf: optimising frozen modules - rp2: addition of `machine.USBDevice`, enabling -O2 optimisations - samd: addition of `machine.USBDevice` Performance is effectively unchanged since the previous release on all ports, except the rp2 port which sees a performance improvement of roughly 10%. Thanks to everyone who contributed to this release: Amirreza Hamzavi, Andrew Leech, Angus Gratton, Brian Pugh, Carlosgg, Christian Walther, Damien George, Daniël van de Giessen, darc, Dash Peters, David Lechner, Felix Dörre, iabdalkader, IhorNehrutsa, Iksas, J. Neuschäfer, Jared Hancock, Jim Lipsey, Jim Mussared, Jochen Sprickerhof, Joey232, Jos Verlinde, Kwabena W. Agyeman, Maarten van der Schrieck, Matt Trentini, Matthias Urlichs, Michiel W. Beijen, MikeTeachman, Nicko van Someren, Olivier Lenoir, Phil Howard, Rick Sorensen, robert-hh, Sebastian Romero, Simon Wood, Stanislav Ponomarev, stijn, Takeo Takahashi, Trent Piepho, Trent Warlaven, Vonasmic, YAMAMOTO Takashi, Yoctopuce. MicroPython is a global Open Source project, and contributions were made from the following timezones: -0800, -0700, -0600, -0500, -0300, +0000, +0100, +0200, +0330, +0400, +0900, +1000, +1100. The work done in this release was funded in part through GitHub Sponsors, and in part by George Robotics, Espressif, Anaconda, Arduino, LEGO Education, OpenMV and Planet Innovation. What follows is a detailed list of all changes, generated from the git commit history, and organised into sections. Main components =============== all: - fix "reuse" and "overridden" spelling mistakes - update bindings, ports and tests for mbedtls v3.5.1 - use mp_obj_malloc_with_finaliser everywhere it's applicable - remove the "STATIC" macro and just use "static" instead - prune trailing whitespace - update extmod, ports, examples to build with new berkeley-db lib - add pre-commit hook for codespell - update copyright year range to include 2024 - ISSUE_TEMPLATE: convert issue templates to forms py core: - py.mk: remove extra build dir created for frozen_content - qstr: add support for MICROPY_QSTR_BYTES_IN_HASH=0 - mpconfig: disable qstr hashing at minimum feature level - builtinimport: simplify calls to stat_path() - compile: fix potential Py-stack overflow in try-finally with return - emitglue: reorder and resize members of mp_raw_code_t - emitglue: provide a truncated mp_raw_code_t for non-asm code - emitglue: simplify mp_raw_code_t's kind and scope_flags members - emitglue: introduce mp_proto_fun_t as a more general mp_raw_code_t - emitglue: include fun_data_len in mp_raw_code_t only when saving - makeversionhdr.py: reinstate MICROPY_GIT_HASH in mpversion.h - obj: change sizeof to offsetof in mp_obj_malloc_var macro - obj: introduce mp_obj_malloc_with_finaliser to allocate and set type - misc: remove m_new_obj[_var]_with_finaliser macros - objfun: make mp_obj_new_fun_native/mp_obj_new_fun_asm static-inline - objfun: split viper fun type out to separate mp_type_fun_viper type - emitnative: simplify layout and loading of native function prelude - objfun: support __name__ on native functions and generators - objfun: inline mp_obj_code_get_name() into mp_obj_fun_get_name() - emitglue: remove n_pos_args from DEBUG_printf - builtinevex: fix setting globals for native functions in compile() - compile: remove TODO about name mangling - emitglue: make mp_emit_glue_assign_native's fun_data arg a const ptr - mpconfig: change the default enable level for the vfs module - emitbc: remove call to adjust Python stack by 0 entries - mpstate: don't declare mp_thread_get_state() - modthread: move thread state initialisation to shared function - emitglue: add explicit cast of proto_fun to uint8_t pointer - objstr: add a macro to define a bytes object at compile time - stream: add mp_stream_seek() helper function - stream: factor stream implementations - objdeque: expand implementation to be doubly-ended and support iter - asm: add ASM_NOT_REG and ASM_NEG_REG macros for unary ops - asmxtensa: optimise asm_xtensa_mov_reg_i32_optimised() for tiny ints - emitnative: implement viper unary ops positive, negative and invert - binary: support half-float 'e' format in struct pack/unpack - parse: zero out dangling parse tree pointer to fix potential GC leak - compile: add option to allow compiling top-level await - nlr: add "memory" to asm clobbers list in nlr_jump - makeqstrdata.py: ensure that scope names get low qstr values - dynruntime: add mp_binary_get_size/get_val_array/set_val_array - persistentcode: bump .mpy sub-version to 6.3 - objfun: fix C++ compatibility with casting in inline functions - obj: fix initialiser order in MP_DEFINE_CONST_OBJ_TYPE_NARGS_ macros - objarray: fix use-after-free if extending a bytearray from itself - nlrthumb: make non-Thumb2 long-jump workaround opt-in - dynruntime: add mp_obj_exception_init function to create C exception - dynruntime: export mp_load_method_maybe and mp_arg_parse_all* funcs extmod: - extmod.mk: disable uninitialized warnings in kf_rem_pio2.c - asyncio: support gather of tasks that finish early - modssl_mbedtls: fix cipher iteration in SSLContext.get_ciphers - modssl_axtls: add SSLContext.load_cert_chain() - modtls: move the native ssl module to tls - modtls_mbedtls: implement cert verification callback for mbedtls - modvfs: add new "vfs" module with mount/umount and Vfs classes - btstack: reset pending_value_handle before calling write-done cb - btstack: reset pending_value_handle before calling read-done cb - modrandom: add integer type casts where appropriate - modlwip: support IPv6 - network_wiznet5k: adjust IP types for IPv6 - vfs_posix_file: ensure file object has safe default fd - modmachine: remove MICROPY_PY_MACHINE guard from header - modwebsocket: fix websocket to send correct close frame - modlwip: add back support for empty IP addresses - asyncio: make current_task raise exception when there is no task - nimble: override configuration options set in nimble_port_init - nimble: enable key distribution to support bonding - network_ninaw10: activate the NIC on demand - network_ninaw10: set the proper security mode if none provided - network_ninaw10: fix error messages - modmachine: add MICROPY_PY_MACHINE_SIGNAL configuration option - modmachine: add MICROPY_PY_MACHINE_MEMX configuration option - modmachine: add MICROPY_PY_MACHINE_RESET configuration option - nimble: check for active before setting address mode - machine_usb_device: add support for Python USB devices - libmetal: add MicroPython platform for libmetal - modopenamp: add new OpenAMP module - modopenamp_remoteproc: add new OpenAMP RemoteProc class - os_dupterm: handle exception properly when it occurs in parallel - modnetwork: implement IPv6 API to set and get NIC configuration - network_wiznet5k: properly enable interrupt signal on w5100s - add interface and security constants at WLAN class level - modtls_axtls: add verify_mode and CERT_NONE constant - modopenamp: set a default log handler for ports - modopenamp: use metal logging functions exclusively - modasyncio: make mp_asyncio_context variable public - network_wiznet5k: properly enable socket buffers for W5100(S) - modlwip: use Nagle algorithm and add support for TCP_NODELAY - modos: only sync FAT filesystems using disk_ioctl shared: - timeutils: remove useless void-return - tinyusb: don't disconnect on soft reset unless USB was active - tinyusb: update some code comments for runtime USB - tinyusb: increase default string descr max length to 40 chars - tinyusb: fix dynamic USB control callbacks for wLength==0 - tinyusb: stall the CDC IN endpoint while disconnecting drivers: - dht: only build DHT driver if MICROPY_PY_MACHINE_PULSE enabled - memory: add IS25LPWP064D chip to list of external flash devices mpy-cross: no changes specific to this component/port lib: - cmsis: update to CMSIS 5.9.0 - mbedtls: update to mbedtls v3.5.1 - mbedtls_errors: update error list for latest mbedtls - micropython-lib: update submodule to latest - cyw43-driver: update driver to latest version v1.0.3 - open-amp: add OpenAMP submodule - libmetal: add libmetal submodule - berkeley-db-1.xx: update submodule URL and version - arduino-lib: add Arduino's external library Support components ================== docs: - samd/pinout: update pinout docs with fixed pin assignment - develop/porting: fix argument type of mp_lexer_new_from_file() - add note about position-only arguments in CPython vs MicroPython - library/ssl: change wrap_socket args keyfile/certfile to key/cert - library: move vfs functions and classes from os to vfs module docs - reference/micropython2_migration.rst: add info about os and vfs - use vfs module instead of os - library/sys.rst: document implementation.version.releaselevel - library/bluetooth: add note that ESP32 supports pairing/bonding - library/openamp: document the new openamp module - library/collections: update deque docs to describe new features - library/rp2.DMA: add documentation for rp2 DMA support - library/machine.RTC: add docs for RTC.memory() method - reference/mpyfiles: document change in .mpy sub-version - develop/optimizations: fix typo identified in issue 14391 - esp32/quickref: add note about different ESP32 varieties - library/machine.USBDevice: update note about packages in mp-lib - reference: document how to mip install packages from GitLab - library/asyncio: document that ThreadSafeFlag now works on unix - update copyright year range to include 2024 examples: - embedding: add -fno-common to the sample compiler flags - natmod/framebuf: enable FrameBuffer.poly method - usb: add a very simple USBDevice example with host - usb: add a USBDevice example implementing the DFU protocol - network: rename SSL examples to start with https - network: add example of HTTPS client using non-blocking socket - usb: add README that points out the alternative usb modules - natmod/features4: create custom FactorialError as exc example - natmod/btree: make btree.open use mp_arg_parse_all for kwargs tests: - run-tests.py: remove machine_mem.py test from skip list - thread: adjust thread tests so most are able to run on rp2 port - thread: add a test for accuracy of sleep within a thread - run-multitests.py: change to dir of test script when running it - multi_net: generate smaller certs with 2048-bit RSA - run-tests.py: add an option for running only the failed tests - run-tests.py: remove unneeded argument from run_feature_check() - run-tests.py: make repl test detection more correct - run-tests.py: fix path-based special test detection - extmod/machine_uart_tx.py: add a test for timing of UART.flush() - move port-specific test directories into tests/ports/ directory - ports/rp2: add rp2-specific tests with a test for rp2.DMA - extmod/machine_i2s_rate.py: test multiple I2S instances - extmod/asyncio_wait_task.py: add test for raise and delayed wait - extmod: remove asyncio .exp files that match CPython output - extmod/framebuf_polygon.py: replace sys.stdout.write with print - ports/rp2/rp2_dma.py: tweak test to be more reliable - use vfs module instead of os - multi_bluetooth/ble_irq_calls.py: enhance test to test recursion - ports/unix: add coverage test for frozen functions and generators - cpydiff: add new CPy diff test for class name mangling - multi_bluetooth: move ble_deepsleep to stress_deepsleep_reconnect - basics: split MicroPython-specific deque tests to separate file - float/float_struct_e.py: add specific test for struct 'e' type - run-tests.py: support running webassembly tests via node - ports/webassembly: add webassembly JS tests - net_inet: add simpler tls sites test, and skip existing on axtls - cpydiff: add a note about risk of resizing memoryview targets - micropython/import_mpy_invalid.py: skip if target cant import mpy - run-natmodtests.py: fix search for supported native tests - extmod: fix regex strings to be of r"" type - extmod: add .exp test files for asyncio.get_event_loop tests - basics: split out generator.throw tests that pass multiple args - net_hosted/ssl_verify_callback.py: make exp match actual output - net_inet/tls_text_errors.py: tweak test for newer CPython version - float: use "not" instead of ~ to invert bool value - basics: add .exp file for slice_op test - basics: move str/bytes tests that give SyntaxWarning to sep file tools: - gen-changelog.sh: exclude "-preview" tags from generated log - mpremote: reduce dependency on importlib_metadata - manifestfile.py: change library search to use a list of paths - mpy-tool.py: fix static qstrs when freezing without qstr header - mpy-tool.py: skip generating frozen mp_raw_code_t when possible - manifestfile.py: add --unix-ffi option - ci.sh: add Arduino GIGA to stm32 CI build - mpy-tool.py: fix merging of more than 128 mpy files - ci.sh: update webassembly CI tests - manifestfile.py: fix freeze() when script is an empty iterable - mpremote: add support to mip install from GitLab - ci.sh: simplify selection of natmod tests to run CI: - workflows: bump actions/cache from 3 to 4 - workflows: run mimxrt and rp2 CI with space in repository path - workflows: move Windows CI from AppVeyor to GitHub Actions - workflows: bump setup-msbuild, setup-python, checkout versions - workflows: initialise micropython-lib submodule for windows CI - workflows: move codespell to a GitHub workflow, version it - workflows: add comments where tool versions need to be in sync - workflows: standardise formatting of ruff.yml - workflows: add Biome workflow for JavaScript formatting/linting - workflows: update coverage workflow to codecov-action@v4 - workflows: run code size workflow on shared or port code changes The ports ========= all ports: - move MICROPY_PY_LWIP_ENTER/REENTER/EXIT defns to mphalport.h - move MICROPY_INTERNAL_WFE definition to mphalport.h - fix handling of paths containing spaces in Makefiles - add LED pin aliases for all Arduino boards - use vfs module instead of os - on cold boot, enable USB after boot.py completes - don't include mpthread.h in mpthreadport.h bare-arm port: no changes specific to this component/port cc3200 port: no changes specific to this component/port embed port: - fix alloca include for FreeBSD and NetBSD - improve stack top estimation esp8266 port: - boards/ESP8266_GENERIC: disable MICROPY_DEBUG_PRINTERS - Makefile: add support for C++ user C modules - network_wlan: add interface and security WLAN constants esp32 port: - modsocket: use all supplied arguments to socket.getaddrinfo() - boards/UM_FEATHERS3: use read_uv() for accurate battery voltage - network_ppp: make PPP support optional - mpnimbleport: release the GIL while doing NimBLE port deinit - increase NimBLE task stack size and overflow detection headroom - machine_i2c: fix build warnings when I2C is disabled - machine_hw_spi: combine argument parsing for constructor and init - boards: add missing named digital pins for Arduino Nano ESP32 - machine_i2s: integrate new I2S IDF driver - add support for IDF version v5.0.5 - add support for IDF version v5.2 - add IDF-version-specific sdkconfig - mpconfigport: don't hang when machine.bootloader isn't supported - modmachine: support bootloader on ESP32-S2/S3/C2/C3 - network_lan: add a separate argument to set PHY power pin - machine_uart: always configure timeout_char setting in init() - boards/ESP32_GENERIC_S3: add 4MiB partitioning board variant - workaround IDF issue placing ISR ringbuf functions in IRAM - main: check if main GC heap allocation failed - network_wlan: add interface and security WLAN constants - modesp32: add mcu_temperature() function for C3/S2/S3 devices - panichandler: print support information on panic - add support for TCP_NODELAY mimxrt port: - mphalport: remove redundant NVIC/IRQ defines - mpbthciport: add missing extmod/modmachine.h header - boards: fix __VECTOR_TABLE link issue with CMSIS 5.9.0 - modmachine: fix deepsleep wakeup pin ifdef - fix header include guard names - mpconfigport: enable cryptolib and hashlib md5 - define the MICROPY_HW_ENABLE_USBDEV macro - set the security mode for the default WiFi AP - add support for OpenAMP minimal port: - allow compiling on macOS - use printf instead of echo -e nrf port: - modules/os/microbitfs: sweep the filesystem if any free chunk found - fix _start() build issue with CMSIS 5.9.0 - boards: add named pins for Arduino Nano 33 BLE - boards: enable MICROPY_HW_ENABLE_USBDEV on boards with USB CDC - Makefile: allow external board definitions - modules/machine: enable code formatting - fix non-running LFCLK - modules/machine: catch exceptions from pin interrupts - modules/machine/pwm: tag a PWM device as used in the constructor - main: fix build of microbit when SD is enabled - Makefile: clean up dangling LIBS declaration - mpconfigport: enable MICROPY_NLR_THUMB_USE_LONG_JUMP on nRF51xx pic16bit port: no changes specific to this component/port powerpc port: no changes specific to this component/port qemu-arm port: - mpconfigport: use MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES renesas-ra port: - ra: fix SysTick clock source - ra: remove unnecessary min_delay() declaration - boards/ARDUINO_PORTENTA_C33: fix the RTC clock source - ra/ra_i2c: fix 1 byte and 2 bytes read issue - fix spelling mistakes found by codespell - boards: add named pins for Arduino Portenta C33 - boards/ARDUINO_PORTENTA_C33: add Arduino's external library rp2 port: - rp2_flash: lockout second core only when doing flash erase/write - mutex_extra: implement additional mutex functions - mpthreadport: fix race with IRQ when entering atomic section - rp2_dma: fix fetching 'write' buffers for writing not reading - provide direct memory access to PIO and SPI FIFOs via proxy arrays - machine_uart: fix event wait in uart.flush() and uart.read() - mpconfigport: allow MICROPY_PY_THREAD to be disabled by a board - mpthreadport: make result of thread.get_ident() a non-zero integer - machine_uart: fix potential race condition in interrupt handling - boards/ARDUINO_NANO_RP2040_CONNECT: increase flash storage space - change machine.I2S and rp2.DMA to use shared DMA IRQ handlers - boards: add named digital pins for Arduino Nano RP2040 Connect - enable support for Python USB devices - CMakeLists: apply O2 optimisation to map, mpz and vm source code - modmachine: prevent lock-up when lightsleep() called within thread - README: fix typo, improve sentence about building with other boards - boards/W5500_EVB_PICO: update incorrect url in board.json samd port: - remove the MICROPY_PY_MACHINE_RTC config option - mcu/samd21: reorganize and enable more firmware features - mcu: fix wrong EIC table entries in pin-af-table.csv - mpconfigport: simplify and consolidate config options - mcu/samd21: enable MICROPY_STACK_CHECK on SAMD21 - enable support for Python USB devices - README: fix incorrect port directory name - boards: enable MICROPY_HW_DFLL_USB_SYNC on appropriate boards - mcu: update clock config after changes to USB - samd_spiflash: allow configuring the flash SPI baudrate - samd_qspiflash: avoid reading status byte 2 when not available - mcu: guard static function with appropriate #if stm32 port: - mboot: improve detection of invalid flash erase/write - mboot: improve mass erase to erase all non-protected pages - flash: remove commented-out flash functions - flash: simplify sector calculation for homogeneous flash layout - flash: change flash_erase to only erase a single sector at a time - flashbdev: don't rely on flash sector id - flash: factor and simplify erase code - flash: fix sector and bank calculation for H5 and H7 MCUs - mboot/Makefile: revert change to BOARD_DIR that removed abspath - disable qstr hashing on small boards - boards/ARDUINO_PORTENTA_H7: add pin configuration for SPI1 - modos: allow disabling MICROPY_PY_MACHINE_UART - spi: allow disabling MICROPY_PY_MACHINE_SPI - main: allow disabling MICROPY_PY_MACHINE - Makefile: ignore uninitialised variable warning in H5 HAL SD code - mboot: generate FLASH_LAYOUT_STR at runtime on H5 MCUs - mpbthciport: allow building with MICROPY_PY_MACHINE_UART disabled - sdram: support remapping FMC memory banks - network_lan: allow defining phy_addr in the LAN constructor - eth: remove redundant ETH clock enable code - network_lan: add the phy_type=x keyword option to network.LAN() - simplify D-cache clean and invalidate macros - mpu: rename MPU_CONFIG_DISABLE to MPU_CONFIG_NOACCESS - dma: add D-cache protection for DMA RX operations, including SPI - add support for dual-analog-pad "_C" pins on H7 MCUs - boards: add named digital and analog pins for Arduino boardrs - sdram: fix MPU config to use MPU_CONFIG_NOACCESS - mpu: add MPU config for shared, uncached memory region - implement port backend for libmetal - implement port backend for OpenAMP's remoteproc - boards/ARDUINO_GIGA: enable OpenAMP - boards/ARDUINO_NICLA_VISION: enable OpenAMP - boards/ARDUINO_PORTENTA_H7: enable OpenAMP - mboot: add support for a raw filesystem - boards/LEGO_HUB_NO6: move robust logic to mboot - boards/LEGO_HUB_NO6: use a raw filesystem for mboot to update fw - stm32.mk: enable _Float16 support on MCUs with hardware floats - boards/ARDUINO_GIGA: add Arduino's external library - boards/ARDUINO_NICLA_VISION: add Arduino's external library - boards/ARDUINO_PORTENTA_H7: add Arduino's external library - README: update list of supported STM32 series - set the security mode for the default WiFi AP - mpremoteprocport: use metal logging functions - boards/LEGO_HUB_NO6: write key after writing elements - boards/LEGO_HUB_NO7: add robust update logic to mboot - flash: fix writing final words to flash on H5 and H7 MCUs - mboot: buffer the correct amount of bytes for a flash write - i2c: fix clock enable for I2C4 on STM32F7 MCUs - pyb_can: fix STM32G4 FDCAN source clock frequency unix port: - variants: prefer unix-ffi packages when loading the manifest - input: flush the prompt after writing it to stdout - don't include system headers when features are disabled - variants: don't use native _Float16 type webassembly port: - Makefile: remove --memory-init-file from linker options - include lib in sys.path - move MP_JS_EPOCH init to library postset - implement MICROPY_PY_RANDOM_SEED_INIT_FUNC - enable time localtime, gmtime, time, time_ns - use POSIX write for output and add stderr - add support for enabling MICROPY_GC_SPLIT_HEAP_AUTO - clean up Makefile and add variant support - add JavaScript proxying, and js and jsffi modules - implement runPythonAsync() for top-level async code - implement runCLI() for a Node-based CLI - implement replInit() and replProcessChar() - variants/pyscript: add pyscript variant - update README.md to describe latest changes - library: fix formatting and style for Biome - proxy_c: ensure return value of async fun is passed to JS - proxy_js: promote Python thenable to a Promise - proxy_js: allow a Python proxy of a function to be undone - api: fix waiting for Emscripten module to be loaded - api: allocate code data on C heap when running Python code - objjsproxy: fix handling of thrown value into JS generator - proxy_c: fix proxy then reject handling - proxy_c: fix then-continue to convert reason to throw value - modjsffi: add jsffi.async_timeout_ms - add JavaScript-based asyncio support - api: inject asyncio.run if needed by the script - api: fix importing micropython.mjs module from node REPL - proxy_c: reject promises with a PythonError instance - proxy_c: only proxy across resolve/reject funs when needed - objjsproxy: fix proxying in arguments to JS new function - objpyproxy: implement JS iterator protocol for Py iterables - api: resolve thenables returned from runPythonAsync - proxy_c: support more than 4 args when JS calls Py func - asyncio: fix case where a Promise is resolved with no arg - proxy_c: ensure objs thrown into generators are exceptions - proxy_js: convert JS undefined and JS null to Py None - mpconfigport: enable importing of .mpy files - proxy_js: revert back to converting Py None to JS null - proxy_js: create a special "undefined" type for Python - proxy_c: return undefined if dict lookup failed on JS side - objjsproxy: make jsproxy_it keep ref to jsproxy - proxy_c: don't return value of a void function - track the current depth of calls to external C functions - set GC threshold and do top-level GC collect when possible - add C-level finaliser to JsProxy object - register PyProxy objects for JS-side finalisation - modjsffi: add mem_info function to get detailed stats windows port: - windows_mphal: fix mp_hal_delay_ms() so it runs events - Makefile: fix float exact int formatting on 32-bit mingw zephyr port: no changes specific to this component/port
a61c446
2024-05-31 12:19
下载
v1.22.2
Patch release for rp2 DMA, UART and BLE, esp32 BLE, renesas-ra I2C This is a patch release containing the following commits: - py/compile: fix potential Py-stack overflow in try-finally with return - extmod/asyncio: support gather of tasks that finish early - extmod/modssl_mbedtls: fix cipher iteration in SSLContext.get_ciphers - extmod/btstack: reset pending_value_handle before calling write-done cb - extmod/btstack: reset pending_value_handle before calling read-done cb - esp32/mpnimbleport: release the GIL while doing NimBLE port deinit - esp32: increase NimBLE task stack size and overflow detection headroom - mimxrt/modmachine: fix deepsleep wakeup pin ifdef - renesas-ra/ra: fix SysTick clock source - renesas-ra/boards/ARDUINO_PORTENTA_C33: fix the RTC clock source - renesas-ra/ra/ra_i2c: fix 1 byte and 2 bytes read issue - rp2/rp2_dma: fix fetching 'write' buffers for writing not reading - rp2/machine_uart: fix event wait in uart.flush() and uart.read() - rp2: change machine.I2S and rp2.DMA to use shared DMA IRQ handlers
8cd1582
2024-02-20 19:59
下载
v1.22.1
Patch release for rp2 atomic mutex This is a patch release to fix a race condition and potential deadlock in the rp2 port's mp_thread_begin_atomic_section() function, when the second core is in use.
9b8c64c
2024-01-05 09:33
下载
v1.23.0-preview
2037edb
2024-01-02 15:11
下载
v1.22.0
SSL support in asyncio, sorted qstr pools, common machine module bindings This release of MicroPython introduces SSL/TLS support to asyncio, for both the client and server sides. The interface matches CPython: `asyncio.open_connection()` and `asyncio.start_serve()` now both accept an `ssl` argument to supply an `SSLContext` object. As part of this, new methods were added to `SSLContext` to load certificates, and certificate date/time validation was enabled on all ports that use mbedTLS. Qstr pools are now sorted, which provides a significant performance boost for `qstr_find_strn()`, which is called a lot during parsing and loading of .mpy files, as well as interning of string objects, which happens in most string methods that return new strings. The static pool (part of the .mpy ABI) isn't currently sorted, but could be in the future. There have been many internal changes to the `machine` module (and on some ports the `os` module) to factor the Python bindings to a common location, reduce code duplication and make the API more consistent across all the ports. And a new `boardgen.py` script has been added to factor pin generation and enable a more consistent `machine.Pin` across ports. For consistency, the following user-facing changes have been made: - cc3200 port: The `machine` module gains `soft_reset()`, `mem8`, `mem16`, `mem32` and `Signal`; it loses `POWER_ON` (replaced by `PWRON_RESET`). `disable_irq()` now returns an (opaque) integer rather than a bool, and `enable_irq(state)` must be passed an argument which is the return value of `disable_irq()`, rather than a bool. In the `os` module, `dupterm()` has been converted to use the common implementation and has semantics the same as other ports, and `uname()` is removed to save space (sys.version and sys.implementation can be used instead). - esp32 port: In the `machine` module, `lightsleep()` and `deepsleep()` no longer take the `sleep` keyword argument, instead it's positional to match other ports. Also, passing 0 here will now do a 0ms sleep instead of acting like nothing was passed. And `reset_cause()` no longer accepts any arguments (before it would just ignore them). - esp8266 port: `machine.idle()` now returns None instead of the time elapsed. The `machine.WDT()` constructor now takes keyword arguments, and accepts the `timeout` argument but raises an exception if it's not the default value (this port doesn't support changing the timeout). - mimxrt port: `machine.freq()` now accepts an argument but raises `NotImplementedError`, and `machine.lightsleep()` has been added but also just raises `NotImplementedError` (this is to make these functions use an implementation common to the other ports). - nrf port: The `machine` module gains `unique_id()` (returns an empty bytes object), `freq()` (raises `NotImplementedError`) and `Signal`. `UART.sendbreak()` is removed, but this method previously did nothing. The `os.dupterm()` function has changed to match the semantics used by all other ports (except it's restricted to accept only `machine.UART` objects). - qemu-arm port: The `machine` module gains `soft_reset()` and `idle()`. - samd port: The `machine.deepsleep()` function now resets after sleeping. - unix port: Gains `machine.soft_reset()`. - zephyr port: The `machine` module gains `soft_reset()`, `mem8`, `mem16`, and `mem32`. The `UART` class gains the following methods: `init()` which supports setting `timeout` and `timeout_char`, `deinit()` which does nothing, `flush()` which raises `OSError(EINVAL)` because it's not implemented, and `any()` and `txdone()` which both raise `NotImplementedError`. The teensy port has been removed in this release. This port was largely unmaintained, had limited features (the only hardware support was for GPIO and timer, and no `machine` module), and only supported a small number of Teensy boards. A new preview versioning scheme has been introduced, whereby non-release builds are a preview of the next, upcoming release. This scheme is compatible with semver and should help to eliminate confusion matching documentation and firmware version numbers, among other things. Black has been replaced with ruff format as the Python code formatter. This required a few small changes to Python code, and now allows linting and formatting with ruff. Bound method instances now support comparison and hashing, matching CPython semantics. The .mpy sub-version has been updated from 6.1 to 6.2 due to a change in the native .mpy ABI. A new option `MICROPY_PREVIEW_VERSION_2` has been added which provides a way to enable features and changes slated for MicroPython 2.x, by running `make MICROPY_PREVIEW_VERSION_2=1`. This is an alternative to having a 2.x development branch, and any feature or change that needs to be "hidden" until 2.x will use this flag. LittleFS has been updated to v2.8.1. The associated MicroPython VfsLfs2 driver can read existing LFS2 filesystems, but any writes will update the filesystem to a newer LFS2 version that cannot be read by older drivers, so take this into account when updating, for example update mboot first. The VFS sub-system has a new file ioctl to set the read-buffer size, which is used by mpremote to significantly increase performance of the "mpremote mount" feature. Manifest files now allow registering an external library path via `add_library(name, path)`. `sys.stdout.buffer.write()` now returns the actual number of bytes written (although this is complicated when output goes to multiple destinations). The esp32 port has been updated to use IDF version 5.0.4, and the initial GC heap size tuned so that, after doubling the heap size, WiFi can still be started and an SSL connection made. `RMT.source_freq()` is now a class method, socket connect timeout has been implemented, RTC user memory is now preserved over most reset causes, and `hashlib.md5` enabled. The mimxrt port has RTC alarm/wakeup functionality added, along with support for `machine.deepsleep()`. The rp2 port sees the introduction of a new `rp2.DMA` class for control over DMA transfers. It has switched to use the same math library as other ports to get more accurate floating point behaviour, and enabled `os.dupterm_notify()` for WebREPL use. The TinyUSB stack is now scheduled to run from the IRQ handler (instead of polled in the VM) which slightly improves performance of the VM and USB. The port also makes better use of event scheduling and WFE to be more efficient. It also has added support for external ADC channels (for example when using the ninaw10 driver). The stm32 port has improved support for STM32H5xx MCUs, including Ethernet support, frequency scaling with HSI, sleep mode and SD card support. The NUCLEO_WL55 board now freezes in the LoRa driver, the I2S driver has improved accuracy of the clock frequency, and mboot now supports Microsoft WCID to set the USB driver. New boards added in this release are: UM_TINYWATCHS3 (esp32 port), POLOLU_3PI_2040_ROBOT, POLOLU_ZUMO_2040_ROBOT and SIL_RP2040_SHIM (rp2 port), NUCLEO_H563ZI (stm32 port). The change in code size since the previous release for various ports is (absolute and percentage change in the text section): bare-arm: +216 +0.381% minimal x86: +624 +0.340% unix x64: +8283 +1.050% stm32: +1368 +0.350% cc3200: +1184 +0.649% esp8266: +800 +0.114% esp32: +35348 +2.100% mimxrt: +2172 +0.602% renesas-ra: +96 +0.015% nrf: +1460 +0.785% rp2: +6100 +1.880% samd: +1476 +0.568% The changes that dominate these numbers are: - bare-arm, minimal: comparing and hashing bound methods, sorted qstr pools - unix: updating LittleFS to 2.8.1, enabling certificate date/time validation, adding SSLContext certificate methods, asyncio SSL support - stm32: sorted qstrs, updating LittleFS to 2.8.1, I2S clock frequency improvements, asyncio SSL support - cc3200: sorted qstrs, more machine module functions, use of the common `os.dupterm` implementation - esp32: switching ESP-IDF from 5.0.2 to 5.0.4 - esp8266: updating LittleFS to 2.8.1 - mimxrt: adding RTC alarm/wakeup functionality, updating LittleFS to 2.8.1, asyncio SSL support - nrf: updating LittleFS to 2.8.1, enabling `machine.Signal`, asyncio SSL support - rp2: using locally-provided math library, adding new `rp2.DMA` class - samd: sorted qstrs, updating LittleFS to 2.8.1, asyncio SSL support With the new sorted qstr pools, performance is significantly improved for qstr-heavy operations, between +50% and +200% improvement. Other areas have their performance unchanged since the last release. Thanks to everyone who contributed to this release: Alessandro Gatti, Andrew Leech, Angus Gratton, Carlosgg, Christian Walther, Damien George, Daniël van de Giessen, Elias Wimmer, Glenn Moloney, iabdalkader, Ihor Nehrutsa, Jeff Epler, Jim Mussared, Kwabena W. Agyeman, Maarten van der Schrieck, Mark Blakeney, Mathieu Serandour, Matthias Urlichs, MikeTeachman, Ned Konz, Nicko van Someren, Pascal Brunot, Patrick Van Oosterwijck, Paul Grayson, Peter Züger, Rene Straub, robert-hh, Scott Zhao, Sebastian Romero, Seon Rozenblum, stijn, Thomas Ackermann, Thomas Wenrich, ThomHPL, Trent Piepho. Contributions were made from the following timezones: -0800, -0700, -0600, -0500, +0000, +0100, +0200, +1000, +1100. The work done in this release was funded in part through GitHub Sponsors, and in part by George Robotics, Planet Innovation, Espressif, Arduino, LEGO Education and OpenMV. What follows is a detailed list of changes, generated from the git commit history, and organised into sections. Main components =============== all: - switch to new preview build versioning scheme - replace "black" with "ruff format" - update Python formatting to ruff-format py core: - vm: don't emit warning when using "raise ... from None" - builtinevex: handle invalid filenames for execfile - objboundmeth: support comparing and hashing bound methods - objboundmeth: optimise check for types in binary_op - obj: generalise mp_get_buffer so it can raise if a flag is set - dynruntime: add mp_get_buffer - persistentcode: bump .mpy sub-version - modthread: initialise nlr_jump_callback_top on threads - makeqstrdefs.py: print a nicer error when preprocessing stage fails - mkrules.mk: add MICROPY_PREVIEW_VERSION_2 - asm: remove unused asm helper macros - qstr: add support for sorted qstr pools - mkrules.mk: add rule for compiling auto-generated source files - runtime: remove declaration of function from inside function - lexer: change token position for new lines - misc: change sizeof to offsetof for variable-length alloc - qstr: special case qstr_find_strn for empty string - obj: fix mp_obj_is_type compilation with C++ - objslice: validate that the argument to indices() is an integer - mkrules: add support for custom manifest variables - modbuiltins: share vstr_add_char's implementation of utf8 encoding - mphal: move configuration of ATOMIC_SECTION macros to mphal.h - add port-agnostic inline functions for event handling - modsys: implement optional sys.intern - mkrules.mk: list hash files as byproducts - makeqstrdefs.py: don't skip output for stale hash file - makeqstrdefs.py: stop generating temporary intermediate file - gc: improve calculation of new heap size in split-heap-auto mode - mkrules.mk: fix dependency file generation for compiler wrappers extmod: - moductypes: validate that uctypes.struct addr argument is an int - asyncio: emit errors to stderr, not stdout - modframebuf: validate FrameBuffer bounds against input buffer - modframebuf: fix FrameBuffer get-buffer implementation - modframebuf: remove FrameBuffer1 from natmod build - vfs_posix: fix relative root path - vfs_posix: fix accidentally passing tests - vfs_posix: fix relative paths on non-root VFS - vfs_posix: fix getcwd() on non-root VFS - vfs_posix: additional tests for coverage of error cases - network_ninaw10: raise an error if nina_ioctl fails - machine_wdt: factor ports' WDT Python bindings to common code - machine_pwm: remove header file and move decls to .c file - machine_i2s: factor ports' I2S Python bindings to common code - machine_i2s: factor stream and ring-buf code - machine_i2s: factor I2S.shift method - machine_i2s: factor I2S.irq method - machine_i2s: factor print function - machine_i2s: factor init_helper argument parsing - machine_i2s: factor comments, some enums and macros - machine_adc: factor ports' ADC Python bindings to common code - machine_uart: factor ports' UART Python bindings to common code - modmachine: clean up decls of machine types to use common ones - modmachine: consolidate simple machine headers into modmachine.h - modmachine: consolidate mem, i2c and spi headers to modmachine.h - network_ninaw10: fix select flags handling in socket poll - remove empty utime_mphal.h file - machine_adc_block: factor esp32 ADCBlock bindings to common code - machine_i2c: do a fast poll during I2C.scan() - vfs_reader: add file ioctl to set read buffer size - modbluetooth: initialise nlr_jump_callback_top for IRQ handlers - vfs_posix_file: make standard file objects non-const - extmod.mk: allow enabling lwip loopback support - modmachine: make I2C/SPI defns available when soft impl enabled - modmachine: factor ports' machine module dict to common code - modmachine: provide common Python bindings for machine.idle() - modmachine: add MICROPY_PY_MACHINE_PIN_BASE option - modmachine: provide common Python bindings for bootloader() - modmachine: provide common bindings for 6 bare-metal functions - modmachine: provide common implementation of disable/enable_irq - mbedtls: enable certificate time/date validation by default - modnetwork: add deinit function to NIC protocol - network_ninaw10: switch to using soft-timer for polling - switch to use new event functions - add lists of libm/libm_dbl source files for ports to use - modssl_mbedtls: add SSLContext certificate methods - modssl_mbedtls: make SSLSocket.getpeercert() optional - modssl_mbedtls: fix parsing of ciphers in set_ciphers method - asyncio: add ssl support with SSLContext - modonewire: adopt Maxim recommended read timings - modonewire: improve write timings for better reliability - modos: factor os.dupterm_notify() function to common extmod code - os_dupterm: prevent recursive execution of mp_os_dupterm_rx_chr - asyncio: remove non-working Stream __aenter__/__aexit__ methods - modselect: handle growing the pollfds allocation correctly - modhashlib: support MD5 with mbedtls 3.x - os_dupterm: let mp_os_dupterm_tx_strn() return num bytes written - vfs_lfs: fix lfs cache_size calculation - nimble: do not set GAP device name after sync shared: - libc/string0: don't deref args for n==0 case - tinyusb: schedule TinyUSB task function from dcd_event_handler - tinyusb: expose mp_usbd_task as a public function - tinyusb: add a helper for hex string conversion - runtime/softtimer: generalise soft_timer to work without SysTick drivers: - ninaw10: add ioctl for reading analog pins - ninaw10: add support for external ADC channels mpy-cross: no changes specific to this component/port lib: - littlefs: update LittleFS to v2.8.1 - uzlib: for matches of the same length, take the closest one - mbedtls_errors: update error list for latest esp32 mbedtls - micropython-lib: update submodule to latest Support components ================== docs: - reference/mpyfiles: document change in .mpy sub-version - library/io: remove io.FileIO and io.TextIOWrapper - reference/micropython2_migration: add migration guide - mimxrt: change the examples which denote a Pin with a number - samd: fix the pinout for SAMD21 Itsy Bitsy Express M0 - library/esp: correct the description of esp.osdebug() - esp32/quickref: add DAC example - library: document SSLContext cert methods and asyncio support examples: - pins.py: remove this pins printing example tests: - basics/boundmeth1.py: add tests for bound method equality/hash - perf_bench: add string/qstr/map tests - extmod/asyncio_as_uasyncio.py: fix qstr order dependency - net_hosted/asyncio_loopback.py: add loopback test - extmod/deflate_compress.py: add a test for optimal compression - float/inf_nan_arith.py: include -inf in argument combos - run-tests.py: skip Thumb2 tests if target doesn't support them - update SSL network tests to use SSLContext, and work on CPython tools: - ci.sh: ensure enough commits are fetched for a common ancestor - boardgen.py: add initial implementation of a common make-pins.py - tinytest-codegen.py: externalise tests list - mpremote: add ioctl to specify large read buffer size - ci.sh: build ESP32_GENERIC-SPIRAM as part of esp32 CI - ci.sh: set `ulimit -n` for unix CI - manifestfile.py: add support for external libraries CI: - workflows: pin ruff to 0.1.0 and change flags for new version - workflows: cache ESP-IDF checkout and installation - workflows: use build matrix for esp32 port - workflows: enable build matrix for stm32 port - workflows: enable ccache for esp32 build - workflows: bump actions/github-script from 6 to 7 - workflows: bump actions/setup-python from 4 to 5 - workflows: bump actions/upload-artifact from 3 to 4 The ports ========= all ports: - make all ports skip execution of main.py if boot.py fails - remove SRC_QSTR_AUTO_DEPS from all ports' Makefiles - standardise arguments and output for make-pins.py script - fix incorrect identifiers on Arduino boards - move definitions of ATOMIC_SECTION macros to mphalport.h - switch build to use common lib/libm list of source files - fix sys.stdout.buffer.write() return value bare-arm port: - lib: add minimal strncmp implementation cc3200 port: - boards/make-pins.py: don't generate qstrs - boards/make-pins.py: add a note about tools/boardgen.py - mods/modmachine: use common implementation of disable/enable_irq - convert dupterm to use common extmod implementation - convert os module to use extmod version - eliminate dependency on stm32's irq.h - application.mk: don't add stm32 to build include path embed port: no changes specific to this component/port esp8266 port: - rename MICROPY_ESPNOW to MICROPY_PY_ESPNOW - machine_spi: rename machine_hspi to machine_spi - esp_mphal: make atomic section more atomic - modmachine: use common implementation of disable/enable_irq - avoid including ep_mphal.h directly - update port to use new event functions esp32 port: - rename MICROPY_ESPNOW to MICROPY_PY_ESPNOW - boards: update UM board image names for consistency - boards/UM_TINYWATCHS3: add new UM TinyWATCH S3 board - boards: update UM board settings to use custom PID/VID - network_ppp: allow building with IPv6 disabled - poll serial/JTAG for unread data to prevent blocking - mpconfigport: remove port-specific GAP name - machine_uart: add error checking for IDF API's - network_ppp: reduce PPP thread CPU usage - boards: disable ALPN support - network_lan: fix and simplify the code for ETH-SPI devices - network_lan: fix LAN.isconnected() - network_lan: register the hostname setting for Ethernet - modmachine: fix deepsleep() when previous sleep delay was set - boards: reduce size of D2WD and OTA firmware - use better build settings for ESP32-C3 - mphalport: add function to wake main from separate FreeRTOS task - usb: wake main thread when USB receives data - machine_pin: make irq object a sub-field of pin object - esp32_rmt: change RMT.source_freq() to class method - esp32_rmt: add RMT.PULSE_MAX constant - modsocket: implement socket connect timeout - modsocket: try garbage collection if the socket limit is reached - boards/sdkconfig.base: fix increasing log level via esp.osdebug() - boards/ESP32_GENERIC: reduce size of D2WD variant to fit in flash - uart: preserve console UART clock, fix UART console with DFS - uart: make compatible with sclk type change in ESP-IDF 5.3 - network_wlan: reduce RAM usage if SPIRAM fails to initialise - network_wlan: fix network.WLAN.status() to return better info - esp32_rmt: fix RMT looping - enable mbedtls cert time validation - boards: enable further IRAM saving opts to fit ESP32-SPIRAM fw - machine_rtc: preserve RTC user memory over most reset causes - boards/UM_TINYPICO: fix typo in baudrate instructions - boards/sdkconfig.base: disable unused mbedtls options - machine_i2c: use APB_CLK_FREQ instead of I2C_APB_CLK_FREQ - modnetwork: add WiFi AUTH_WPA3_ENT_192 authenticate mode - machine_dac: support one-shot mode of driver - modmachine: fix deprecated esp_pm_config_XXX_t - machine_i2s: fix deprecated fields and constants - mpconfigport: keep some funcs out of IRAM for ESP32-SPIRAM builds - boards/ESP32_GENERIC: disable network.LAN and VM-opt on D2WD - change minimum supported IDF version to v5.0.4 - re-enable custom mbedtls error string tables - add MICROPY_GC_INITIAL_HEAP_SIZE option and tune it - mpconfigport: enable MICROPY_PY_HASHLIB_MD5 mimxrt port: - led: fix LED init call from main, and simplify led_init - boards: define missing SNVS pins for all processors - machine_rtc: add RTC alarm/wakeup functionality - modmachine: add support for machine.deepsleep - boards/make-pins.py: update to use tools/boardgen.py - modmachine: fix settings for the MIMXRT1170 board - boards/OLIMEX_RT1010: adjust the UART pin assignment minimal port: no changes specific to this component/port nrf port: - boards: automatically configure MICROPY_PY_MACHINE_PWM - modules/machine: use SPI Python bindings provided by extmod - boards/make-pins.py: don't generate qstrs - boards/make-pins.py: add a note about tools/boardgen.py - use MICROPY_PY_MACHINE_SPI instead of MICROPY_PY_MACHINE_HW_SPI - use dupterm_objs[0] instead of board_stdio_uart - convert os module to use extmod version - mpconfigport: enable MICROPY_PY_MACHINE_BOOTLOADER - boards/ARDUINO_NANO_33_BLE_SENSE: don't enable MICROPY_MBFS - main: add /flash and /flash/lib to sys.path pic16bit port: no changes specific to this component/port powerpc port: no changes specific to this component/port qemu-arm port: no changes specific to this component/port renesas-ra port: - boards/make-pins.py: don't generate qstrs - boards/make-pins.py: update to use tools/boardgen.py - boards/ARDUINO_PORTENTA_C33: fix incorrect I2C pins - consolidate MICROPY_PY_MACHINE_I2C option rp2 port: - cyw43_configport: use m_tracked_calloc and m_tracked_free - machine_adc: add support for external ADC channels - boards/ARDUINO_NANO_RP2040_CONNECT: add external analog pins - boards/make-pins.py: don't generate qstrs - machine_uart: fix handling of serial break condition - machine_adc: refactor channel/pin validation code - remove 1ms timeout to make idle waiting tickless - change to use TinyUSB dcd_event_handler hook - mphalport: run TinyUSB stack while waiting for CDC input/output - integrate soft_timer using the alarm pool - mpbthciport: rework HCI polling timer to use soft_timer - mpnetworkport: rework lwIP polling to use soft_timer - mphalport: optimise exit of mp_hal_delay_ms loop - cyw43_configport: implement cyw43_delay_ms as mp_hal_delay_ms - switch to locally provided math library - switch rp2 and drivers to use new event functions - main: enable SEVONPEND CPU interrupt bit - mpconfigport: enable MICROPY_PY_OS_DUPTERM_NOTIFY - add new NO_DEFAULT_PINS config options for i2c, spi, and uart - boards: add support for Pololu 3pi+ and Zumo robots - boards: add SIL_RP2040_SHIM board by Silicognition LLC - rp2_dma: introduce a new rp2.DMA class for control over DMA xfers samd port: - boards/make-pins.py: update to use tools/boardgen.py - mpconfigport: set MICROPY_USE_INTERNAL_ERRNO to 1 - machine_uart: add machine_uart_set_baudrate() function - pin_af: fix a typo in a conditional compile - switch TinyUSB to run via a scheduled task - mphalport: run TinyUSB stack while waiting for CDC input/output - switch to shared TinyUSB implementation - use unique id for USB serial number stm32 port: - boards/ARDUINO_GIGA: add QSPI fix/workaround to early init - boards/ARDUINO_GIGA: fix name of pins in board init - eth: add Ethernet support for H5 MCUs - boards/STM32H573I_DK: enable ETH and DAC peripherals - powerctrl: add support for frequency scaling with HSI on H5 MCUs - boards/make-pins.py: don't generate qstrs - boards: fix errors in pins.csv and af.csv - boards: format stm32 alternate function csv files - rename pin_obj_t to machine_pin_obj_t - boards/make-pins.py: update to use tools/boardgen.py - boards/make-pins.py: add initial support for H7 dual-pad pins - add configuration options for analog switches - add STM32H5 support for sleep mode - boards/make-pins.py: fix H7 ADC generation - boards/stm32f4x9_af.csv: fix DCMI_VSYNC - boards/stm32g474_af.csv: fix final row ADC column - boards/make-pins.py: only support ADC1-3 - boards/NUCLEO_WL55: freeze LoRa driver - mpu: enable STM32WB mpu use to support qspi flash - add optional lwip loopback support - boards/NUCLEO_F446RE: add UARTs 1, 3 and 4 - boards/NUCLEO_H563ZI: add new NUCLEO-H563ZI board definition - sdcard: add SD card support for H5 MCUs - boards/STM32H573I_DK: enable the SD card - add missing header include for debug builds - modmachine: only enable machine.I2C if hardware I2C is enabled - usbd_cdc_interface: include header to get machine_bootloader decl - machine_i2s: improve accuracy of SCK frequency - usbdev: optionally pass through vendor requests to Setup function - mboot: guard use of tx_pending with USE_USB_POLLING option - mboot: expand device descriptor to make it easier to understand - mboot: add support for Microsoft WCID teensy port: - remove the teensy port unix port: - mbedtls: enable mbedtls cert time validation - update port to use the new event functions webassembly port: no changes specific to this component/port windows port: - use the MicroPython logo as application icon - implement MICROPY_INTERNAL_WFE() macro zephyr port: no changes specific to this component/port
9feb068
2023-12-27 12:35
下载
v1.22.0-preview
69e34b6
2023-10-04 08:20
下载
v1.21.0
内容可能含有违规信息
e00a144
2023-10-06 07:32
下载
下载
请输入验证码,防止盗链导致资源被占用
取消
下载
1
https://gitee.com/mirrors/micropython.git
git@gitee.com:mirrors/micropython.git
mirrors
micropython
micropython
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册