# micropython v1.26.0 — I2CTarget, improved floats and native emitter, STM32N6 & ESP32C2 support - Product: micropython (https://whatsnew.fyi/product/micropython) - Vendor: micropython - Date: 2025-08-09 - Version: v1.26.0 - Original notes: https://github.com/micropython/micropython/releases/tag/v1.26.0 - Permalink: https://whatsnew.fyi/product/micropython/releases/v1.26.0 What's New is an index, not a publisher: every entry below links to the vendor's own release notes, which are the authoritative source. Entries are labelled where they are hand-curated sample data, pre-releases, or drawn from a secondary source such as a developer blog. Reuse: the summaries, labels and curation here are © What's New. Quote freely with attribution and a link back; wholesale republication of the corpus is not permitted — terms: https://whatsnew.fyi/terms. The vendors' own release notes remain their publishers'. --- - **added** — Introduce machine.I2CTarget class to allow Python code to implement I2C target devices, available on alif, esp32, mimxrt, rp2, samd, stm32 and zephyr ports - **changed** — Rewrite float formatting to significantly improve repr reversibility, increasing correct repr and parse-back from 28% to 98.5% for single precision and from 38% to 99.8% for double precision - **added** — Add compiler support for handling floats as constants, allowing float folding in arithmetic operations and const assignments - **changed** — Improve float object representation C by applying a heuristic when recovering float values to copy the last two bits from previous bits instead of truncating - **changed** — Optimize native and viper emitter backends to emit more compact machine code for ARM, Thumb, Xtensa, RISC-V 32, x86 and x64 architectures - **added** — Enable Thumb v1 to support long jumps greater than 12 bits, allowing larger Python functions to be compiled to this native architecture - **added** — Implement most of the Xtensa LX3 opcodes in the inline assembler, including addx2, subx2, ssl and ssr - **added** — Add support for STM32N6xx MCU with USB, XSPI memory-mapped external flash, filesystem, basic peripherals and deepsleep - **added** — Add support for ESP32-C2 MCU with REPL, filesystem, GPIO, I2C, ADC, PWM, timers, WiFi and BLE - **changed** — Standardize the date range supported by the time module to work consistently across all platforms, supporting dates from at least 1970 up to 2099 - **changed** — Optimize slice handling in bytearray and memoryview subscripting to avoid heap allocation by allocating slice objects on the C stack - **added** — Add support for using __all__ in star imports - **added** — Add support for PEP487's __set_name__ special method - **added** — Add support for the _b/o/x specifier in str.format - **changed** — Allow arrays to be extended from any iterable, not just from an object with the buffer protocol - **added** — Add new sys.implementation._thread attribute that exists when threading is enabled and indicates which threading model is used - **changed** — Enable framebuf module to blit read-only data to FrameBuffer, allowing custom fonts to be stored in ROM - **changed** — Enable DTLS HelloVerify and Anti Replay protection in the tls module mbedTLS backend - **changed** — Enhance lwIP socket layer with a queue of incoming UDP and raw packets instead of only room for one outstanding packet This release of MicroPython sees the introduction of `machine.I2CTarget`, which allows Python code to implement an I2C target device. It's available on the alif, esp32, mimxrt, rp2, samd, stm32 and zephyr ports. In the simplest case it can create an I2C register/memory device that connects to a bytearray (or similar buffer) and allows an I2C controller to read from and write into that bytearray. For more complex scenarios the `I2CTarget` class exposes a set of interrupts which can be acted upon by Python code, allowing an arbitrary I2C device to be created. See the documentation for more details and examples. Floating point support has been improved in a few ways in this release. First, the formatting (printing) of floats has been rewritten to significantly improve the `repr` reversibility of floating-point numbers. That is, formatting and then re-parsing a float should return the original value. In MicroPython the percentage of floats that correctly repr and parse back was around 28% (single precision) and 38% (double precision), but has now been improved (in the standard build configuration) to 98.5% and 99.8% (single and double respectively). In addition to printing out more accurate floats, that helps a lot when saving floats to .mpy files, because it means they can be loaded back to the same value. Second, there is now support in the compiler for handling floats as constants. Floats can now be folded (along with integers) in arithmetic operations, and be part of `const` assignments. This helps to optimize bytecode because constant float expressions can now be evaluated in the compiler instead of at runtime. The third float improvement involves object representation C, where floats are stored within the immediate object value rather than on the heap. In this object module, the float can only take up 30 bits, so the last two bits of the single precision number are lost. Previously they were just truncated, but now a heuristic is applied when recovering the float value from the object such that the last two bits are copied from the previous two. This alleviates a bias towards zero and in general improves floating point calculations when using this representation. The native and viper emitter backends have been improved to emit more optimal machine code, for example to use more compact instructions in loads and stores. This is for all supported architectures: ARM, Thumb, Xtensa, RISC-V 32, x86 and x64. Thumb v1 (for example RP2040) now supports long jumps greater than 12 bits, allowing larger Python functions to be compiled to this native architecture. Also, the inline Xtensa assembler now implements most of the LX3 opcodes, with additions including addx2, subx2, ssl and ssr, among others. Two new MCUs are supported by this release: STM32N6xx and ESP32-C2 (aka ESP8684). The STM32N6xx is a new STMicroelectronics MCU running at 800MHz with a large amount of RAM and machine-learning accelerators. MicroPython now supports this MCU with USB, XSPI memory-mapped external flash, a filesystem, basic peripherals and deepsleep. The ESP32-C2 is by Espressif and is a small and low cost RISC-V MCU with WiFi and BLE. MicroPython running on this MCU supports a REPL, filesystem, GPIO, I2C, ADC, PWM, timers, WiFi and BLE. The date range supported by the `time` module has now been standardized to work the same across all platforms. The functions `time()`, `localtime()` and `mktime()` now work properly on a reasonable range of dates, from at least 1970 up to 2099, regardless of the Epoch used by the platform. The MicroPython virtual machine is now able to avoid heap-allocating slices when subscripting bytearray and memoryview objects, for example expressions like `bytearray_obj[a:b] = c`. The slice object is now allocated on the C stack, helping to reduce memory churn and allowing such expressions to work when the heap is locked, for example during a hard interrupt handler. This improvement goes in the _[Truncated at 4000 characters — full notes: https://github.com/micropython/micropython/releases/tag/v1.26.0]_