Page 1 of 2

MicroPython version 1.12 released

Posted: Mon Dec 23, 2019 12:11 am
by Damien
We're happy to announce the next release of MicroPython, v1.12!

Source code and firmware can be downloaded from https://micropython.org/download/

The full change log can be found at https://micropython.org/resources/micro ... ngeLog.txt

A summary of the changes follows. Enjoy!

v1.12: PYBD boards, BLE and littlefs, dynamic native modules, samd and powerpc

This release sees a reduction in overall bytecode size due to compression of the bytecode prelude, saving 7 bytes of bytecode per function for roughly 80% of functions. The bytecode opcode values are also redefined to group them based on their argument size and format. Support is also added for the matrix multiplication operator "@" (PEP 465).

The .mpy file format moved to version 5 to support the new bytecode encoding, and added support for relocation of native machine code, along with separate rodata and BSS sections. This allows a MicroPython system to import dynamic native modules, .mpy files that are generated from C code. Examples of this feature are provided in "examples/natmod/" and documentation in "docs/develop/natmod.rst".

Some code-size saving optimisations were implemented leading to a reduction in size of minimal firmware: bare-arm reduced by 584 bytes, minimal x86 by 5476 bytes (partly due to changed compiler optimisation flags) and minimal ARM Thumb 2 by 1440 bytes (all measured with gcc 9.2.0).

A new mechanism to freeze scripts into firmware is provided - a frozen manifest - whereby scripts to freeze are listed in a Python file (eg manifest.py). All ports are updated to use this new feature.

When weak module links are enabled (via MICROPY_MODULE_WEAK_LINKS) an import will now automatically search for the built-in u-variant of a module if the non-u-variant fails (eg searches for "ufoo" if "foo" fails), so ports no longer provide an explicit list of these. The unix and windows ports now enable this feature.

A performance benchmarking test suite is added which can be used to compare changes in absolute performance when optimising features, as well as compare across different ports. See "tests/run-perfbench.py".

Bluetooth (BLE only) support is added via the "ubluetooth" module and provides the ability to implement the four BLE roles. The BLE stack is used is Mynewt Nimble and it currently runs on PYBD boards, STM32WB55 MCUs and ESP32 boards.

Support for littlefs filesystems is added through the MicroPython VFS interface, and it works on the unix, stm32, esp8266 and esp32 ports.

A new "machine.ADC.read_u16()" method is defined and implemented on stm32, esp8266, esp32 and nrf ports, providing a consistent way to read an ADC that returns a value in the range 0-65535. This new method should be preferred to the existing "ADC.read()" method.

The stm32 port sees support for the new PYBD range of pyboards which include a fully integrated CYW43xx WiFi/BT chip. USB is enhanced to support VCP+MSC+HID mode and up to 3x simultaneous VCP interfaces. Support is also added for STM32WBxx MCUs including BLE. There is a new machine.ADC class which is compatible with other ports, along with a new machine.Timer class that implements a software timer with millisecond resolution and number of active timers only limited by RAM. Support for littlefs is available by default via uos.VfsLfs2. Documentation for using littlefs is found in "docs/reference/filesystem.rst".

The esp8266 port has switched to use per-board configurations and builds, as well as the new frozen manifest feature. It also has optional littlefs support (requires a separate build).

The esp32 port has the following new features: native code generation, machine.SDCard, hardware I2C, mDNS queries and responder, esp32.Partition, esp32.RMT, BLE (requires IDF v4), and built-in support for VfsLfs2. It has switched to use per-board configurations and builds, and frozen manifests. The default SSL output buffer is resized from 16kiB down to 4kiB to save RAM.

There are new, minimal ports to Microchip SAMDxx microcontrollers, and the bare metal PowerPC architecture.

A code-of-conduct based on the PSF's code is added in CODEOFCONDUCT.md.

The following new Git submodules are added: mbedtls, asf4, tinyusb, mynewt-nimble. And a new third-party library: littlefs.

Re: MicroPython version 1.12 released

Posted: Mon Dec 23, 2019 4:58 am
by seonr
Congratulations on the release, and a big thanks to all that contributed to the impressive feature set in 1.12!

Cheers,
Seon

Re: MicroPython version 1.12 released

Posted: Mon Dec 23, 2019 5:56 am
by OutoftheBOTS_
MP continues to march forward.

A big Thanks to all the contributors. :)

Re: MicroPython version 1.12 released

Posted: Mon Dec 23, 2019 7:19 am
by kevinkk525
That's a really big changelog with awesome features!

Re: MicroPython version 1.12 released

Posted: Mon Dec 23, 2019 7:56 am
by pythoncoder
You guys have been working hard! Thank you for a great release.

Re: MicroPython version 1.12 released

Posted: Mon Dec 23, 2019 1:41 pm
by marfis
THANKS to all the contributors - Great Christmas present👍

Re: MicroPython version 1.12 released

Posted: Mon Dec 23, 2019 8:21 pm
by doublevee
Thank you very much for this new version.

Happy Christmas to the MP Forum!

Re: MicroPython version 1.12 released

Posted: Fri Dec 27, 2019 12:41 am
by mcL
The esp8266 port has switched to use per-board configurations and builds, as well as the new frozen manifest feature. It also has optional littlefs support (requires a separate build).
Looking for littlefs on my Huzzah esp8266, I downloaded 1.12 from ESP8266 section, import uos and don't see uos.VfsLfs2. Does the above statement mean that there is littlefs build available or does that mean that I would need to build it myself?

Thank you (just trying to figure this all out!)

Re: MicroPython version 1.12 released

Posted: Fri Dec 27, 2019 12:46 am
by yeti
mcL wrote:
Fri Dec 27, 2019 12:41 am
Looking for littlefs on my Huzzah esp8266, I downloaded 1.12 from ESP8266 section, import uos and don't see uos.VfsLfs2. Does the above statement mean that there is littlefs build available or does that mean that I would need to build it myself?
You'll need to build it with LFS2 enabled:
Damien wrote:
Mon Dec 23, 2019 12:11 am
The esp8266 port has switched to use per-board configurations and builds, as well as the new frozen manifest feature. It also has optional littlefs support (requires a separate build).

Re: MicroPython version 1.12 released

Posted: Sat Dec 28, 2019 2:18 am
by mcL
OK, thanks! I'll see if I can figure out how to do that...