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:
Pin.toggle()
methodPin.toggle()
, allowfunction.__code__
and function constructorsys.implementation._build
,next()
, no-argument vfs.mount()
function.__code__
and functionPerformance 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.
py core:
extmod:
shared:
drivers:
mpy-cross: no changes specific to this component/port
lib:
docs:
examples:
tests:
tools:
CI:
all ports:
alif port:
bare-arm port: no changes specific to this component/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:
powerpc port: no changes specific to this component/port
qemu port:
renesas-ra port:
rp2 port:
global
statement from example codesamd port:
stm32 port:
unix port:
webassembly port: no changes specific to this component/port
windows port:
zephyr port:
Patch release for mpremote, rp2 IGMP, esp32 PWM, SDCard, and AP channel
This is a patch release containing the following commits:
Patch release for rp2 DMA, UART and BLE, esp32 BLE, renesas-ra I2C
This is a patch release containing the following commits:
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.
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:
os.dupterm
implementationmachine.Signal
, asyncio SSLrp2.DMA
classWith 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.
all:
py core:
extmod:
shared:
drivers:
mpy-cross: no changes specific to this component/port
lib:
docs:
examples:
tests:
tools:
ulimit -n
for unix CICI:
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
Bug fix for esp32 SoftI2C
This is a bug fix release. The changes are:
extmod/machine_i2c: only use WRITE1 option if transfer supports it
This fixes the machine.SoftI2C.readfrom_mem() method on esp32, so it
writes the address to read from.
Boosted performance, board.json metadata, more mimxrt, rp2, samd features
This release of MicroPython sees a boost to the overall performance of the
VM and runtime. This is achieved by the addition of an optional cache to
speed up general hash table lookups, as well as a fast path in the VM for
the LOAD_ATTR opcode on instance types. The new configuration options are
MICROPY_OPT_MAP_LOOKUP_CACHE and MICROPY_OPT_LOAD_ATTR_FAST_PATH. As part
of this improvement the MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE option has
been removed, which provided a similar map caching mechanism but with the
cache stored in the bytecode, which made it not useful on bare metal ports.
The new mechanism is measured to be at least as good as the old one,
applies to more map lookups, has a constant RAM overhead, and applies to
native code as well as bytecode.
These performance options are enabled on the esp32, mimxrt, rp2, stm32 and
unix ports. For esp32 and mimxrt some code is also moved to RAM to further
boost performance. On stm32, performance increases by about 20% for
benchmarks that are heavy on name lookups, like misc_pystone.py and
misc_raytrace.py. On esp32 performance can increase by 2-3x, and on mimxrt
it is up to 6x.
All boards in all ports now have a board.json metadata file, which is used
to automatically build firmware and generate a webpage for that board
(among other possibilities). Auto-build scripts have been added for this
purpose and they build all esp32, mimxrt, rp2, samd and stm32 boards. The
generated output is available at https://micropython.org/download.
Support for FROZEN_DIR and FROZEN_MPY_DIR has been deprecated for some time
and was finally removed in this release. Instead of these, FROZEN_MANIFEST
can be used. The io.resource_stream() function is also removed, replaced
by the pure Python version in micropython-lib.
The search order for importing frozen Python modules is now controlled by
the ".frozen" entry in sys.path. This string is added by default in the
second position in sys.path. User code should adjust sys.path depending on
the desired behaviour. Putting ".frozen" first in sys.path will speed up
importing frozen modules.
A bug in multiple precision integers with bitwise of -0 was fixed in commit
2c139bbf4e5724ab253b5b034ce925e04267a9c4.
The platform module has been added to allow querying the compiler and
underlying SDK/HAL/libc version. This is enabled on esp32, mimxrt and
stm32 ports.
The mpremote tool now supports seek, flush, mkdir and rmdir on PC-mounted
filesystems. And a help command has been added.
The documentation has seen many additions and improvements thanks (for a
second time) to the Google Season of Docs project. The rp2 documentation
now includes a reference for PIO assembly instructions, a PIO quick
reference and a PIO tutorial. The random and stm modules have been
documented, along with sys.settrace, manifest.py files and mpremote. There
is also now more detail about the differences between MicroPython and
standard Python 3.5 and above.
The esp32 port sees support for ESP32-S3 SoCs, and new boards GENERIC_S3,
ESP32_S2_WROVER, LOLIN_S2_MINI, LOLIN_S2_PICO and UM_FEATHERS2NEO. The PWM
driver has been improved and now supports all PWM timers and channels, and
the duty_u16() and duty_ns() methods, and it keeps the duty constant when
changing frequency. The machine.bitstream() function has been improved to
use RMT, with an option to select the original bit-banging implementation.
The mimxrt port gained new hardware features: SDRAM and SD card support, as
well as network integration with a LAN driver. The machine.WDT class was
added along with the machine.reset_cause(), machine.soft_reset(),
machine.unique_id() add machine.bitstream() functions. DHT sensor support
was added, and f-strings were enabled.
The rp2 port now has support for networking, and bluetooth using NimBLE.
The Nina-W10 WiFi/BT driver is fully integrated and supported by the new
Arduino Nano RP2040 connect board. I2S protocol support is added along
with a machine.bitstream() driver and DHT sensor support. The PWM driver
had a bug fix with the accuracy of setting/getting the frequency, and the
duty value is now retained when changing the frequency.
On the samd port there is now support for the internal flash being a block
device, and for filesystems and the os module. Pin and LED classes have
been implemented. There are more time functions, more Python features
enabled, and the help() function is added. SEEED_WIO_TERMINAL and
SEEED_XIAO board definitions are now available.
The stm32 port now has support for F427, F479 and H7A3(Q)/H7B3(Q) MCUs, and
new board definitions for VCC_GND_H743VI, OLIMEX_H407, MIKROE_QUAIL,
GARATRONIC_PYBSTICK26_F411, STM32H73B3I_DK. A bug was fixed in the SPI
driver where a SPI transfer could fail if the CYW43 WiFi driver was also
active at the same time.
On the windows port the help() function has been enabled, and support for
build variants added, to match the unix port.
The zephyr port upgraded Zephyr to v2.7.0.
The change in code size since the previous release for various ports is
(absolute and percentage change in the text section):
bare-arm: -1520 -2.605%
minimal x86: -2256 -1.531%
unix x64: -457 -0.089%
unix nanbox: -925 -0.204%
stm32: +312 +0.079% PYBV10
cc3200: -176 -0.096%
esp8266: +532 +0.076% GENERIC
esp32: +27096 +1.820% GENERIC
nrf: -212 -0.121% pca10040
rp2: +9904 +2.051% PICO
samd: +35332 +33.969% ADAFRUIT_ITSYBITSY_M4_EXPRESS
The changes that dominate these numbers are:
Thanks to everyone who contributed to this release: Alan Dragomirecký,
Alexey Shvetsov, Andrew Leech, Andrew Scheller, Antoine Aubert, Boris
Vinogradov, Chris Boudacoff, Chris Fiege, Christian Decker, Damien George,
Daniel Gorny, Dave Hylands, David Michieli, Emilie Feral, Frédéric Pierson,
gibbonsc, Henk Vergonet, iabdalkader, Ihor Nehrutsa, Jan Hrudka, Jan Staal,
jc_.kim, Jim Mussared, Jonathan Hogg, Laurens Valk, leo chung, Lorenzo
Cappelletti, Magnus von Wachenfeldt, Matt Trentini, Matt van de Werken,
Maureen Helm, Michael Bentley, Michael Buesch, Mike Causer, Mike Teachman,
Mike Wadsten, Ned Konz, NitiKaur, oli, patrick, Patrick Van Oosterwijck,
Peter Boin, Peter Hinch, Peter van der Burg, Philipp Ebensberger, Pooya
Moradi, retsyo, robert-hh, roland van straten, Scott Armitage, Sebastian
Wicki, Seon Rozenblum, Sergei Silnov, Simon Baatz, Stewart Bonnick, stijn,
Tobias Thyrrestrup, Tomas Vanek, YoungJoon Chun.
What follows is a detailed list of changes, generated from the git commit
history, and organised into sections.
all:
py core:
extmod:
shared:
drivers:
mpy-cross: no changes specific to this component/port
lib:
docs:
period
and callback
argsexamples: no changes specific to this component/port
tests:
tools:
CI:
all ports:
bare-arm port:
cc3200 port: no changes specific to this component/port
esp8266 port:
esp32 port:
javascript port: no changes specific to this component/port
mimxrt port:
minimal 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
rp2 port:
samd port:
stm32 port:
teensy port:
unix port:
windows port:
zephyr port:
F-strings, new machine.I2S class, ESP32-C3 support and LEGO_HUB_NO6 board
This release of MicroPython adds support for f-strings (PEP-498), with a
few limitations compared to normal Python. F-strings are essentially
syntactic sugar for "".format() and make formatting strings a lot more
convenient. Other improvements to the core runtime include pretty printing
OSError when it has two arguments (an errno code and a string), scheduling
of KeyboardInterrupt on the main thread, and support for a single argument
to the optimised form of StopIteration.
In the machine module a new I2S class has been added, with support for
esp32 and stm32 ports. This provides a consistent API for transmit and
receive of audio data in blocking, non-blocking and asyncio-based
operation. Also, the json module has support for the "separators" argument
in the dump and dumps functions, and framebuf now includes a way to blit
between frame buffers of different formats using a palette. A new,
portable machine.bitstream function is also added which can output a stream
of bits with configurable timing, and is used as the basis for driving
WS2812 LEDs in a common way across ports.
There has been some restructuring of the repository directory layout, with
all third-party code now in the lib/ directory. And a new top-level
directory shared/ has been added with first-party code that was previously
in lib/ moved there.
The docs have seen further improvement with enhancements and additions to
the rp2 parts, as well as a new quick reference for the zephyr port.
The terms master/slave have been replaced with controller/peripheral,
mainly relating to I2C and SPI usage. And u-module references have been
replaced with just the module name without the u-prefix to help clear up
the intended usage of modules in MicroPython.
For the esp8266 and esp32 ports, hidden networks are now included in WLAN
scan results. On the esp32 the RMT class is enhanced with idle_level and
write_pulses modes. There is initial support for ESP32-C3 chips with
GENERIC_C3 and GENERIC_C3_USB boards.
The javascript port has had its Makefile and garbage collector
implementation reworked so it compiles and runs with latest the Emscripten
using asyncify.
The mimxrt port sees the addition of hardware I2C and SPI support, as well
as some additional methods to the machine module. There is also support
for Hyperflash chips.
The nrf port now has full VFS storage support, enables source-line on
traceback, and has .mpy features consistent with other ports.
For the rp2 port there is now more configurability for boards, and more
boards added.
The stm32 port has a new LEGO_HUB_NO6 board definition with detailed
information how to get this LEGO Hub running stock MicroPython. There is
also now support to change the CPU frequency on STM32WB MCUs. And USBD_xxx
descriptor options have been renamed to MICROPY_HW_USB_xxx.
Thanks to everyone who contributed to this release: Amir Gonnen, Andrew
Scheller, Bryan Tong Minh, Chris Wilson, Damien George, Daniel Mizyrycki,
David Lechner, David P, Fernando, finefoot, Frank Pilhofer, Glenn Ruben
Bakke, iabdalkader, Jeff Epler, Jim Mussared, Jonathan Hogg, Josh Klar,
Josh Lloyd, Julia Hathaway, Krzysztof Adamski, Matúš Olekšák, Michael
Weiss, Michel Bouwmans, Mike Causer, Mike Teachman, Ned Konz, NitiKaur,
oclyke, Patrick Van Oosterwijck, Peter Hinch, Peter Züger, Philipp
Ebensberger, robert-hh, Roberto Colistete Jr, Sashkoiv, Seon Rozenblum,
Tobias Thyrrestrup, Tom McDermott, Will Sowerbutts, Yonatan Goldschmidt.
What follows is a detailed list of changes, generated from the git commit
history, and organised into sections.
all:
py core:
extmod:
lib:
drivers:
mpy-cross:
docs:
examples: no changes specific to this component/port
tests:
tools:
CI:
all ports:
bare-arm port: no changes specific to this component/port
cc3200 port: no changes specific to this component/port
esp8266 port:
esp32 port:
javascript port:
mimxrt port:
minimal 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
rp2 port:
samd port:
stm32 port:
teensy port: no changes specific to this component/port
unix port:
windows port:
zephyr port:
New mpremote tool, and the mimxrt port gets Pin, ADC, UART, RTC and VFS
This release of MicroPython includes a new command-line tool called
"mpremote", which is intended to be the main way to remotely control a
MicroPython-based device from the command line. It features a serial
terminal, filesystem access, support to mount a local directory on the
remote device, and a macro language to define custom commands. This tool
can be installed from PyPI via "pip3 install mpremote", and it works on
Linux, Windows and Mac. As part of this, improvements were made to
pyboard.py including opening serial ports in exclusive mode to more easily
manage multiple devices.
In the Python core, OSError exceptions now support the ".errno" attribute,
and an option was added to compile MicroPython without error messages to
further reduce code size where needed. The REPL was improved so that it
does not tab-complete private methods (those starting with underscore, if
no underscore has been typed yet), and it also now tab completes built-in
module names after "import" is typed.
There has been a minor breaking change to a relative import exception: what
was previously a ValueError was changed to ImportError, following the same
change in CPython. See commit 53519e322a5a0bb395676cdaa132f5e82de22909.
In the extmod components, uctypes has a fix for the size and offset
calculation for ARRAY of FLOAT32, uhashlib now raises an exception if a
hash is reused after digest is called, and urandom supports passing 0 to
getrandbits (following the CPython change). In uasyncio, the readinto
method is added to the Stream class, and two race conditions were fixed:
one with start_server and wait_closed, and the other with cancelling a
task waiting on finished task; see de2e081260395f47d21bf39a97f3461df3d8b94f
and 514bf1a1911ac9173a00820b7e09dfb387e6b941 respectively.
The esp32 port now supports specifying FROZEN_MANIFEST with new CMake build
system, has NeoPixel support on GPIO32 and GPIO33, network.LAN support in
IDF v4.1 and above, and a new "reconnects" option in the WLAN STA interface
to configure how many (if any) reconnection attempts are made if the WiFi
goes down.
Many features have been added to the mimxrt port, including: VFS filesystem
support with internal flash storage, Pin, Pin.irq and ADC support, UART,
SoftI2C and SoftSPI bus support, Timer and RTC classes, and floating point
numbers.
The rp2 port now has the machine.RTC class to configure the RTC, as well as
new board definition files for SparkFun's Thing Plus RP2040 and Pro Micro
boards.
The stm32 port now supports static soft timers with a C-based callback, and
mboot has been made more configurable, in particular the LEDs and reset
mode selection can now be fully customised by a board. Two new boards have
been added: VCC_GND_F407VE and VCC_GND_F407ZG. A bug fix was made to the
SDIO driver to make sure DMA doesn't turn off mid-transfer; this affected
WLAN operation when certain SPI buses were being used. See commit
a96afae90f6e5d693173382561d06e583b0b5fa5 for details. Pin configuration of
UART has been modified so pull-up is now configured only on RX and CTS, not
TX and RTS; see 748339b28126e69fd2dc2778b2a182901d0a4693. The USB_VCP
class has a new irq method to set a callback on USB data RX events. The
Ethernet driver now supports low-power mode, and has a fix so the link
status is reported correctly.
On the zephyr port, scheduled callbacks are now run at idle REPL and during
sleeps, and there is an initial ubluetooth module which supports BLE
scanning and advertising. Configuration is provided for the nucleo_wb55rg
board.
What follows is a detailed list of changes, generated from the git commit
history, and organised into sections.
Thanks to everyone who contributed to this release!
all:
py core:
extmod:
lib:
drivers:
mpy-cross: no changes specific to this component/port
docs:
examples: no changes specific to this component/port
tests:
tools:
CI:
bare-arm port:
cc3200 port: no changes specific to this component/port
esp8266 port:
esp32 port:
javascript port: no changes specific to this component/port
mimxrt port:
minimal port: no changes specific to this component/port
nrf port:
pic16bit port:
powerpc port: no changes specific to this component/port
qemu-arm port:
rp2 port:
samd port: no changes specific to this component/port
stm32 port:
teensy port:
unix port:
windows port:
zephyr port:
The esp32 port moves to CMake and has S2 support, new features for rp2
This release of MicroPython adds general support in the core for using
CMake as a build system. The rp2 port is consolidated to use the new
CMake files, and the esp32 and zephyr ports have switched to build as
pure CMake projects. These three ports have SDKs which are built around
CMake and this change should make them easier to maintain and use.
As part of this work, CMake based ports now have support for user C
modules. Authors of user C modules should now provide both .mk and .cmake
configuration files (following the documentation and examples).
A bug was fixed in the multiple precision integer library, an arithmetic
overflow in the long division routine. Prior to this fix certain integer
divisions would take excessive time and produce incorrect results. See
commit 0a59938574502b19b3d685133084399c090d3c11 for details. There was
also a fix for regular expressions, to check and report byte overflow
errors when compiling expressions. See commit
172fb5230a3943eeb6fbbb4de1dc56b16e2a7637.
In the uasyncio library, a new MicroPython extension has been added,
ThreadSafeFlag, which can be set from outside the asyncio event loop,
such as other threads, IRQs or scheduler context. It allows preemptive
code like IRQs to signal asyncio tasks, which are by nature cooperative
(non-preemptive). asyncio.current_task() has also been added, with the
same semantics as CPython.
As mentioned above, the esp32 port has switched to a full CMake-based
project, and traditional make capability has been removed (although a
simple helper Makefile remains to keep top-level build/deploy commands
consistent with other ports). Because of the move to CMake, network.LAN
support has been removed, to be added back in the future (use a prior
release if LAN is needed). Basic support for Non-Volatile-Storage is added
to the esp32 module. And there is also preliminary support for ESP32S2
SoCs and USB, with a GENERIC_S2 board defined.
On the mimxrt and samd ports, USB CDC TX handling has been fixed so that it
now works reliably.
The rp2 port has had many more core Python features enabled, along with the
enabling of ubinascii.crc32(), the uos.VfsFat and machine.Signal classes,
and the uerrno module. uos.urandom() has been added and machine.freq() can
now change the CPU clock frequency. The machine.UART class now has support
for timeout/timeout_char, inverted TX/RX lines, and buffered TX/RX with
configurable sized buffers. For PIO, StateMachine has added restart(),
rx_fifo() and tx_fifo() helper functions, and support for FIFO joining.
There is now support for user C modules (via CMake) and for building
different board configurations (the default remains the PICO board). USB
reliability has been improved.
For the stm32 port, there is now more configuration options for boards,
such as USBD VID/PID and fine-grained selection of modules. The UART class
now supports LPUART on L0, L4, H7 and WB MCUs. WB MCUs have a fix for a
race condition accessing the BLE ACL free buffer list, and a workaround for
a low-level BLE bug.
The zephyr port has been updated to use zephyr v2.5.0, and now builds
MicroPython as a CMake target.
What follows is a detailed list of changes, generated from the git commit
history, and organised into sections.
all:
py core:
extmod:
lib:
drivers: no changes specific to this component/port
mpy-cross: no changes specific to this component/port
docs:
examples:
tests:
tools:
all ports:
bare-arm port:
cc3200 port: no changes specific to this component/port
esp8266 port:
esp32 port:
javascript port: no changes specific to this component/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
rp2 port:
samd port:
stm32 port:
teensy port: no changes specific to this component/port
unix port:
windows port: no changes specific to this component/port
zephyr port: