Skip to content

Releases: micropython/micropython

Patch release for rp2 DMA, UART and BLE, esp32 BLE, renesas-ra I2C

20 Feb 12:36
Compare
Choose a tag to compare

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

Patch release for rp2 atomic mutex

05 Jan 02:21
Compare
Choose a tag to compare

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

27 Dec 12:58
Compare
Choose a tag to compare

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
  • objbo...
Read more

U-module renaming, deflate module, IDF 5, board variants and Pico-W BLE

06 Oct 00:09
Compare
Choose a tag to compare

This release of MicroPython sees the renaming of built-in modules to remove the u-prefix, a new deflate module with optional compression support, the introduction of board variants, switching of the esp32 port to use IDF 5 together with improved heap management, support for BLE on RPi Pico W boards, and STM32H5xx support. The project is also now using codespell and ruff to improve code quality. New boards added in this release are: ARDUINO_NANO_ESP32 and UM_NANOS3 (esp32 port), ADAFRUIT_METRO_M7 (mimxrt port), ARDUINO_PORTENTA_C33 and VK_RA6M5 (renesas-ra port), ADAFRUIT_METRO_M4_EXPRESS (samd port), NUCLEO_L4A6ZG and STM32H573I_DK (stm32 port).

The renaming of built-in modules to remove the u-prefix -- for example utime becomes time, uasyncio becomes asyncio -- is done to improve compatibility with CPython and eliminate confusion about whether to import the u-version or the non-u-version of the name. Now, one should just always import the non-u-version and no longer think about u-naming. The only remaining module with a u-prefix is uctypes because it is not compatible with the CPython ctypes modules. The following modules are still available via their u-names for backwards compatibility: array, asyncio, binascii, bluetooth, collections, cryptolib, errno, hashlib, heapq, io, json, machine, os, platform, random, re, select, socket, ssl, struct, time, websocket. These modules (except for asyncio) are also extensible and can be overridden by a file with the same name, eg time.py. To force the import of a built-in, one must first clear (and subsequently restore) sys.path; the ability to write to the sys.path attribute has also been implemented in this release. For further information see the discussion at #9018.

Furthermore, importing itself has been tweaked and optimised, and importing of built-ins no longer touch the filesystem, which makes a typical built-in import take ~0.15ms rather than 3-5ms. For modules that fail to import, they are now removed from sys.modules, allowing the import to be attempted again. This required adding "NLR jump callbacks" to efficiently run some code if an exception is raised.

Additional improvements to the core runtime include support for conversion specifiers in f-strings (e.g. !r), speeding up of incremental GC cycles by tracking the last used block, addition of a new MICROPY_GC_SPLIT_HEAP_AUTO "auto grow heap" mode and support for pad bytes in struct format. The documentation, examples and test have also seen general improvements and additions.

For the extended modules, the zlib C module has been removed and replaced with a new MicroPython-specific deflate module and DeflateIO class that is optimised to provide efficient streaming compression and decompression. The zlib (and gzip) modules are now implemented in pure Python on top of the deflate module. The timeq module has been removed, it existed only for a previous version of (u)asyncio and is no longer used. In the ssl module, SSLContext has been added to be more compatible with CPython. The select module now supports using system/POSIX poll when possible and the unix port now uses this implementation instead of its own one. That means the unix port can now select/poll on custom Python objects that implement the appropriate ioctl. The socket module now supports SO_BROADCAST, and sys.std*.buffer objects now exist on unix. There is also a new esp-hosted network driver for external ESP32-based network coprocessors.

mpy-cross now allows reading source files from stdin and writing compiled code to stdout.

The esp8266 and esp32 ports add support for the Espressif ESP-NOW protocol, and the ability to set/get the power saving mode of the WLAN hardware. The esp8266 port adds board-variant support, combining all boards into a single ESP8266_GENERIC with FLASH_512K, FLASH_1M and OTA variants.

The esp32 port has now switched exclusively to ESP-IDF 5, and all existing components have been updated to work with this new IDF (except esp32.hall_sensor() which has been removed). The FSM ULP has been enabled for S2 and S3 chips, sockets now support SO_BINDTODEVICE, and board-named pins and the Pin.board dict have been implemented. The MicroPython heap has been reworked on this port to support the large variety of memory configurations: it now starts at 64kbytes and automatically grows as needed, with new segments allocated from the IDF heap. This means that boards with SPIRAM have much faster GC collection times if only a small amount of RAM is used, all available RAM can be used if needed, and the IDF has access to enough RAM for things like SSL sockets. For more information see #12141. The esp32 port has also had its generic boards consolidated and renamed to ESP32_GENERIC, ESP32_GENERIC_C3, ESP32_GENERIC_S2 and ESP32_GENERIC_S3, and some now have variants such as SPIRAM.

The mimxrt port has fixes and improvements to PWM and Pin.irq, as well as support for UART hardware flow control and UART.deinit. It has also seen integration of WiFi via the CYW43 driver, and Bluetooth via NimBLE. The mbedTLS bindings have enabled time validation of certificates.

The renesas-ra port has changed board names to match the product name, updated to use FSP v4.4.0, added support for: RA6M5 MCUs, machine PWM, DAC, RNG and SDCard classes, TinyUSB, Bluetooth via NimBLE, networking via lwIP, and mbedTLS.

Bluetooth support has also been added to the rp2 port for the Pico W board. And the RPi boards have been renamed from PICO to RPI_PICO, and PICO_W to RPI_PICO_W. Lightsleep has been fixed on this port so it works while WiFi is powered off, and time.time_ns() now has microsecond resolution.

The samd port sees the addition of SPI and QSPI flash drivers to support filesystems on external flash.

The stm32 port add support for STM32H5xx MCUs, basic support for the OCTOSPI peripheral, and USB support for STM32L1xx MCUs. New functions have been added to the stm module to support the sub-GHz radio on STM32WL55.

In micropython-lib, an extensive LoRa module has been added along with drivers for SX126x and SX127x chipsets, and the STM32WL55. This module supports both synchronous and asynchronous (asyncio) mode. Also, as part of the u-module renaming, urequests has been renamed to requests (but for backwards compatibility "import urequests" still works for now).

The change in code size since the previous release for various ports is (absolute and percentage change in the text section):

   bare-arm:    +192  +0.340%
minimal x86:    +310  +0.169%
   unix x64:   +4784  +0.610%
      stm32:    -524  -0.134%
     cc3200:    +280  +0.154%
    esp8266:   +8016  +1.151%
      esp32: +112133  +7.293%
     mimxrt:   +3624  +1.015%
 renesas-ra:   -2184  -0.348%
        nrf:    +616  +0.332%
        rp2:   +1920  +0.595%
       samd:   -7904  -2.953%

The changes that dominate these numbers are:

  • bare-arm, minimal, cc3200, nrf: NLR jump callbacks and support for extensible modules
  • unix: update of mbedTLS to v2.28.1, support for polling Python objects in select module
  • stm32: removal of the timeq module
  • esp8266: addition of the espnow module
  • esp32: switching to ESP-IDF 5
  • mimxrt: UART features, time validation of SSL certificates
  • renesas-ra: move to FSP v4.4.0, remove timeq module
  • rp2: machine.PWM enhancements
  • samd: drop support for VfsLfs1

Performance is effectively unchanged since the previous release.

Note that this is the last release to use the current versioning scheme for nightly/unstable builds, whereby a build between releases is versioned as v1.20.0--g (following the release of v1.20.0). Moving forward, nightly builds will now be called preview builds and be versioned with the next release number. For example, if the last release was v1.21.0 then preview releases will be of the form v1.22.0-preview..g. For discussion see #12127.

Thanks to everyone who contributed to this release: Adam Green, Alexander Wilde, algonell, Andrew Leech, Andy Piper, Angus Gratton, Armin Brauns, brave ulysses, Brett Cannon, Brian 'redbeard' Harrington, Carlosgg, Chris Wilson, Christian Clauss, Damien George, Damien Tournoud, Daniël van de Giessen, David Grayson, David Lechner, David Yang, dotnfc, Duncan Lowther, Elecia White, elibdev, Elvis Pfutzenreuter, Felix Dörre, Francis Dela Cruz, Glenn Moloney, glenn20, iabdalkader, Ihor Nehrutsa, Jared Hancock, Jim Lipsey, Jim Mussared, Jon Nordby, Jonas Scharpf, Jos Verlinde, Kwabena W. Agyeman, Luca Burelli, marble, Mark Grosen, mbedNoobNinja, mcskatkat, Mingjie Shen, Mirko Vogt, Nicholas H. Tollervey, Oliver Joos, Ondrej Wisniewski, patrick, Peter Harper, Phil Howard, Philipp Ebensberger, Rene Straub, robert-hh, Sebastian Romero, Seon Rozenblum, stephanelsmith, stijn, Takeo Takahashi, Thomas, Tobias Thyrrestrup, UnexpectedMaker, Victor Rajewski, vsfos, Wang Xuancong, Wanlin Wang, Wilko Nienhaus, Wind-stormger, Yaroslav Halchenko, Yilin Sun, Yuuki NAGAO.

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:

  • fix spelling mistakes based on codespell check
  • fix strings with backslash by using raw string literals
  • fix various Python coding inconsistencies found by ruff
  • fix cases of Python variable assigned but never used
  • rename MP_QSTR_umodule to MP_QSTR_module everywhere
  • rename mp_umodule*, mp_module_umodule* to remove the "u" prefix
  • rename mod_umodule*, ^umodule* to remove the "u" prefix
  • rename UMODULE to MODULE in preprocessor/M...
Read more

New mip package manager, compressed type structs and Pico W support

26 Apr 15:20
Compare
Choose a tag to compare

This release of MicroPython introduces a new lightweight package manager called mip, which uses a custom protocol to query and install packages that is optimised for embedded systems. It is intended to take over the role of upip and supports installing packages from micropython-lib as well as any URL. Mip can be run directly on a device (with network connectivity) or via mpremote. As part of this, all pure-Python drivers have been moved from the micropython repository to the micropython-lib repository, making it easier to install the packages needed for a given project.

In the MicroPython runtime, core/built-in types have been compressed by only including in the C-level type struct as many slots for C function pointers as is needed for a given type (instead of storing NULL pointers for unused slots). This resulted in a reduction of code size of many kilobytes for all ports (eg around 1200 for bare-arm) with a very minimal loss in performance. Any third-party C extensions will need to be updated to work with this change. See commits 662b976 and 3ac8b58 for details.

The MicroPython VM/runtime has also seen many improvements and bug fixes, including: addition of hex/fromhex methods to bytes/memoryview/bytearray, dictionary union (PEP 584), support for __float__ and __complex__ functions, support for __dict__ on module objects and UTF-8 validation of all strings. Whole number floats are now formatted exactly, and there have been other accuracy improvements to parsing and formatting of floats. A sub-version has been introduced for .mpy files which is used only when a .mpy file includes native code, allowing the native ABI to change while retaining backwards compatibility with pure bytecode .mpy files. There is now an option to have the GC heap split across more than one pool of memory, although this is not yet in use by the ports. And root pointer registration has been simplified with the new MP_REGISTER_ROOT_POINTER macro.

In the network module, the keyword arguments to scan(), connect() and config() have been renamed to be more consistent across ports and drivers. The changed argument names are: "essid" changed to "ssid", "auth" or "authmode" changed to "security", and "password" changed to "key". The old keyword arguments are still supported so this change is backwards compatible. The functions network.hostname() and network.country() have also been added and provide a standard interface across ports to set the global networking configuration for all interfaces and interface types. In particular, setting the hostname is now supported for all CYW43xx-based boards (pyboard-D, Arduino Portenta, Pico W, and others).

The mbedtls (SSL library) settings have also been unified across ports that use this library and enable elliptic curve DH and DSA cryptography enabled so that devices can connect to more websites. The cert_reqs and cadata arguments have also been implemented. Sockets now support leaving multicast groups. WebREPL will now run the page from the device, allowing WebREPL resources to load from a HTTPS site.

The bluetooth module has a minor breaking change for IRQ_GATTC_CHARACTERISTIC_RESULT: def_handle has been replaced with end_handle. This is not expected to affect most programs as def_handle is unlikely to be used. See commit cacc96d.

The uasyncio module now supports stream read(-1), handles gather with no awaitables, and adds a clear() method to ThreadSafeFlag. The framebuf module adds ellipse and polygon drawing methods, and a fill argument to rect() for consistency with those new methods.

A new port has been added, the "embed" port, which is a port of MicroPython that targets the C language and outputs a set of self-contained .c and .h files for embedding into a wider project. An example is provided to show how this works.

The esp8266 port has reverse-special-methods enabled on the GENERIC board, uart.flush() and uart.txdone() added, real open drain output enabled on pins driven by PWM, and adds the ability to set TX power for the WLAN interface.

The esp32 port now uses synchronous BLE events which allows support for BLE pairing and bonding. The LAN driver adds support for LAN8710, KSZ8081, configuration of ETH ref_clk pin, and support for SPI-based Ethernet chips. UART now supports setting timeout_char and implements uart.flush() and uart.txdone(). New boards include ESP32S3 with octal SPIRAM, Olimex PoE boards and a generic board for unicore chips. There have also been many bug fixes, in particular for newer MCU versions such as S2, S3 and C3.

The mimxrt port has seen a lot of clean up of the code, support for MIMXRT1176 MCUs and the MIMXRT1170_EVK board, a soft-timer implementation of machine.Timer, addition of machine.bootloader(), as well as uart.flush() and uart.txdone().

On the nrf port, machine.UART and machine.PWM have been improved to match other ports (the PWM change is a breaking change), and machine.I2C now supports the freq argument. New boards include the Arduino Nano 33 BLE sense board and the Seeed XIAO NRF52840 Sense.

The rp2 port sees the integration of the CYW43xx WiFi driver which is used in the new Pico W board, a board similar to the Pico but with WiFi support. Other new boards include W5500_EVB_PICO, WEACTSTUDIO and the nullbits Bit-C PRO board. Support has been added for named pins, including Pin.board and Pin.cpu attributes, consistent with other ports that support this feature. The machine.lightsleep() function has been implemented, along with SSL certificate time validation, and more accurate formulas are used to determine PWM frequency and duty. The GC heap available to MicroPython programs has been increased to use the maximum available free RAM, adding about 20k to the user heap. There have also been important bug fixes to threading and concurrency when using both cores.

The samd port has been significantly extended to include: named pins with a pins.csv file, and Pin.board and Pin.cpu attributes; ADC, PWM, DAC, SoftSPI, SoftI2C, SPI, I2C and RTC classes added to the machine module; pin.irq() method and OPEN_DRAIN mode for pins; freq, disable_irq, enable_irq, idle, lightsleep and time_pulse_us functions added to the machine module. Floating point support has been added for SAMD21 devices, and the math module enabled for SAMD51. A board definition for Sparkfun Think Plus has been added.

The stm32 port sees support added for STM32L1xx MCUs, STM32H723, USB on STM32G0xx and mboot support for STM32G0xx. The existing CYW43xx WiFi driver has been replaced with the open-source version of cyw43-driver and this has been integrated with all existing boards with CYW43xx chips. Support for the CC3000 WiFi driver has been removed, and the Wiznet driver integration has been reworked to use the generic one shared with other ports (and also uses lib/wiznet5k instead of the old drivers/wiznet5k). Hardware I2C implementation has been added for STM32L1xx and STM32L4xx, support added for Arduino 1200bps touch to enter the bootloader (only on Arduino boards), mbedtls (SSL) certificate time validation added, and link-time-optimisation (LTO) enabled by default on boards with small flash size. New board definitions include: LEGO Hub No. 7, NUCLEO-L152RE, NUCLEO-F756ZG, NUCLEO-H723ZG, Arduino Nicla Vision and Arduino Giga H7. Arduino boards also now include a range of frozen libraries including senml.

For the unix and windows ports, build outputs (including executables) are now kept inside the $(BUILD) directory associated with the build. As part of this the variant suffix has been removed from the executable name. For example, what was micropython-coverage is now build-coverage/micropython, and the standard variant is build-standard/micropython. Furthermore, the dev variant has been removed and its features enabled instead on the standard variant, which now enables the same feature set as a typical bare-metal board, making it more convenient to use for development. The remaining variants are: minimal, standard, nanbox, coverage. The SSL implementation for this port has switched from axtls to mbedtls, again to match most bare-metal ports.

The javascript port has been renamed to the webassembly port, and adds support for VFS and VfsPosix using Emscripten's POSIX filesystem layer. The way stdout printing works has also changed to dispatch via a custom event called "micropython-print".

The zephyr port upgraded Zephyr to v3.1.0, added custom configuration for bbc_microbit_v2, and enabled finalisers.

The change in code size since the previous release for various ports is (absolute and percentage change in the text section):

   bare-arm:   -1124  -1.934%
minimal x86:   -4322  -2.967%
   unix x64: +264181 +50.533% standard
      stm32:   -3592  -0.906% PYBV10
     cc3200:   -1832  -0.990%
    esp8266:   -2284  -0.327% GENERIC
      esp32:   +9659  +0.632% GENERIC
        nrf:     -84  -0.045% pca10040
        rp2:  +13096  +4.291% PICO
       samd: +127776 +90.488% ADAFRUIT_ITSYBITSY_M4_EXPRESS

The changes that dominate these numbers are:

  • bare-arm, minimal, stm32, cc3200, esp8266: reduced size due to compressed type structs
  • unix: switching axtls for mbedtls, merging in dev configuration options and features
  • esp32: new Ethernet drivers and some additional machine module functionality
  • nrf: compressed type struct and machine module improvements
  • rp2: additional mbedtls features and ciphers
  • samd: many new features, and machine module classes and functions

Thanks to everyone who contributed to this release: Alex Riesen, Andrew Leech, Andrew Scheller, Angus Gratton, Antonello Margottini, Antonin ENFRUN, Ayke van Laethem, Blake Felt, brave ulysses, Brian Cooke, Brian Pugh, Carlosgg, Chris Overgaauw, Chris Swan, Chris Waggoner, chrisma...

Read more

New mpy 6 file format with improved bytecode, addition of renesas-ra port

16 Jun 06:19
Compare
Choose a tag to compare

In this release of MicroPython the .mpy file format has been significantly reworked and bumped to version 6. The new format now contains data and bytecode organised to be mostly static and ready to run in-place. To achieve this, qstr references from bytecode (and native machine code) now go through a lookup table, to convert from local qstr number in the module to global qstr number in the runtime that the module executes within. This means bytecode (and most native code) does not need rewriting when it is imported. Along with this change, the jump opcodes have been optimised to emit 1-byte jump offsets when possible, which gives a good reduction in bytecode size, saving RAM and reducing the size of .mpy files.

The change to the bytecode means that code constants (like long strings, bytes objects and floats) are now shared and de-duplicated across the whole module, rather than each code object having a separate constant table. The parser can also now turn a tuple of constants into a constant object, so the tuple doesn't need to be built at runtime each time it is used. Furthermore, any constant object can now be used in "X = const(obj)" statements.

With these bytecode changes, .mpy files see around a 10% reduction in size and frozen .mpy code sees about a 5% size reduction. Heap memory use after import is also down by around 5% (more savings are seen if the code uses lots of constants). Due to the qstr indirection performance of the VM is slightly reduced on some benchmarks by a few percent, but the benefits of smaller code and reduced RAM usage are deemed to outweigh this. See commit f2040bf for more details.

In the runtime, support has been added for multiple *args and **args in a function call, following PEP 448. Built-in modules can now have (optional) mutable attributes, and this is used to implement sys.ps1/sys.ps2 which allow the user to customise the REPL prompt. This can be useful, for example, to configure a different REPL for different boards so they can be easily distinguished. The sys module has also had the MicroPython git version and build date appended to sys.version, sys.implementation._machine has been added, and sys.implementation.mpy renamed to sys.implementation._mpy. The sys module can now be used to fully identify the MicroPython version and target it is running on (and the platform module provides additional information when it's available).

The MP_REGISTER_MODULE macro is now used to register all built-in C modules and the third argument to this macro has been removed. Any user-C-modules will need to be updated. Also support for MICROPY_PORT_BUILTIN_MODULES is removed because this is no longer needed, and should be replaced by usage of MP_REGISTER_MODULE (see commit 0a92469 for example).

mpy-cross now supports the -march=armv6m option, which can be used with the rp2 port. The -mno-unicode has been removed.

The littlefs2 library has been updated to v2.5.0 which includes some performance improvements and minor fixes.

At the REPL, a tab will now insert an indent when it follows whitespace, and auto-indent is automatically disabled if a space or tab follows an auto-indent. This means that Python code can be pasted into the standard REPL without messing up the indentation.

mpremote is now at version 0.3.0, with a progress indicator shown when copying large files, and recursive copy fixed on Windows. It also has the following commands added: --help, --version, version, resume, soft-reset, umount.

The esp32 port has a new machine.ADCBlock class and updated ADC class. Fixes have been made to ADC2 channel mapping, low PWM frequencies, UART initialisation of unspecified parameters, and RMT channel on S2/S3/C3 variants. The Pin.PULL_HOLD constant has been replaced by a "hold" keyword argument to the Pic constructor, and it's now possible to configure pin drive strength. I2C write-then-read transfers have been optimised to be faster. WLAN.config() now supports setting/getting the txpower. New boards include LOLIN C3 MINI ESP32-C3, LilyGO LoRa32, and UM ESP32-S3 based boards.

The mimxrt port has updated the nxp_driver to v2.10 and fixed USB CDC RX handling to not block. Pin drive constants have been renamed to DRIVE_x to match other ports, and the machine.I2S class has been added. New boards include Olimex RT1010 and MIMXRT1015_EVK.

The nrf port now includes uasyncio in the default board manifest, and additional features have been enabled on nrf52840 and nrf9160 boards to match the features on stm32, rp2 and esp32. This includes enabling the json, re, zlib and framebuf modules.

There is a new renesas-ra port which targets Renesas RA4M1, RA4W1, RA6M1 and RA6M2 MCUs, with board definitions for evaluation kits for these MCUs, along with RA4M1 clicker. This port currently supports Pin, ADC, SoftI2C, I2C, SoftSPI, SPI, UART, Timer and RTC classes in the machine module, along with the VFS and an internal flash filesystem.

The rp2 port now has optional USB MSC support, and optional dupterm support. The machine.UART class has init and deinit methods added, and the ucryptolib module is now available. The lwIP network stack has been integrated, along with mbedtls for the ssl module, and these can be used with the new Wiznet driver to provide Ethernet support. The Wiznet W5100S-EVB-Pico board has been added which makes use of this driver. The day-of-week value reported by time.localtime() has been fixed, memory corruption when a thread is created on core1 has been fixed, and the UART now uses a mutex when reading/writing to prevent character duplication in code that uses both cores.

The stm32 port has added support for G0, G4 and WL MCUs. The new boards for these MCUs are NUCLEO_G0B1RE, NUCLEO_G474RE and NUCLEO_WL55. The ARDUINO_PORTENTA_H7 board has also been added, with full WiFi and BLE support. The rfcore on WB55 MCUs has been improved by removing an extra layer of buffering, and the restriction on the use of address resolution has been removed, meaning that the rfcore WS firmware should be updated to v1.12.0 or later; see commit 26b1d31. The board-level configuration of mboot has been significantly improved to allow more control over system clocks, more hooks into the start up process, and a hook for state change. And the CRC32 of DFU files is now verified before writing them.

The pyb.CAN class has been improved to support FD frames and buses with mixed classic/extended-ID nodes, allowing extended IDs to be specified on a per-message basis. CAN.recv also now returns a value indicating if the received message had an extended ID or not. And CAN.initfilterbanks has been removed, replaced with the num_filter_banks keyword argument to CAN.init. These are all breaking changes to the pyb.CAN class API and code will need to be updated accordingly; see commit 5cdf964 for details.

The unix port now shows compiler information in the REPL banner to make it consistent with how bare-metal ports work, and the "-X realtime" command-line option has been added for macOS to get improved timing. All variants have switched to use the VFS subsystem, and use the VfsPosix class for mounting the host's filesystem. The os module has been consolidated with all other ports and the minimal and standard variants gain the unlink, chdir, getcwd and listdir functions.

The windows port has also switched to the VFS subsystem and VfsPosix. It adds support for micropython.schedule and uasyncio on the dev variant. And BCryptGenRandom has been used to implement os.urandom.

The zephyr port upgraded Zephyr to v3.0.0.

The change in code size since the previous release for various ports is (absolute and percentage change in the text section):

   bare-arm:   +792  +1.394%
minimal x86:  +2091  +1.286%
   unix x64: +10231  +1.995%
unix nanbox:  +9777  +2.162%
      stm32:   +184  +0.047% PYBV10
     cc3200:   +904  +0.493%
    esp8266:  -1240  -0.177% GENERIC
      esp32:  +6464  +0.425% GENERIC
        nrf: +11288  +6.472% pca10040
        rp2: +14432  +2.929% PICO
       samd:  +1352  +0.970% ADAFRUIT_ITSYBITSY_M4_EXPRESS

The changes that dominate these numbers are:

  • bare-arm, minimal, cc3200, samd: reworked bytecode and mpy format, optimisation of jump opcodes to use 1-byte offsets, de-duplication of constants at the module level, and PEP 448 support
  • unix: switching to use VFS, and new mpy format and related changes
  • esp8266: removal of esp.info and machine.WDT.deinit
  • esp32: addition of machine.ADCBlock, and new mpy format changes
  • nrf: enabling uasyncio, enabling MICROPY_PY_IO
  • rp2: enabling ucryptolib with mbedtls

Note that the stm32 port's size remained roughly unchanged. This is because it has a decent amount of frozen Python code and the reduction in frozen code size due to the reworked bytecode has offset the increase in runtime/VM size due to this change. Ports like bare-arm, minimal, cc3200 and samd do not have any frozen code so only see the increase in runtime/VM size. Production-level projects that have a significant amount of frozen code have seen around a 4% overall reduction in their firmware size.

Thanks to everyone who contributed to this release: Algy Tynan, Andrew Leech, Andrew Scheller, Artyom Skrobov, Asensio Lorenzo Sempere, Bradley Wogsland, Cem Eliguzel, Chris Wilson, Christian Decker, Christian Zietz, Christophe Priouzeau, Clayton Mills, Damien George, Daniel Jour, Daniël van de Giessen, Dave Hylands, David Lechner, Emil Kondayan, Herwin Grobben, iabdalkader, IhorNehrutsa, Jan, Jared Hancock, jason, Jeff Epler, Jeremy Herbert, Jim Mussared, Jon Bjarni Bjarnason, Jonathan Hogg, Jos Verlinde, Kattni Rembor, Lars Kellogg-Stedman, Luiz Brandao, marcidy, Martin Fischer, Maureen Helm, Meriç SARIIŞIK, Michael Himing,...

Read more

Boosted performance, board.json metadata, more mimxrt, rp2, samd features

16 Jan 23:37
Compare
Choose a tag to compare

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 2c139bb.

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:

  • bare-arm, minimal: use of new MICROPY_CONFIG_ROM_LEVEL_MINIMUM option and subsequent disabling of remaining optional features
  • unix, cc3200, nrf: general code size reductions of the core
  • stm32: performance improvements, addition of platform module
  • esp8266: enabling f-strings
  • esp32: use of -O2 instead of -Os
  • rp2: machine.I2S and other new hardware features
  • samd: filesystem support and other new hardware features

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.

Main components

all:

  • remove MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE
  • update Python formatting to latest Black version 21.12b0
  • remove support for FROZEN_DIR and FROZEN_MPY_DIR

py core:

  • parse: simplify parse nodes representing a list
  • emitnative: ensure load_subscr does not clobber existing REG_RET
  • mpconfig.h: define initial templates for "feature levels"
  • vm: add a fast path for LOAD_ATTR on instance types
  • map: add an optional cache of (map+index) to speed up map lookups
  • builtinimport: forward all debug printing to MICROPY_DEBUG_PRINTER
  • add wrapper macros so hot VM functions can go in fast code location
  • runtime: fix crash when exc new doesn't return an exc instance
  • mpconfig.h: define the "extra" feature level
  • mpconfig.h: revert MICROPY_REPL_INFO to disabled at all levels
  • gc: add hook to run code during time consuming GC operations
  • showbc: print unary-op string when dumping bytecode
  • modsys: replace non-ASCII quote char with ASCII char
  • runtime: allow types to use both .attr and .locals_dict
  • lexer: support nested [] and {} characters within f-string params
  • objfun.h: remove obsolete comments about entries in extra_args
  • builtinimport: refactor module importing
  • showbc: fix printing of raw bytecode header on nanbox builds
  • modio: remove io.resource_stream function
  • only search frozen modules when '.frozen' is found in sys.path
  • mkrules.cmake: set frozen preprocessor defs early
  • runtime: allow initialising sys.path/argv with defaults
  • mpstate.h: only include sys.path/argv objects in state when enabled
  • mpz: fix bugs with bitwise of -0 by ensuring all 0's are positive
  • qstr: reset mpstate.qstr_last_chunk before raising an error
  • modbuiltins: add additional macro for extending builtins
  • mpconfig.h: define MICROPY_PY_USSL_FINALISER only if not defined

extmod:

  • machine_i2c: make SoftI2C configurable via macro option
  • machine_spi: make SoftSPI configurable via macro option
  • modonewire: make _onewire module configurable via macro option
  • machine_pwm: factor out machine.PWM bindings to common code
  • move modnetwork and modusocket from stm32 to extmod
  • modnetwork: add STA_IF and AP_IF constants
  • modnetwork: add extended socket state
  • modusocket: add read/write stream methods to socket object
  • modnetwork: define network interfaces in port config files
  • network_cyw43: make consistent use of STA and AP constants
  • modnetwork: remove STM32 references
  • modnetwork: remove modnetwork socket u_state member
  • mpbthci.h: add mp_bluetooth_hci_uart_any prototype
  • nimble: add nimble CMake fragment file
  • add platform module
  • moduplatform: improve implementation for PC ports
  • vfs_posix_file: support MP_STREAM_POLL in vfs_posix_file_ioctl
  • modbluetooth: add connection interval to gap_connect
  • nimble: update...
Read more

F-strings, new machine.I2S class, ESP32-C3 support and LEGO_HUB_NO6 board

02 Sep 01:12
Compare
Choose a tag to compare

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.

Main components

all:

  • fix signed shifts and NULL access errors from -fsanitize=undefined
  • update to point to files in new shared/ directory

py core:

  • mpstate: make exceptions thread-local
  • mpstate: schedule KeyboardInterrupt on main thread
  • mperrno: add MP_ECANCELED error code
  • makeqstrdefs.py: don't include .h files explicitly in preprocessing
  • mark unused arguments from bytecode decoding macros
  • objexcept: pretty print OSError also when it has 2 arguments
  • makeversionhdr: add --tags arg to git describe
  • vm: simplify handling of MP_OBJ_STOP_ITERATION in yield-from opcode
  • objexcept: make mp_obj_exception_get_value support subclassed excs
  • support single argument to optimised MP_OBJ_STOP_ITERATION
  • introduce and use mp_raise_type_arg helper
  • modsys: optimise sys.exit for code size by using exception helpers
  • objexcept: make mp_obj_new_exception_arg1 inline
  • obj: fix formatting of comment for mp_obj_is_integer
  • emitnative: reuse need_reg_all func in need_stack_settled
  • emitnative: ensure stack settling is safe mid-branch
  • runtime: fix bool unary op for subclasses of native types
  • builtinimport: fix condition for including do_execute_raw_code()
  • mkrules: automatically build mpy-cross if it doesn't exist
  • implement partial PEP-498 (f-string) support
  • lexer: clear fstring_args vstr on lexer free
  • mkrules.mk: do submodule sync in "make submodules"

extmod:

  • btstack: add missing call to mp_bluetooth_hci_uart_deinit
  • btstack: check that BLE is active before performing operations
  • uasyncio: get addr and bind server socket before creating task
  • axtls-include: add axtls_os_port.h to customise axTLS
  • update for move of crypto-algorithms, re1.5, uzlib to lib
  • moduselect: conditionally compile select()
  • nimble: fix leak in l2cap_send if send-while-stalled
  • btstack/btstack.mk: use -Wno-implicit-fallthrough, not =0
  • utime: always invoke mp_hal_delay_ms when >= to 0ms
  • modbluetooth: clamp MTU values to 32->UINT16_MAX
  • nimble: allow modbluetooth binding to hook "sent HCI packet"
  • nimble: add "memory stalling" mechanism for l2cap_send
  • uasyncio: in open_connection use address info in socket creation
  • modujson: add support for dump/dumps separators keyword-argument
  • modlwip: fix close and clean up of UDP and raw sockets
  • modbluetooth: add send_update arg to gatts_write
  • add machine.bitstream
  • modframebuf: enable blit between different formats via a palette

lib:

  • tinyusb: update to version 0.10.1
  • pico-sdk: update to version 1.2.0
  • utils/stdout_helpers: make mp_hal_stdout_tx_strn_cooked efficient
  • axtls: switch to repo at micropython/axtls
  • axtls: update to latest axtls 2.1.5 wih additional commits
  • re1.5: move re1.5 code from extmod to lib
  • uzlib: move uzlib code from extmod to lib
  • crypto-algorithms: move crypto-algorithms code from extmod to lib
  • update README's based on contents of these dirs

drivers:

  • neopixel: add common machine.bitstream-based neopixel module
  • neopixel: optimize fill() for speed
  • neopixel: reduce code size of driver
  • cyw43: fix cyw43_deinit so it can be called many times in a row
  • cyw43: make wifi join fail if interface is not active

mpy-cross:

  • disable stack check when building with Emscripten

Support components

docs:

  • library: document new esp32.RMT features and fix wait_done
  • library: warn that ustruct doesn't handle spaces in format strings
  • esp8266/tutorial: change flash mode from dio to dout
  • replace master/slave with controller/peripheral in I2C and SPI
  • rp2: enhance quickref and change image to Pico pinout
  • rp2: update general section to give a brief technical overview
  • library/utime.rst: clarify behaviour and precision of sleep ms/us
  • library/uasyncio.rst: document stream readexactly() method
  • library/machine.I2S.rst: fix use of sd pin in examples
  • zephyr: add quick reference for the Zephyr port
  • library/zephyr: add libraries specific to the Zephyr port
  • templates: add unix and zephyr quickref links to top-index
  • rename ufoo.rst to foo.rst
  • replace ufoo with foo in all docs
  • library/index.rst: clarify module naming and purpose
  • library/builtins.rst: add module title
  • library/network.rst: simplify socket import
  • add docs for machine.bitstream and neopixel module
  • library: fix usage of :term: for frozen module reference
  • esp8266: use monospace for software tools
  • reference: mention that slicing a memoryview causes allocation

examples: no changes specific to this component/port

tests:

  • extmod: make uasyncio_heaplock test more deterministic
  • cpydiff/modules_struct_whitespace_in_format: run black
  • extmod/ujson: add tests for dump/dumps separators argument
  • run-multitests.py: add broadcast and wait facility
  • multi_bluetooth/ble_subscribe.py: add test for subscription
  • extmod/vfs_fat_finaliser.py: ensure alloc at never-used GC blocks
  • basics: split f-string debug printing to separate file with .exp
  • pybnative: make while.py test run on boards without pyb.delay

tools:

  • autobuild: add scripts to build release firmware
  • remove obsolete build-stm-latest.sh script
  • ci.sh: run apt-get update in ci_powerpc_setup
  • makemanifest.py: allow passing flags to mpy-tool.py
  • autobuild: add mimxrt port to build scripts for nightly builds
  • pyboard.py: add cmd-line option to make soft reset configurable
  • mpremote: swap order of PID and VID in connect-list output
  • ci.sh: build unix dev variant as part of macOS CI
  • ci.sh: build GENERIC_C3 board as part of esp32 CI
  • autobuild: use separate IDF version to build newer esp32 SoCs
  • autobuild: add FeatherS2 and TinyS2 to esp32 auto builds
  • mpremote: add seek whence for mounted files
  • mpremote: raise OSError on unsupported RemoteFile.seek
  • autobuild: add the MIMXRT1050_EVKB board to the daily builds
  • ci.sh: add mpy-cross build to nrf port
  • codeformat.py: include ports/nrf/modules/nrf in code formatting
  • gen-cpydiff.py: don't rename foo to ufoo in diff output
  • autobuild: add auto build for Silicognition wESP32
  • mpremote: fix connect-list in case VID/PID are None
  • mpremote: add "devs" shortcut for "connect list"
  • mpremote: remove support for pyb.USB_VCP in/out specialisation
  • autobuild: don't use "-B" for make, it's already a fresh build
  • pyboard.py: move --no...
Read more

New mpremote tool, and the mimxrt port gets Pin, ADC, UART, RTC and VFS

18 Jun 09:07
Compare
Choose a tag to compare

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 53519e3.

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 de2e081 and 514bf1a 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 a96afae 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 748339b. 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!

Main components

all:

  • rename mp_keyboard_interrupt to mp_sched_keyboard_interrupt
  • replace busses with buses

py core:

  • objexcept: support errno attribute on OSError exceptions
  • add option to compile without any error messages at all
  • dynruntime.h: add mp_obj_get_array() function
  • profile: use mp_handle_pending() to raise pending exception
  • scheduler: add mp_sched_exception() to schedule a pending exception
  • scheduler: add optional port hook for when something is scheduled
  • runtime: remove commented-out code from mp_deinit()
  • scheduler: add missing MICROPY_WRAP_MP_SCHED_EXCEPTION usage
  • repl: filter private methods from tab completion
  • repl: enter four spaces when there are no matches
  • repl: refactor autocomplete to reduce nesting
  • repl: refactor autocomplete, extracting reusable parts
  • repl: autocomplete builtin modules
  • gc: make gc_lock_depth have a count per thread
  • mkenv.mk: don't emit info about BUILD_VERBOSE if it's set
  • objarray: prohibit comparison of mismatching types
  • objarray: implement more/less comparisons for array
  • objarray: use mp_obj_memoryview_init helper in mp_obj_new_memoryview
  • objarray: fix constructing a memoryview from a memoryview
  • nlraarch64: add underscore prefix to function symbols for Darwin ABI
  • nlrx64: correct the detection of Darwin ABI
  • asmx64: support use of top 8 regs in src_r64 argument
  • emitnative: fix x86-64 emitter to generate correct 8/16-bit stores
  • mkrules.cmake: add MPY_LIB_DIR and BOARD_DIR to makemanifest call
  • asmarm: use builtin func to flush I- and D-cache on ARM 7 archs
  • compile: raise an error on async with/for outside an async function
  • gc: access the list of root pointers in an asan-compatible way
  • repl: don't read past the end of import_str
  • builtinimport: change relative import's ValueError to ImportError
  • emitglue: always flush caches when assigning native ARM code
  • stackctrl: prevent unused-var warning when stack checking disabled
  • gc: only use no_sanitize_address attribute for GCC 4.8 and above

extmod:

  • uasyncio: use .errno instead of .args[0] for OSError exceptions
  • remove old comments used for auto-doc generation
  • moductypes: remove double blank lines and debugging printf's
  • moductypes: replace numbers with macro constants
  • moductypes: fix size and offset calculation for ARRAY of FLOAT32
  • moduhashlib: put hash obj in final state after digest is called
  • modurandom: add error message when getrandbits has bad value
  • modurandom: support an argument of bits=0 to getrandbits
  • uasyncio: fix start_server and wait_closed race condition
  • uasyncio: add readinto() method to Stream class
  • uasyncio: fix race with cancelled task waiting on finished task
  • nimble: remove TODO comment about notify_custom freeing om

lib:

  • utils: remove unused PYEXEC_SWITCH_MODE from pyexec.h
  • utils: add ARM semihosting utility functions
  • lwip: switch to use GitHub mirror repo
  • mbedtls: switch to currently latest commit of LTS branch v2.16

drivers:

  • sdcard: add sleep_ms(1) delay in SDCard.readinto sync loop
  • cyw43/cyw43_ctrl: use new sdio enable API functions
  • cyw43/cywbt: add compile option for RF switch
  • cyw43/cywbt: remove hard-coded UART6 alternate function setting
  • display/ssd1306.py: add rotate method
  • display/ssd1306.py: add support for 72x40 displays

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

Support components

docs:

  • library/machine: specify initial machine.PWM class
  • library/machine: add machine.bootloader docs
  • esp8266: add note about simultaneous use of STA_IF and AP_IF
  • esp8266: add instructions on entering programming mode manually
  • esp8266: clarify limitations of SSL in esp8266 and fix typos
  • fix some spelling mistakes
  • pyboard: fix typo in pyb.Switch tutorial
  • esp32: add UART to quickref
  • esp32: add WDT to quickref
  • esp32: add SDCard to quickref
  • esp8266: add WDT to quickref
  • library: add initial API reference for rp2 module and its classes
  • library/rp2.rst: fix typo overriden->overridden
  • esp32: add APA106 to quickref
  • esp32: mention Signal in GPIO section of quickref
  • esp8266: mention Signal in GPIO section of quickref
  • esp8266: add SSD1306 to quickref and tutorial
  • library: clarify what type of algorithm is implemented in heapq
  • library: add a blank line to fix formatting for ussl docs
  • library/pyb.Pin.rst: update the arguments for Pin.init()
  • rp2: add skeleton docs for the rp2 port
  • library/machine.RTC.rst: document datetime method and fix ex code
  • esp32: document WLAN "reconnects" config option

examples: no changes specific to this component/port

tests:

  • use .errno instead of .args[0] for OSError exceptions
  • run-multitests.py: provide some convenient serial device shorcuts
  • multi_bluetooth: add performance test for gatt char writes
  • thread: make stress_create.py test run on esp32
  • thread: make stress_aes.py test run on bare-metal ports
  • thread: make exc1,exit1,exit2,stacksize1,start1 tests run on rp2
  • run-perfbench.py: fix native feature check
  • run-multitests.py: flush stdout for each line of trace output
  • run-tests.py: parallelize running tests by default
  • cpydiff: add test and workaround for function.module attr
  • make float and framebuf tests skip or run on big-endian archs
  • extmod/btree_gc.py: close the database to avoid a memory leak
  • basics: split out literal tests that raise SyntaxWarning on CPy
  • run-multitests.py: allow to work without sys.stdout on target
  • multi_bluetooth/ble_gap_advertise.py: allow to work without set
  • unix: add ffi test for integer types
  • cpydiff: add test for array constructor with overflowing value
  • float: make bytes/bytearray construct tests work with obj repr C

tools:

  • metrics.py: add rp2 port to table of ports that can be built
  • upip.py: use .errno instead of .args[0] for OSError exceptions
  • pyboard.py: support opening serial port in exclusive mode
  • gen-cpydiff.py: fix formatting of doc strings for new Black
  • makemanifest.py: show directory name if there is a FreezeError
  • mpy_ld.py: support R_X86_64_GOTPCREL reloc for x86-64 arch
  • pydfu.py: remove default VID/PID values...
Read more

The esp32 port moves to CMake and has S2 support, new features for rp2

18 Apr 15:01
Compare
Choose a tag to compare

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 0a59938 for details. There was also a fix for regular expressions, to check and report byte overflow errors when compiling expressions. See commit 172fb52.

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.

Main components

all:

  • rename BYTES_PER_WORD to MP_BYTES_PER_OBJ_WORD
  • add .git-blame-ignore-revs for fixing up git blame output

py core:

  • gc: don't include mpconfig.h and misc.h in gc.h
  • remove BITS_PER_WORD definition
  • rename BITS_PER_BYTE to MP_BITS_PER_BYTE
  • rename WORD_MSBIT_HIGH to MP_OBJ_WORD_MSBIT_HIGH
  • gc: change include of stdint.h to stddef.h
  • mpz: fix overflow of borrow in mpn_div
  • add core cmake rule files
  • expand lists in core cmake custom commands
  • mkrules.cmake: rename QSTR_DEFS variables to QSTRDEFS
  • mkrules.cmake: add MICROPY_QSTRDEFS_PORT to qstr build process
  • nlr: implement NLR for AArch64
  • nlrx64: fix typo in comment
  • vm: for tracing use mp_printf, and print state when thread enabled
  • rename remaining object types to be of the form mp_type_xxx
  • py.cmake: move qstr helper code to micropy_gather_target_properties
  • py.cmake: introduce MICROPY_INC_CORE as a list with core includes
  • profile: resolve name collision with STATIC unset
  • runtime: make sys.modules preallocate to a configurable size

extmod:

  • vfs_posix_file: allow closing an already closed file
  • btstack: add HCI trace debugging option in btstack_hci_uart
  • btstack: add stub functions for passkey, l2cap bindings
  • btstack: enable SYNC_EVENTS, PAIRING_BONDING by default
  • uasyncio: add asyncio.current_task()
  • add core cmake rule files
  • nimble: ensure handle is set on read error
  • moduselect: fix unsigned/signed comparison for timeout!=-1
  • uasyncio: add ThreadSafeFlag
  • nimble/hal/hal_uart: fix HCI_TRACE format specifiers
  • modbluetooth: allow NimBLE to use Zephyr static address
  • modussl: fix ussl read/recv/send/write errors when non-blocking
  • btstack: use MICROPY_HW_BLE_UART_BAUDRATE for first UART init
  • modbluetooth: separate enabling of "client" from "central"
  • extmod.cmake: add modonewire.c to MICROPY_SOURCE_EXTMOD list
  • modbluetooth: free temp arrays in gatts register services
  • re1.5: check and report byte overflow errors in _compilecode
  • extmod.cmake: add support to build btree module with CMake

lib:

  • tinyusb: update to version 0.8.0
  • mbedtls: switch to currently latest commit of LTS branch v2.16
  • utils/gchelper_generic: implement AArch64 support
  • pico-sdk: update to latest version 1.1.0

drivers: no changes specific to this component/port

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

Support components

docs:

  • library/uasyncio.rst: add docs for ThreadSafeFlag
  • develop/cmodules.rst: document C-modules and micropython.cmake
  • develop: improve user C modules to properly describe how to build

examples:

  • usercmodule: add micropython.cmake to the C and CPP examples
  • usercmodules: simplify user C module enabling
  • embedding: fix example so it compiles again

tests:

  • extmod/vfs_posix.py: add more tests for VfsPosix class
  • extmod: add test for ThreadSafeFlag
  • multi_bluetooth: add basic performance tests
  • rename run-tests to run-tests.py for consistency
  • run-tests.py: reformat with Black
  • multi_bluetooth: skip tests when BLE features are unsupported
  • extmod/vfs_fat_fileio2.py: close test file at end of test
  • run-tests.py: provide more info if script run via pyboard crashes
  • feature_check: check for lack of pass result rather than failure
  • net_inet: add 'Strict-Transport-Security' to exp file

tools:

  • add filesystem action examples to pyboard.py help
  • ci.sh: change esp32 CI to work with idf.py and IDF v4.0.2
  • makemanifest.py: allow passing option args to include()
  • ci.sh: update zephyr docker image to v0.11.13
  • verifygitlog.py: show required format regexp in error message
  • pydfu.py: support DFU files with elements of zero size
  • ci.sh: add CI for CMake USER_C_MODULE support
  • ci.sh: build user C modules for esp32
  • metrics.py: fix esp32 output filename due to move to CMake
  • ci.sh: build esp32 using IDF v4.0.2 and v4.3

The ports

all ports:

  • remove def of MP_PLAT_PRINT_STRN if it's the same as the default
  • update to build with new tinyusb

bare-arm port:

  • clean up the code, make it run on an F405, and add a README

cc3200 port: no changes specific to this component/port

esp8266 port:

  • modules: fix fs_corrupted() to use start_sec not START_SEC

esp32 port:

  • add support to build using IDF with cmake
  • esp32_rmt: don't do unnecessary check for unsigned less than zero
  • add explicit initialisers to silence compiler warnings
  • remove traditional "make" capability
  • boards: remove old IDF v3 sdkconfig values
  • boards: enable BLE on all boards
  • README: update based on new IDF v4 cmake build process
  • add support to build with ESP-IDF v4.1.1
  • add support to build with ESP-IDF v4.2
  • remove obsolete IDF v3 code wrapped in MICROPY_ESP_IDF_4
  • modsocket: remove unix socket error code translation
  • set MICROPY_USE_INTERNAL_ERRNO=0 to use toolchain's errno.h
  • boards: enable size optimisation for builds
  • add support to build with ESP-IDF v4.3 pre-release
  • add basic support for Non-Volatile-Storage in esp32 module
  • make machine.soft_reset() work in main.py and reset_cause()
  • define MICROPY_QSTRDEFS_PORT to include special qstrs
  • Makefile: specify port and baud on erase_flash command
  • machine_hw_spi: use default pins when making SPI if none given
  • restore USER_C_MODULE support with new CMake build system
  • fix multiple definition errors with mp_hal_stdout_tx functions
  • enable btree module
  • modsocket: correctly handle poll/read of unconnected TCP socket
  • add initial support for ESP32S2 SoCs
  • add support for USB with CDC ACM
  • boards: add GENERIC_S2 board definition
  • machine_pin: use rtc_gpio_deinit instead of gpio_reset_pin

javascript port: no changes specific to this component/port

mimxrt port:

  • fix USB CDC handling so it works reliably
  • boards: add MIMXRT1050_EVK board, based on MIMXRT1060_EVK
  • enable CPYTHON_COMPAT, PY_ASYNC_AWAIT, PY_ATTRTUPLE options

minimal port: no changes specific to this component/port

nrf port:

  • drivers/usb: add USBD_IRQHandler which calls tud_int_handler

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:

  • machine_adc: only initialise the ADC periph if not already enabled
  • micropy_rules.cmake: fix makemoduledefs vpath to work with abs path
  • use local tinyusb instead of the one in pico-sdk
  • enable MICROPY_PY_UBINASCII_CRC32 to get ubinascii.crc32()
  • enable VfsFat class for FAT filesystem support
  • machine_uart: add timeout/timeout_char to read and write
  • machine_u...
Read more