MicroPython version 1.12 released

Announcements and news related to MicroPython.
Damien
Site Admin
Posts: 634
Joined: Mon Dec 09, 2013 5:02 pm

MicroPython version 1.12 released

Post by Damien » Mon Dec 23, 2019 12:11 am

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.

seonr
Posts: 37
Joined: Mon Sep 10, 2018 6:54 am

Re: MicroPython version 1.12 released

Post by seonr » Mon Dec 23, 2019 4:58 am

Congratulations on the release, and a big thanks to all that contributed to the impressive feature set in 1.12!

Cheers,
Seon

OutoftheBOTS_
Posts: 781
Joined: Mon Nov 20, 2017 10:18 am

Re: MicroPython version 1.12 released

Post by OutoftheBOTS_ » Mon Dec 23, 2019 5:56 am

MP continues to march forward.

A big Thanks to all the contributors. :)

kevinkk525
Posts: 735
Joined: Sat Feb 03, 2018 7:02 pm

Re: MicroPython version 1.12 released

Post by kevinkk525 » Mon Dec 23, 2019 7:19 am

That's a really big changelog with awesome features!
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

User avatar
pythoncoder
Posts: 4249
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: MicroPython version 1.12 released

Post by pythoncoder » Mon Dec 23, 2019 7:56 am

You guys have been working hard! Thank you for a great release.
Peter Hinch

User avatar
marfis
Posts: 197
Joined: Fri Oct 31, 2014 10:29 am
Location: Zurich / Switzerland

Re: MicroPython version 1.12 released

Post by marfis » Mon Dec 23, 2019 1:41 pm

THANKS to all the contributors - Great Christmas present👍

doublevee
Posts: 38
Joined: Mon Jul 02, 2018 11:09 pm

Re: MicroPython version 1.12 released

Post by doublevee » Mon Dec 23, 2019 8:21 pm

Thank you very much for this new version.

Happy Christmas to the MP Forum!

mcL
Posts: 9
Joined: Wed Dec 25, 2019 1:36 am

Re: MicroPython version 1.12 released

Post by mcL » Fri Dec 27, 2019 12:41 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).
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!)

User avatar
yeti
Posts: 8
Joined: Fri Jul 03, 2015 1:10 am

Re: MicroPython version 1.12 released

Post by yeti » Fri Dec 27, 2019 12:46 am

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).
I have a natural instinct for science. — D.J. Trump
"Don't we all wait for SOMETHING-ELSE-1.0?" — yeti
"Stay OmmmMMMmmmPtimistic!" — yeti

mcL
Posts: 9
Joined: Wed Dec 25, 2019 1:36 am

Re: MicroPython version 1.12 released

Post by mcL » Sat Dec 28, 2019 2:18 am

OK, thanks! I'll see if I can figure out how to do that...

Post Reply