MyGit

v1.22.0

micropython/micropython

版本发布时间: 2023-12-27 20:58:56

micropython/micropython最新发布版本:v1.22.2(2024-02-20 20:36:21)

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:

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:

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:

py core:

extmod:

shared:

drivers:

mpy-cross: no changes specific to this component/port

lib:

Support components

docs:

examples:

tests:

tools:

CI:

The ports

all ports:

bare-arm port:

cc3200 port:

embed port: no changes specific to this component/port

esp8266 port:

esp32 port:

mimxrt port:

minimal port: no changes specific to this component/port

nrf port:

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:

rp2 port:

samd port:

stm32 port:

teensy port:

unix port:

webassembly port: no changes specific to this component/port

windows port:

zephyr port: no changes specific to this component/port

相关地址:原始地址 下载(tar) 下载(zip)

1、 micropython-1.22.0.tar.xz 77.67MB

2、 micropython-1.22.0.zip 165.29MB

查看:2023-12-27发行的版本