RP2350 and ESP32-C6 support, RISC-V native emitter, common TinyUSB code #16087
dpgeorge
announced in
Announcements and news
Replies: 1 comment
-
Congratulations with MicroPython 1.24, and a big thank you to everyone who contributed! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This release of MicroPython adds support for the new RP2350 MCU, improved RISC-V support with native code generation, support for ESP32-C6 MCUs, update Zephyr version with threading support, unified TinyUSB bindings across ports, a portable UART IRQ API, and enhanced mpremote recursive copy. There are also numerous bug fixes, enhancements to the test suite and more attention to testing of the machine module and its API. Read on for more details.
Support for the RISC-V architecture has been significantly extended, to include an RV32IMC native code emitter, native NLR and GC register scanning implementations for 32- and 64-bit RISC-V, support for placing RV32IMC native code in .mpy files and also freezing it, and RISC-V semihosting support. Testing for RISC-V is done with the qemu and unix ports, and the support is utilised in the esp32 and rp2 ports.
There is now support concatenation of adjacent f-strings, as well as raw f-strings. There is also a new
micropython.RingIO
class which provides a stream interface to an efficient, thread-safe, byte-oriented ring-buffer implementation.All the ports that use TinyUSB have now been unified to use the same shared helper code for CDC serial. This includes: esp32 (S2 and S3), mimxrt, renesas-ra, rp2 and samd ports. With this has come the useful feature that the startup CDC serial data is buffered and then sent to the host upon connection. This means that (among other things) the REPL banner and initial prompt is now seen on first connection to a board.
Most ports now support registering Python callbacks for UART IRQs, and the semantics for the callback are made as consistent as possible across the ports. The possible IRQs are IRQ_RX, IRQ_RXIDLE, IRQ_TXIDLE and IRQ_BREAK, and the ports that have added support for these are esp32, mimxrt, nrf, renesas-ra, rp2 and samd (stm32 already had this feature).
In the networking sub-system, a new API for configuring IP addresses and related settings has been added: the global
network.ipconfig()
function, and anic.ipconfig()
method on individual network interfaces. This new API supports both IPv4 and IPv6, with much more control compared to the originalnic.ifconfig()
method; the latter is still available for backwards compatibility, butipconfig()
is now preferred moving forward.A portable
network.PPP
implementation has been added, based on lwIP. This is not enabled by default but can be added to custom boards that use bare-metal lwIP.The
machine.SoftSPI
class now supports least-significant-bit (LSB) mode, as well as the existing MSB mode.The behaviour of
sys.exit()
andraise SystemExit
(which are equivalent) has been changed: previously this would terminate the running script and drop to the REPL, but now it terminates the running script and triggers a soft reset of the device. This is more consistent with the unix port, which exits completely on aSystemExit
exception. This change in behaviour is a breaking change and may impact certain applications; see commit 69c25ea for details.The mpremote tool has a new hashing ability, eg
mpremote sha256sum <file>
and also has enhanced recursive copy which first checks the hash and only updates the destination file if the hash is different. This makes copying a large directory to a device significantly faster, and enables a "sync" workflow, where small changes can be made to a large application and then quickly deployed to the device via the recursive copy.The esp32 port now supports ESP-IDF v5.2.2, and with this comes support for ESP32-C6 MCUs. The RISC-V native emitter has been enabled on C3 and C6 MCUs. There have also been some important bug fixes, for handling of native code loaded from .mpy files, fixes for stack corruption, and a fix to I2S, among other things. Also, applications that use many TCP sockets in quick succession should see an improvement because there is now a hard limit on the number of active TCP sockets.
The qemu port has been renamed from qemu-arm to simply qemu, and now supports both ARM and RISC-V architectures. It has also been reworked to provide a REPL and to run tests via a pty serial port, emulating how tests are run on bare-metal targets.
The rp2 port has updated pico-sdk to v2.0.0, which brings support to MicroPython for the new RP2350 MCU, in both ARM and RISC-V mode, and in both the 30- and 48-pin variants. IPv6 has been enabled by default on this port, and optional
network.PPP
made available. The USB now remains active duringmachine.lightsleep()
, and there have been many bug fixes.The stm32 port also sees optional
network.PPP
support through lwIP, and support for octospi on STM32H7 MCUs. A build option has been added to put IRQ, flash and UART code in RAM, and this feature is enabled on boards with a UART REPL, to allow filesystem access to work on these boards without losing UART characters (eg when using mpremote to copy files to a board). Preemptive keyboard interrupt via PendSV has been removed: this was buggy and no longer necessary; see ece950d for details. The ARDUINO_PORTENTA_H7 and ARDUINO_NICLA_VISION boards have added support for the NXP SE05x secure element, with integration in mbedTLS.The webassembly port has better asyncio support, including the ability to do a top-level await of
Task
andEvent
objects. There has also been enhancements to the proxying of objects between JavaScript and Python.The zephyr port has updated to use Zephyr v3.7.0, threading has been implemented through the
_thread
module, the REPL now operates in non-blocking mode so it can process events/callbacks, some more Python features including big-integers have been enabled, and machine objects (eg Pin, I2C) can now be constructed using device-tree node labels.New boards added in this release are: ESP32_GENERIC_C6, M5STACK_ATOMS3_LITE, M5STACK_NANOC6, OLIMEX_ESP32_EVB, UM_FEATHERS3NEO, UM_OMGS3, UM_RGBTOUCH_MINI and UM_TINYC6 (esp32 port), RPI_PICO2 (rp2 port), ARDUINO_OPTA (stm32 port).
The change in code size since the previous release for various ports is (absolute and percentage change in the text section):
The leading causes of these changes in code size are:
int.to_bytes()
buffer size checksRingIO
classnetwork.ipconfig
andWLAN.ipconfig
network.ipconfig
,WLAN.ipconfig
andRingIO
classRingIO
class andUART.irq
supportPerformance is effectively unchanged since the previous release on all ports, except the unix port which sees some reduction in GC times due to no more root-pointer scanning of executable memory.
Thanks to everyone who contributed to this release: Adrian Higgins, Alessandro Gatti, Alexandre Iooss, Amirreza Hamzavi, Andrea Milazzo, Andrew Leech, Angus Gratton, Ayush Singh, cajt, Christian Walther, Corran Webster, Damien George, Dan Halbert, danicampora, David Lechner, dmfaria, Dryw Wade, Elvis Pfützenreuter, Felix Dörre, George Hopkins, Glenn Moloney, iabdalkader, IhorNehrutsa, Jared Hancock, Jason Kridner, Jim Mussared, Jon Foster, Jos Verlinde, Junwha, Laurens Valk, Lennart, Leo Chung, Matt Trentini, Matthias Blankertz, Maureen Helm, Michael Sawyer, Michael Vornovitsky, nspsck, Owen, Paul Grayson, Peter Harper, Peter Züger, Phil Howard, Plaque FCC, Rick Sorensen, robert-hh, Seon Rozenblum, shiggy, stijn, Sylvain Zimmer, Takeo Takahashi, Terence Stenvold, tharuka, Tim Weber, timdechant, Volodymyr Shymanskyy, Yoctopuce, ZodiusInfuser.
MicroPython is a global Open Source project, and contributions were made from the following timezones: -0700, -0600, -0500, -0400, -0300, +0000, +0100, +0200, +0300, +0330, +0530, +0800, +0900, +1000, +1100.
The work done in this release was funded in part through GitHub Sponsors, and in part by George Robotics, Espressif, Anaconda, Arduino, LEGO Education, OpenMV and Planet Innovation.
This discussion was created from the release RP2350 and ESP32-C6 support, RISC-V native emitter, common TinyUSB code.
Beta Was this translation helpful? Give feedback.
All reactions