MicroPython v1.12 Release Notes

Release Date: 2019-12-20 // over 4 years ago
  • ๐Ÿš€ 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.

    A detailed list of changes follows.

    py core:

    • ๐Ÿšš nativeglue: make private glue funs all static, remove commented code
    • nativeglue: remove dependency on mp_fun_table in dyn-compiler mode
    • obj: optimise small-int comparison to 0 in mp_obj_is_true
    • โช nlrthumb: save and restore VFP registers s16-s21 when CPU has them
    • mkrules.mk: use $(CPP) not $(CC) -E for preprocessor rule
    • define EMIT_MACHINE_CODE as EMIT_NATIVE || EMIT_INLINE_ASM
    • persistentcode: fix compilation with load and save both enabled
    • persistentcode: ensure prelude_offset is always initialised
    • asmarm: use __clear_cache on Linux/GCC when creating new asm code
    • nlrthumb: check thumb2 instead of ARM_ARCH_6M
    • objgenerator: add missing #if guard for PY_GENERATOR_PEND_THROW
    • asmarm: use __builtin___clear_cache instead of __clear_cache
    • ๐Ÿ‘‰ makeqstrdata.py: allow using \r\n as a qstr if a port requires it
    • scheduler: rename sched_stack to sched_queue
    • objstringio: guard bytesio_stream_p struct w/ MICROPY_PY_IO_BYTESIO
    • objdict: quote non-string types when used as keys in JSON output
    • builtinimport: populate file when importing frozen or mpy files
    • runtime: allow to override builtins. import with Python func
    • modio: call mp_import_name to do resource stream import
    • ๐Ÿ‘ allow to pass in read-only buffers to viper and inline-asm funcs
    • ๐Ÿ‘‰ showbc: fix off-by-one when showing address of unknown opcode
    • implement new sys.atexit feature
    • ๐Ÿ†“ objarray: fix amount of free space in array when doing slice assign
    • modmath: implement math.isclose() for non-complex numbers
    • introduce MP_UNREACHABLE macro to annotate unreachable code
    • nlr: use MP_UNREACHABLE at the end of arch-specific nlr_jump funcs
    • compile: improve the line numbering precision for comprehensions
    • emitbc: rewrite switch in load_const_tok to reduce code size
    • emitbc: make all emit_write_bytecode_* funcs take a stack_adj arg
    • objgenerator: move defn of mp_const_GeneratorExit_obj here
    • vm: shorten error message for not-implemented opcode
    • vm: don't add traceback info for exc's propagated through a finally
    • vm: don't add traceback info for exceptions that are re-raised
    • add global default_emit_opt variable to make emit kind persistent
    • compile: improve the line numbering precision for lambdas
    • bc: factor out code to get bytecode line number info into new func
    • profile: add initial implementation of sys.settrace feature
    • โ†” integrate sys.settrace feature into the VM and runtime
    • profile: add debugging for sys.settrace feature
    • objtuple: allow compatible subclasses of tuple in mp_obj_tuple_get
    • modstruct: fix struct.unpack with unaligned offset of native type
    • modstruct: fix struct.pack_into with unaligned offset of native type
    • binary: change mp_uint_t to size_t for index, size, align args
    • bc: fix size calculation of UNWIND_JUMP opcode in mp_opcode_format
    • mkenv.mk: add GDB variable
    • vm: factor cached map lookup code to inline function
    • mkrules.mk: add QSTR_GLOBAL_REQUIREMENTS variable for qstr auto-gen
    • ๐Ÿ persistentcode: enable persistent code saving for Windows ports
    • lexer: reorder operator tokens to match corresponding binary ops
    • ๐Ÿ“œ parse: use calculation instead of table to convert token to operator
    • compile: use calculation instead of switch to convert token to op
    • โž• add support for matmul operator @ as per PEP 465
    • bc0: order opcodes into groups based on their size and format
    • bc: replace big opcode format table with simple macro
    • introduce and use constants for multi-opcode sizes
    • split RAISE_VARARGS opcode into 3 separate ones
    • nlr.h: factor out constants to specific macros
    • emitnative: factor sizeof/offsetof calculations to macros
    • rename MP_QSTR_NULL to MP_QSTRnull to avoid intern collisions
    • nativeglue: make mp_fun_table fixed size regardless of config
    • persistentcode: bump .mpy version to 5
    • ringbuf: add helpers for put16/get16
    • bc: change mp_code_state_t.exc_sp to exc_sp_idx
    • add n_state to mp_code_state_t struct
    • compress first part of bytecode prelude
    • rework and compress second part of bytecode prelude
    • bc: don't include mp_decode_uint funcs when not needed
    • compile: disallow 'import *' outside module level
    • ๐Ÿšš makeqstrdefs.py: remove unused blacklist
    • vm: fix handling of unwind jump out of active finally
    • โš™ runtime: fix PEP479 behaviour throwing StopIteration into yield from
    • ๐Ÿ‘ emitnative: add support for archs with windowed registers
    • ๐Ÿ‘ emitnative: add support for using setjmp with native emitter
    • ๐Ÿ‘ emitnative: add support for archs that cannot read executable data
    • ๐Ÿ‘ asmxtensa: add support for Xtensa with windowed registers
    • โž• add new Xtensa-Windowed arch for native emitter
    • persistentcode: make .mpy more compact with qstr directly in prelude
    • objtype: add type. bases attribute
    • โš  mkrules.mk: add warning/error for invalid frozen config
    • objstr: size-optimise failure path for mp_obj_str_get_buffer
    • automatically provide weak links from "foo" to "ufoo" module name
    • modarray: rename "array" module to "uarray"
    • โš™ runtime: reorder some binary ops so they don't require conditionals
    • stream.h: add MP_STREAM_POLL_NVAL constant
    • nativeglue: remove unused mp_obj_new_cell from mp_fun_table
    • objgenerator: remove globals from mp_obj_gen_instance_t
    • objgenerator: allow pend_throw to an unstarted generator
    • ๐Ÿšš persistentcode: move declarations for .mpy header from .c to .h file
    • modsys: report .mpy version in sys.implementation
    • emitnative: fix typo, REG_PARENT_ARG_RET should be REG_PARENT_RET
    • emitnx86: make mp_f_n_args table match order of mp_fun_kind_t
    • ๐Ÿ‘ objdict: support ujson.dump() of OrderedDict objects
    • ringbuf: add peek16 method
    • compile: coalesce error message for break/continue outside loop
    • ๐Ÿ‘ป builtinimport: raise exception on empty module name
    • qstr: raise exception in qstr_from_strn if str to intern is too long
    • objstringio: slightly optimize stringio_copy_on_write for code size
    • objenumerate: check for valid args in enumerate constructor
    • persistentcode: add ability to relocate loaded native code
    • nativeglue: add new header file with native function table typedef
    • nativeglue: add funcs/types to native glue table for dynamic runtime
    • ๐Ÿ‘ persistentcode: make ARM Thumb archs support multiple sub-archs
    • nativeglue: add float new/get functions with both single and double
    • ๐Ÿ‘ dynruntime: add support for float API to make/get floats
    • dynruntime: implement uint new/get, mp_obj_len and mp_obj_subscr
    • ๐Ÿšš persistentcode: move loading of rodata/bss to before obj/raw-code

    extmod:

    • โž• add network-level class binding to cyw43 driver
    • factor out makefile rules from py.mk to new extmod.mk file
    • extmod.mk: integrate mbedTLS so it is built from source
    • ๐Ÿ— modussl_mbedtls: allow to build with object representation D
    • ๐Ÿ— extmod.mk: include mdns app source in lwIP build
    • uos_dupterm: add mp_uos_dupterm_poll to poll all dupterms
    • moduwebsocket: make close_resp static array const to not use RAM
    • modwebrepl: make prompt/ver static arrays const to not use RAM
    • modwebrepl: add config option to put filebuf[512] on stack/bss
    • modlwip: for TCP send keep trying tcp_write if it returns ERR_MEM
    • modlwip: use mp_sched_schedule to schedule socket callbacks
    • modlwip: implement raw sockets for lwIP
    • modure: make regex dump-code debugging feature optional
    • moducryptolib: use "static" not "STATIC" for inline functions
    • give vars/funcs unique names so STATIC can be set to nothing
    • ๐Ÿ‘ modujson: support passing bytes/bytearray to json.loads
    • crypto-algorithms: add source to header and populate copyright
    • vfs_posix: include stdio.h for declaration of function 'rename'
    • nimble: add nimble bindings
    • modbluetooth: add low-level Python BLE API
    • modbluetooth_nimble: implement modbluetooth API with Nimble
    • modbluetooth_nimble: use random addr if public isn't available
    • modbluetooth: allow MP_BLUETOOTH_MAX_ATTR_SIZE in board config
    • modbluetooth: allow config of scan interval/window
    • modbluetooth: use us instead of ms for advertising interval
    • modbluetooth: increase maximum connections from 1 to 4
    • ๐Ÿ›ฐ modbluetooth: clear gap_advertise payload when data is empty
    • modbluetooth: fix order of params to IRQ_GATTS_WRITE event
    • modbluetooth: improve ringbuf handling
    • modbluetooth: make gap_disconnect not raise when disconnected
    • modbluetooth: in gap_advertise only accept None to stop adv
    • ๐Ÿ‘ re1.5: support escaping within RE classes
    • ๐Ÿ‘ modbluetooth: make UUID support the buffer protocol
    • modbluetooth: persist reference to NimBLE service instances
    • modbluetooth_nimble: use data_alloc length to truncate writes
    • modbluetooth: rename module to "ubluetooth"
    • factor out block-device struct to make independent of fatfs
    • vfs_blockdev: factor out block device interface code
    • vfs_blockdev: add extended read/write methods
    • โž• add VFS littlefs bindings
    • vfs: rename BP_IOCTL_xxx constants to MP_BLOCKDEV_IOCTL_xxx
    • vfs: add MP_BLOCKDEV_IOCTL_BLOCK_ERASE constant
    • modbluetooth: add gatts_set_buffer
    • vfs_lfs: allow compiling in VfsLfs1 and VfsLfs2 separately
    • modlwip: unconditionally return POLLHUP when polling new socket
    • ๐Ÿ“Š modlwip: make socket poll return POLLNVAL in case of bad file
    • modlwip: unconditionally return POLLHUP/POLLERR when polling
    • modussl_mbedtls: fix getpeercert to return None if no cert avail
    • modussl_mbedtls: check for invalid key/cert data
    • ๐Ÿšš nimble: remove unneeded nimble_sprintf wrapper function
    • nimble: factor out stm32-specific HCI UART RX/TX code
    • modbtree: make FILEVTABLE const to put it in ROM
    • convert nlr_raise(mp_obj_new_exception_msg(x)) to mp_raise_msg(x)
    • vfs: add autodetect of littlefs filesystem when mounting
    • consolidate FAT FS config to MICROPY_VFS_FAT across all ports
    • modbluetooth: prioritise non-scan-result events
    • modbluetooth: create UUID from bytes and allow comparison ops
    • modbluetooth_nimble: make gap_scan_stop no-op if no scan ongoing
    • modbluetooh_nimble: fix UUID conversion for 16 and 32 bit values
    • modbluetooth: simplify management of pre-allocated event data
    • vfs_lfs: pass flag along to ioctl when init'ing bdev for lfs
    • vfs_lfs: fix bug when passing no args to constructor and mkfs
    • โฑ modbluetooth: simplify how BLE IRQ callback is scheduled
    • ๐Ÿšš modbluetooth: remove limit on data coming from gattc data input
    • modbluetooth: add optional 4th arg to gattc_write for write mode
    • modbluetooth: allow setting ringbuf size via BLE.config(rxbuf=)
    • ๐Ÿ–จ modbtree: use mp_printf instead of printf
    • โž• add dynamic-runtime guards to btree/framebuf/uheapq/ure/uzlib
    • ๐Ÿšš webrepl: move webrepl scripts to common place and use manifest

    lib:

    • โฌ†๏ธ cmsis: upgrade to CMSIS 5.5.1
    • netutils: add DHCP server component
    • โž• add new submodule for mbedtls, currently at v2.17.0
    • utils/sys_stdio_mphal: add support to poll sys.stdin and sys.stdout
    • โž• add asf4 as a submodule
    • โž• add tinyusb as a submodule
    • โšก๏ธ stm32lib: update library for updated H7xx, new L0xx, new WBxx
    • lwip: update lwIP to v2.1.2, tag STABLE-2_1_2_RELEASE
    • mynewt-nimble: add Apache mynewt nimble as a submodule
    • littlefs: add littlefs v1.7.2 source
    • littlefs: add littlefs v2.1.3 source
    • littlefs: add README describing origin and how to gen lfs1/lfs2
    • libc/string0: add simple implementations of strspn and strcspn

    drivers:

    • โž• add driver for CYW43xx WiFi SoCs
    • ๐Ÿ‘ memory/spiflash: add support to put SPI flash in sleep mode
    • cyw43: add low-level CYW43xx Bluetooth HCI UART driver
    • ๐Ÿ‘ onewire/ds18x20.py: add support for DS1822 sensor
    • ๐Ÿ‘ป sdcard: raise exception on timeout of readinto
    • ๐Ÿ›  wiznet5k: allow selecting maximum fixed buffer size for MACRAW

    tools:

    • mpy-tool.py: fix linking qstrs in native code, and multiple files
    • mpy-tool.py: fix linking of qstr objects in native ARM Thumb code
    • โž• add uf2conv.py from Microsoft/uf2 repository
    • pyboard.py: add filesystem commands to ls/cat/cp/rm remote files
    • mpy-tool.py: force native func alignment to halfword/word on ARM
    • ๐Ÿ‘ mpy-tool.py: add initial support for frozen with settrace
    • mpy-tool.py: fix freezing of non-bytecode funcs with settrace
    • ๐Ÿ‘‰ make-frozen.py: allow to run with no directory passed in
    • โž• add mechanism to provide a manifest of frozen files
    • ๐Ÿ‘‰ makemanifest.py: eval relative paths w.r.t. current manifest file
    • mpy-tool.py: use "@progbits #" attribute for native xtensa code
    • ๐Ÿ‘‰ makemanifest.py: follow symlinks when freezing linked directories
    • โš  makemanifest.py: skip freezing unsupported files with warning
    • ๐Ÿ‘‰ makemanifest.py: use sys.executable when invoking Python scripts
    • ๐Ÿ‘ mpy-tool.py: support qstr linking when freezing Xtensa native mpy
    • ๐Ÿ”€ mpy-tool.py: add ability to merge multiple .mpy files into one
    • mpy_ld.py: add new mpy_ld.py tool and associated build files
    • ๐Ÿ‘ป mpy-tool.py: raise exception if trying to freeze relocatable mpy
    • ๐Ÿ‘ pyboard.py: support executing .mpy files directly
    • โœ… tinytest-codegen.py: add extra newline and result message

    โœ… tests:

    • โœ… rename "bench" tests to "internal_bench" and run-internalbench.py
    • โž• add performance benchmarking test-suite framework
    • ๐ŸŽ perf_bench: add some benchmarks from python-performance
    • ๐ŸŽ perf_bench: add some miscellaneous performance benchmarks
    • ๐ŸŽ perf_bench: add some viper performance benchmarks
    • stress/recursive_iternext.py: increase large depth to 5000
    • โœ… run-perfbench.py: add --emit option to select emitter for tests
    • add tests for overriding builtins. import
    • โœ… misc/sys_atexit: add test for new sys.atexit feature
    • โšก๏ธ unix: update extra_coverage expected output with new atexit func
    • โœ… extmod: split json.loads of bytes/bytearray into separate test
    • โœ… split out test for optimisation level and line-no printing
    • โž• add tests for sys.settrace feature
    • โœ… basics: add test for matmul operator
    • โšก๏ธ update tests for changes to opcode ordering
    • โœ… micropython: add test for native generators
    • โœ… basics: add test for getting name of func with closed over locals
    • โœ… basics: add test for throw into yield-from with normal return
    • perf_bench: add bm_fft test
    • โš™ run-perfbench.py: show error when truth check fails
    • โœ… run-perfbench.py: skip complex tests if target doesn't enable it
    • cpydiff: fix typo in types_bytes_keywords.py doc comments
    • ๐Ÿ“‡ rename "array" module to "uarray"
    • โœ… extmod: add littlefs tests
    • โœ… extmod: add test for blockdev with standard and extended protocol
    • basics: use str.format instead of % for formatting messages
    • basics/builtin_dir.py: look for "version" in dir(sys)
    • โž• add feature check for bytearray and skip corresponding tests
    • โœ… basics: split out specific bytearray tests to separate files
    • basics: use bytes not bytearray when checking user buffer proto
    • โž• add feature check for slice and skip corresponding tests
    • โœ… basics: split out specific slice tests to separate files
    • โœ… run-tests: add misc list of tests that use slice, to skip them
    • โœ… basics: automatically skip tests that use str/bytes modulo-format
    • โž• add feature check for uio module and skip corresponding tests
    • โœ… basics: split sys.exit test to separate file so it can be skipped
    • โœ… extmod: add test for ussl when passing in key/cert params
    • โœ… stress: add test for maximum length limit of qstrs
    • โœ… import: add test for importing viper code with additional flags
    • โž• add script to run dynamic-native-module tests
    • โž• add .exp files for basics/parser and import/import_override
    • stress/qstr_limit: tune params to run with stm32 port
    • basics/memoryview_itemsize: make portable to 32- and 64-bit archs
    • extmod/vfs_lfs_error: use small ints in seek error test
    • ๐Ÿ”จ pyb: refactor pyboard tests to work on PYBv1, PYBLITEv1 and PYBD

    mpy-cross:

    • ๐Ÿ— do not automatically build mpy-cross, rather do it manually
    • main: only accept full emit cmdline options if native enabled
    • ๐Ÿ‘‰ make mpconfigport.h compatible with msvc compiler
    • โž• add msvc build of mpy-cross
    • set number of registers in nlr_buf_t based on native arch
    • enable Xtensa-Windowed native emitter
    • ๐Ÿ‘Œ support armv7em, armv7emsp, armv7emdp architectures
    • README.md: add notes about -march and -O

    all ports:

    • provide mp_hal_stdio_poll for sys.stdio polling where needed
    • โž• add new make target "submodules" which inits required modules

    minimal port:

    • ๐Ÿ‘‰ use soft float for CROSS=1 Cortex-M4 target
    • โœ… frozentest: recompile now that mpy version has changed
    • set CSUPEROPT=-Os to get minimal firmware size

    unix port:

    • โšก๏ธ mpconfigport.mk: update comment about TLS implementations
    • unix_mphal: use CLOCK_MONOTONIC for ticks_ms/us when available
    • enable sys.atexit, triggered after the main script ends
    • main: only accept full emit cmd-line options if native enabled
    • โœ… coverage: add coverage tests for ringbuf
    • convert to use FROZEN_MANIFEST to specify frozen code
    • enable module weak links
    • ๐Ÿ— enable uos.VfsLfs1, uos.VfsLfs2 on coverage build
    • modtermios: fix output speed setter in tcsetattr

    ๐Ÿ windows port:

    • mpconfigport.h: define empty MP_WEAK symbol
    • mpconfigport.h: don't define restrict/inline/alignof for C++
    • โš  msvc: treat compiler warnings as errors
    • Makefile: make use of CFLAGS_EXTRA, LDFLAGS_EXTRA and SRC_MOD
    • ๐Ÿšš msvc: remove unneeded definitions for qstr generation
    • ๐Ÿ— msvc: move build options from .vcxproj to .props files
    • ๐Ÿ— msvc: enable overriding directories used in the build
    • msvc: change the way sources are listed
    • 0๏ธโƒฃ default to binary mode for files
    • enable module weak links

    qemu-arm port:

    • โž• add testing of frozen native modules
    • convert to use FROZEN_MANIFEST to specify frozen code
    • โž• add ldscript dependency in the final firmware.elf target
    • ๐Ÿ— let tinytest.o be built by standard build rules
    • ๐Ÿ‘‰ Makefile: allow overriding CROSS_COMPILE from another makefile

    stm32 port:

    • ๐Ÿ”จ usb: refactor CDC VCP code to enable N CDC interfaces
    • ๐Ÿ‘ usb: support up to 3 VCP interfaces on USB device peripheral
    • ๐Ÿ“Œ boards/make-pins.py: allow pins.csv to skip or hide board-pin name
    • boards/pllvalues.py: search nested headers for HSx_VALUE defines
    • boards: add board definition files for PYBD -SF2, -SF3, -SF6
    • modpyb: add pyb.country() function to set the country
    • extint: add extint_set() function for internal C access to EXTI
    • ๐Ÿ‘ mphalport: add support for having MAC in OTP region
    • โž• add low-level SDIO interface for cyw43 driver
    • โ†” integrate in the cyw43 driver and network.WLAN class
    • boards/PYBD_SFx: enable CYW43 WLAN driver
    • modnetwork: replace generic netif NIC polling with specific code
    • โ†” integrate optional mbedTLS component for ussl module
    • boards/PYBD_SFx: enable ussl module using mbedTLS
    • ๐Ÿ‘Œ support optional lwIP mDNS responder
    • โšก๏ธ lwip_inc: update to enable mDNS, TCP listen backlog, faster DHCP
    • ๐Ÿ‘ usbd_msc: rework USBD MSC code to support multiple logical units
    • usbd_msc: provide custom irquiry processing by MSC interface
    • usbd_msc: provide Mode Sense response data in MSC interface
    • usb: use ARG_xxx enums to access kw args in pyb_usb_mode
    • usb: add "msc" kw-arg to pyb.usb_mode to select MSC logical units
    • usbd_msc: allow to compile when USB enabled and SD card disabled
    • in link script, define start of stack separately from heap end
    • boards: enable ussl module via mbedtls for boards with network
    • ๐Ÿ–จ Makefile: print info messages about use of mboot/QSPI flash
    • enter bootloader via a system reset
    • boards/pllvalues.py: support HSx_VALUE defined without uint32_t
    • boards: add stm32??xx_hal_conf_base.h files with common settings
    • boards: rework all stm32??xx_hal_conf.h files to use common code
    • usb: fix regression with auto USB PID value giving PID=0xffff
    • boards: optimise flash and RAM allocation for L4 boards
    • ๐Ÿ”ง mpu: add helper functions for configuring MPU
    • ๐Ÿ”ง eth: use MPU helper functions to configure MPU for ETH use
    • ๐Ÿ”ง sdram: use MPU helper functions to configure MPU for SDRAM use
    • qspi: use MPU to allow access to valid memory-mapped QSPI region
    • qspi: force a reset of the QSPI peripheral when initialising it
    • qspi: handle bus acquisition
    • powerctrl: add hooks for a board to perform actions on sleep/wake
    • boards/PYBD_SFx: put SPI flash to sleep during sleep modes
    • mpconfigport.h: enable useful networking modules if lwIP enabled
    • ๐Ÿ‘ usb: add support to auto-detect USB interface, either FS or HS
    • usb: add "port" keyword argument to pyb.usb_mode, to select FS/HS
    • spi: factor out code to calculate SPI source frequency
    • ๐Ÿ‘ extint: simplify bitband support config for different MCUs
    • modmachine: make RTC class available in machine module
    • boards/PYBD_SF2: put mbedtls library code in external QSPI flash
    • โšก๏ธ update components to work with new H7xx HAL
    • ๐Ÿšš Makefile: remove Wno-attributes for ll_usb HAL file
    • Makefile: use startup_stm32*.s file from stm32lib
    • boards: remove startup_stm32*.s files now they are in stm32lib
    • mpu: include MPU functions when ETH is enabled
    • ๐Ÿšง lwip_inc: define LWIP_NO_CTYPE_H=1 to use lwIP ctype funcs
    • modmachine: disable IRQs before entering bootloader
    • ๐Ÿ”ง boards/PYBD_SFx: configure EN_3V3 pin as output on boot
    • sdcard: add hook for a board to power on SD/MMC
    • boards/PYBD_SFx: automatically turn on EN_3V3 when powering SD/MMC
    • โž• add initial support for STM32L0xx MCUs
    • ๐Ÿ‘ boards: add MCU support files for STM32L072
    • ๐Ÿ”ง mpconfigport.h: make "framebuf" module configurable by a board
    • boards/NUCLEO_L073RZ: add definition files for new board
    • ๐Ÿšš powerctrl: move L0's SystemClock_Config to powerctrlboot.c file
    • ๐Ÿšš powerctrl: move F0's SystemClock_Config to powerctrlboot.c
    • โœ‚ remove SystemInit funcs, use stm32lib versions instead
    • boards/NUCLEO_F446RE: enable DAC
    • โž• add support for STM32L452 MCUs
    • boards/NUCLEO_L452RE: add definition files for new board
    • ๐Ÿšš boards/NUCLEO_F413ZH: remove STARTUP_FILE, it's defined globally
    • โš  mboot: make _estack an array to avoid compiler warnings
    • โšก๏ธ mboot: remove use of BSRRL/H for H7 MCUs due to stm32lib update
    • mboot: use STARTUP_FILE from stm32lib
    • โšก๏ธ mboot: update dependencies to enable parallel build with -j
    • boards/B_L072Z_LRWAN1: add definition files for new board
    • gccollect: always use MP_STATE_THREAD(stack_top) to get stack top
    • usb: add config options to disable USB MSC and/or HID
    • usbd_cdc_interface: make CDC TX/RX buffer sizes configurable
    • โž• add support for USB on L0 MCUs
    • powerctrlboot: increase SYSCLK to 32MHz for L0 MCUs
    • mphalport: fix GPIO clock enable for L0 MCUs
    • ๐Ÿ‘‰ Makefile: allow a board to disable float support
    • boards/B_L072Z_LRWAN1: enable USB VCP support
    • boards/STM32F769DISC: fix length of FLASH_APP section
    • ๐Ÿ‘‰ make-stmconst.py: allow more variation in parens and int-suffix L
    • โž• add initial support for STM32WBxx MCUs
    • ๐Ÿ‘ boards: add MCU support files for STM32WB55
    • boards/NUCLEO_WB55: add definition files for new board
    • boards/USBDONGLE_WB55: add definition files for new board
    • ๐Ÿ‘ flashbdev: support internal filesystem on STM32F722/23/32/33
    • boards/stm32f722.ld: provide memory regions for internal FS
    • boards/NUCLEO_F722ZE: add definition files for new board
    • dma: fix re-start of DMA stream by clearing all event flags
    • usbd_hid_interface: rewrite USB HID interface code
    • boards/xxx_WB55: enable USB HID now that it works on WB MCUs
    • usbd_hid_interface: include extra header to build with threading
    • lwip_inc: enable raw socket type
    • mpconfigport.h: enable lwIP raw sockets
    • ๐Ÿ”ง sdcard: support configuring the SD/MMC bus width to 1 or 4 bits
    • modpyb: support building with PY_PYB_LEGACY on and HW_USB_HID off
    • usbd: introduce MICROPY_HW_USB_IS_MULTI_OTG to simplify USB config
    • ๐Ÿ‘ usbd: support USB device mode on STM32L432 MCUs
    • ๐Ÿ‘ boards/NUCLEO_L432KC: add config for USB VCP support
    • ๐Ÿ”ง usbd: make USB device FIFO sizes dynamically configurable
    • i2c: fix generation of restart condition for hw I2C on F0/F7
    • mphalport: put PYBD specific MAC code in board specific file
    • ๐Ÿ— mboot/Makefile: define "BUILDING_MBOOT" when building mboot
    • ๐Ÿ— boards/PYBD_SF2: exclude certain things when building mboot
    • extint: fix EXTI mapping of PVD and RTC events for H7 MCUs
    • stm32_it: include correct EXTI interrupt handlers for L0 MCUs
    • dma: fix DMA config for L0 MCUs
    • powerctrl: fix machine.bootloader() for L0 MCUs
    • machine_adc: add machine.ADC class
    • machine_adc: improve operation of ADC for H7, L4 and WB MCUs
    • ๐Ÿ“Œ boards/stm32wb55_af.csv: fix ADC pin-channel function mapping
    • ๐Ÿ‘ mboot: support boards with only two LEDs
    • boards/NUCLEO_L073RZ: fix typo in MCU name
    • boards/MIKROE_CLICKER2_STM32: add MikroElektronika Clicker2 board
    • boards/STM32F769DISC: fix number of SDRAM row bits
    • board/NUCLEO_F746ZG: enable Ethernet periph, lwip and ussl
    • ๐Ÿ‘ usb: add support for VCP+MSC+HID mode, incl 2xVCP and 3xVCP
    • usb: verify number of used endpoints doesn't exceed maximum
    • lwip_inc: allocate additional MEMP_SYS_TIMEOUT when mDNS enabled
    • ๐Ÿšง lwip_inc: enable LWIP_NETIF_EXT_STATUS_CALLBACK for mDNS
    • ๐Ÿ— machine_adc: fix build for F4 and L4 MCUs that only have ADC1
    • modusocket: fix NULL deref when accept() an unbound socket
    • machine_i2c: add ability to specify I2C(4) by name
    • can: factor CAN driver into low-level and Python bindings
    • โž• add support for FDCAN peripheral, exposed as pyb.CAN
    • boards/NUCLEO_H743ZI: enable FDCAN on this board
    • ๐Ÿ–จ use mp_printf with MICROPY_ERROR_PRINTER for uncaught exceptions
    • can: guard header file by MICROPY_HW_ENABLE_CAN
    • usbd_cdc_interface: add CTS flow control option for USB VCP
    • ๐Ÿ‘Œ support disabling the compiler
    • powerctrlboot: fix clock and PLL selection for HSI48 on F0 MCUs
    • ๐Ÿ‘ powerctrlboot: add support for HSI at 8MHz on F0 MCUs
    • ๐Ÿ”ง uart: add RTS/CTS pin configuration support to UART4
    • provide port-specific implementation for Nimble on STM32
    • mpconfigport.h: add modbluetooth module to stm32
    • boards/PYBD: enable BLE for Pyboard D
    • ๐Ÿ‘ system_stm32: support selection of HSE and LSI on L4 MCUs
    • boards: enable MICROPY_HW_RTC_USE_LSE on L4 boards
    • {adc,machine_adc}: change ADC clock and sampling time for F0 MCUs
    • usbdev: fix compile error if MICROPY_HW_USB_CDC_NUM is set to 2
    • boards/PYBD_SF2: put nimble library in external QSPI XIP flash
    • extract port-specific Nimble implementation
    • mboot: add option to automatically reset when USB is disconnected
    • ๐Ÿ“Œ sdcard: support boards with no SD card detect pin
    • ๐Ÿ‘‰ use hardware double sqrt on F7/H7 MCUs
    • boards: add new board ADAFRUIT_F405_EXPRESS
    • convert to use FROZEN_MANIFEST to specify frozen code
    • โšก๏ธ adc: update ADC driver to work with the new H7 HAL
    • ๐Ÿšš adc: remove unused macro and channel check, and fix spacing
    • adc: use IS_CHANNEL_INTERNAL macro to check for internal channels
    • adc: fix sampling for internal channels on H7 MCUs
    • ๐Ÿ”ง mpu: save and restore the IRQ state when configuring MPU
    • accel: rename MMA I2C macro constants to make it generic
    • ๐Ÿ‘ accel: add support for KXTJ3
    • boards: add NADHAT_PYB405 board
    • accel: fix Accel.read() method so it does read a byte
    • powerctrlboot: fix config of systick IRQ priority on F0/L0/WB MCU
    • sdram: fix to use new mpu_config_start/mpu_config_end signature
    • ๐Ÿ‘‰ Makefile: only enable hardware sqrt on parts that support it
    • timer: fix Timer.freq() calc so mult doesn't overflow uint32_t
    • โž• add soft timer implementation, using SysTick at 1ms resolution
    • โž• add machine.Timer with soft timer implementation
    • โž• add support for RF coprocessor on WB55 MCUs
    • ๐Ÿ‘ boards: enable support for bluetooth on WB55 boards
    • mpthreadport: include runtime.h to get defn of mp_raise_msg
    • boards/stm32f405_af.csv: fix typo in ETH_RMII_REF_CLK on PA1
    • nimble_hci_uart.c: prevent scheduler running during CYW-BT wakeup
    • ๐Ÿ‘ generalise flash mounting code so it supports arbitrary FS
    • ๐Ÿ”ง storage: make pyb.Flash configurable, and support ext block proto
    • main: auto detect block device used for main filesystem
    • moduos: add VfsLfs1 and VfsLfs2 to uos module, if enabled
    • boards: enable LFS2 on PYBv1.x and PYBD boards
    • storage: change storage_read/write_blocks to return int type
    • storage: make start/len args of pyb.Flash keyword only
    • ๐Ÿšš qstrdefsport.h: remove unused qstrs and make USB ones conditional
    • ๐Ÿ“Œ boards/NUCLEO_L073RZ: skip board-pin names for CPU only pins
    • main: fix auto creation of pyb.Flash on boot with kw-only args
    • mpconfigport.h: use IRQ_PRI_PENDSV to protect bluetooth ringbuf
    • ๐Ÿ‘ uart: add support for UART4/5 on L0 MCUs
    • boards/xxx_WB55: enable littlefs2 on WB55 boards
    • 0๏ธโƒฃ main: fix SKIPSD file detection so SD card is mounted by default
    • ๐Ÿ‘‰ Makefile: enable max buffer size on W5200 NIC when used with lwIP
    • modusocket: handle case of NULL NIC in socket ioctl
    • ๐Ÿ”ง boards/PYBD_SF2: configure LEDs as inverted, for LED.intensity()
    • boards/NUCLEO_F767ZI: add pins and config for using an SD card
    • โšก๏ธ boards/NUCLEO_F767ZI: update pins, peripherals and total flash
    • boards/NUCLEO_H743ZI: add extra pins and peripheral definitions
    • timer: add missing TIM 1/15/16/17 IRQ handlers for H7 MCUs
    • boards/PYBD: include webrepl helper scripts in frozen manifest

    esp8266 port:

    • uart: fix invalid ringbuf name when event driven REPL enabled
    • provide custom machine_time_pulse_us that feeds soft WDT
    • mpconfigport.h: enable lwIP raw sockets
    • machine_uart: allow remapping UART TX/RX pins from 1/3 to 15/13
    • put new profile code in iROM
    • machine_adc: rename pyb_adc_* to machine_adc_*
    • machine_adc: add read_u16 method and refactor
    • โž• add per-board configs, following other ports
    • modules/ntptime.py: always close socket, and set day-of-week
    • convert to use FROZEN_MANIFEST to specify frozen code
    • ๐Ÿ‘ allow building without a manifest
    • ๐Ÿš€ boards: add manifest_release.py with files for a release
    • ๐Ÿ‘ modules/flashbdev.py: support extended block protocol
    • ๐Ÿ‘ moduos: add optional support for VfsLfs1 and VfsLfs2

    esp32 port:

    • machine_timer: reuse Timer handles, deallocate only on soft-reset
    • โž• add machine.SDCard class using built-in HW SD/MMC controller
    • โšก๏ธ update to use ESP IDF v3.3-beta3
    • modnetwork: still try to reconnect to WLAN even with AUTH_FAIL
    • ๐Ÿ— Makefile: include all driver/*.c source files in the build
    • network_ppp: add ppp_set_usepeerdns(pcb, 1) when init'ing iface
    • โž• add support for hardware I2C
    • Makefile: fix path expansion for ESPIDF_DRIVER_O
    • Makefile: put OBJ and LIB rule additions in gen_espidf_lib_rule
    • ๐Ÿ‘‰ Makefile: simplify include of IDF source by using wildcards
    • ๐Ÿ“Œ pin MicroPython tasks to a specific core
    • ๐Ÿ‘‰ Makefile: include CFLAGS_EXTRA in CFLAGS definition
    • ๐Ÿ‘ network_ppp: add authentication support to the PPP interface
    • โž• add support for mDNS queries and responder
    • modules: on initial setup mount internal flash at root
    • โž• add per-board configs, following other ports
    • โž• add esp32.Partition class to expose partition and OTA funcs
    • โž• add 'config' function to network.LAN, reusing network.WLAN
    • Makefile: fix subst->patsubst in ESPIDF_BOOTLOADER_SUPPORT_O
    • machine_adc: add ADC.read_u16() method
    • โšก๏ธ update to use ESP IDF v3.3
    • boards/TINYPICO: switch to use QIO and 80MHz for SPI interface
    • โž• add VFS FAT partition to partitions.csv and mount it as the FS
    • โž• add support for ESP32-D2WD with 2MiB internal flash
    • modules/inisetup.py: use bdev.ioctl instead of bdev.SEC_SIZE
    • Makefile: add SDKCONFIG_H to QSTR_GLOBAL_REQUIREMENTS
    • ๐Ÿ‘Œ support building with ESP IDF 4.0-beta1
    • โž• add check to Makefile for pyparsing version
    • โž• add check to Makefile that the toolchain is in PATH
    • main: use both 3.3 and 4.0 config vars to enable SPIRAM
    • ๐Ÿ–จ Makefile: fix printing of supported git hash
    • enable native emitter
    • implement BLE using Nimble from IDF 4.x
    • ๐Ÿ— boards: enable BLE by default when building with IDF 4.x
    • โž• add 4.x version of IDLE WDT config
    • โš™ run NimBLE on the app core
    • convert to use FROZEN_MANIFEST to specify frozen code
    • machine_uart: add ability to invert UART pins
    • 0๏ธโƒฃ boards: split out CPU frequency config, make 160MHz the default
    • machine_hw_spi: fix exception msg when host is already in use
    • Makefile: add correct arch to MPY_CROSS_FLAGS for native code
    • โœ‚ remove unused "esponewire.c" in favour of extmod/modonewire
    • ๐Ÿ‘ esp32_partition: support extended block protocol
    • moduos: enable uos.VfsLfs2 for littlefs filesystems
    • boards/sdkconfig.base: resize SSL output buffer from 16 to 4kiB
    • rtc: set system microseconds when setting time via RTC.datetime()
    • ๐Ÿ”ง machine_rtc: make RTC.memory size and availability configurable
    • ๐Ÿ–จ machine_rtc: reduce memory footprint of user mem functionality
    • ๐Ÿ”ง boards: enable ULP in base sdk configuration
    • boards/TINYPICO: add tinypico.py, dotstar.py with custom manifest
    • ๐Ÿ‘ esp32_rmt: add initial support for RMT peripheral

    javascript port:

    • enable support for frozen bytecode via FROZEN_MPY_DIR

    nrf port:

    • led: adjust how board LEDs are defined
    • clean up source by removing tabs, trailing spaces, non-ASCII chars
    • machine/adc: add ADC.read_u16() method
    • โž• add ADC channel mapping to alt function table
    • ๐Ÿ“Œ machine/adc: allow to pass a Pin object in to ADC constructor
    • ๐Ÿ“Œ machine/adc: fix mapping of ADC channel to pin
    • boards/make-pins.py: fix gen of board pins to use correct index
    • ๐Ÿ‘‰ Makefile: add support for flashing with a Black Magic Probe
    • ๐Ÿ”ง boards: add Particle Xenon board configuration (an nRF52840)
    • boards: add board definition for uBlox Nina B1 series BLE modules
    • ๐Ÿ‘ i2c: add support for TWIM (EasyDMA)
    • ๐Ÿ”ง temp: move module configuration guard
    • ๐Ÿ‘ uart: add support for UARTE (EasyDMA)
    • โšก๏ธ flash: update flash driver to use nrfx_nvmc driver
    • led: expose public API for LED manipulation
    • โšก๏ธ main: update the way the LED is used on startup
    • add support to activate MICROPY_PY_SYS_STDFILES
    • device: correct SPIM3 IRQ handler entry for nrf52840
    • โž• add tinyusb support for nrf52840
    • ๐Ÿ‘ boards: add support for pca10059
    • โž• add nrf9160 base support
    • boards: add nrf9160 pca10090 board
    • main: execute boot.py/main.py frozen modules without a file system
    • boards/particle_xenon: enable USB CDC on Particle Xenon board

    powerpc port:

    • โž• add initial port to bare metal PowerPC arch

    samd port:

    • โž• add new port to Microchip SAMDxx microcontrollers
    • ๐Ÿ‘‰ make common linker scripts, rename board.mk to mpconfigboard.mk
    • ๐Ÿ”ง boards: add Adafruit Feather M0 Express board configuration
    • ๐Ÿ”ง boards: add Mini SAM M4 board configuration
    • โž• add minimum config for Atmel SAMD21-XPLAINED-PRO board

    zephyr port:

    • main: use mp_stack API instead of local pointer for stack top

    ๐Ÿ“„ docs:

    • ๐Ÿ“„ machine: add initial docs for new machine.SDCard class
    • library/framebuf: add missing module reference in example code
    • ๐Ÿ“š library/sys: add documentation for sys.atexit function
    • โšก๏ธ pyboard: update name of mounted volume to match code
    • pyboard: clarify initial files on pyboard and fix up formatting
    • library: document that sys.version_info returns a 3-tuple only
    • pyboard: emphasize the instructions for making a USB mouse
    • โšก๏ธ reference/speed_python: update that read-only buffers are accepted
    • reference/speed_python: add missing self to var caching example
    • library/pyb.DAC.rst: correct frequency for triangle mode output
    • ๐Ÿ“„ rename machine.ADC docs to machine.ADCWiPy
    • library: specify new machine.ADC class
    • โšก๏ธ library/pyb.rst: update docs for pyb.usb_mode() function
    • โšก๏ธ library/pyb.rst: update pyb.usb_mode() to mention VCP+MSC+HID
    • library/pyb.USB_VCP.rst: add info about id and flow params
    • ๐Ÿ“š develop/qstr.rst: add documentation for string interning
    • ๐Ÿ“š library/bluetooth: add initial BLE documentation
    • reference/glossary.rst: add new terms and reduce complexity of old
    • library/bluetooth.rst: clarify gap_advertise adv_data behavior
    • library/bluetooth.rst: explain how to increase char buffer size
    • library/bluetooth.rst: fix typo in HR/UART services example
    • esp8266/tutorial: make http_get sample function self contained
    • library: clarify relation between machine and port-specific mods
    • esp8266: add ntptime usage to esp8266 quickref
    • ๐Ÿ›  fix spelling in various parts of the docs
    • wipy/tutorial: link Blynk examples to the official library
    • library: rename "array" module to "uarray"
    • library/bluetooth: rename to "ubluetooth"
    • ๐Ÿšš move ubluetooth under "MicroPython-specific libraries"
    • ๐Ÿ“š library: add documentation for extended block device protocol
    • library/ubluetooth: add docs for gatts_set_buffer
    • conf.py: fix path to favicon.ico
    • ๐Ÿ—„ templates/topindex.html: replace usage of deprecated defindex.html
    • โœ๏ธ library/machine.SDCard.rst: fix various typos
    • library/ubluetooth: fix name and link to FLAG_xxx constants
    • ๐Ÿ“„ reference: add docs describing use of pyboard.py
    • ๐Ÿ“„ library: add docs for pyb.Flash class
    • โž• add littlefs docs and a filesystem tutorial
    • reference/filesystem: fix typo in block device code example
    • reference/filesystem: add note and example about using filesystem
    • library/ubluetooth: add note about API being under development
    • library/uos: add notes and links about littlefs failures
    • library/uos.rst: clarify why the extended interface exists
    • ๐Ÿ‘ esp8266/quickref: add note that machine.RTC is not fully supported
    • ๐Ÿ“š reference: add documentation describing use of .mpy files
    • ๐Ÿ“š develop: add documentation on how to build native .mpy modules
    • ๐Ÿ“„ esp32: add quickref and full docs for esp32.RMT class

    travis:

    • ๐Ÿ— build PYBD_SF2 board as part of the stm32 job
    • selectively fetch git submodules only when needed
    • ๐Ÿ— build esp8266 firmware as part of Travis CI
    • ๐Ÿ— build esp32 firmware as part of Travis CI
    • ๐ŸŽ enable performance benchmark tests on standard unix build
    • โž• add samd port to Travis build
    • ๐Ÿ— build stm32 mboot for PYBD_SF6 as part of CI
    • ๐Ÿ— switch unix stackless build to use clang
    • ๐Ÿ— build an stm32 board with threading enabled to test it with CI
    • โž• add new job to test unix port with sys.settrace enabled
    • โž• add ESP32 build with IDF v4
    • ๐Ÿ— build more stm32 boards to cover all supported MCUs
    • ๐Ÿ— build unix nanbox with PYTHON=python2
    • โž• add BLE submodules to ESP32 IDF4 build
    • โž• add esp8266 GENERIC_512K build to CI
    • ๐Ÿ‘‰ use "make submodules" to init required modules for each port
    • โž• add job to build and test unix minimal port
    • โž• add tests for building and importing dynamic native modules
    • ๐Ÿ— build urandom native module in coverage job

    examples:

    • bluetooth: add basic BLE peripheral examples
    • ๐Ÿ›ฐ bluetooth: use UUIDs directly to add services to adv payload
    • bluetooth/ble_uart_peripheral.py: add usage demo
    • embedding: replace symlink of mpconfigport.h with real file
    • bluetooth/ble_uart_peripheral: use append mode for RX char
    • ๐Ÿ— embedding: remove obsolete fatfs files from build
    • ๐Ÿ›ฐ bluetooth: add helpers for decoding advertising payloads
    • bluetooth: add example for reading temperature sensor
    • natmod: add btree example
    • natmod: add uheapq example
    • natmod: add uzlib example
    • natmod: add framebuf example
    • natmod: add ure example
    • natmod: add features1 and features2 examples
    • natmod: add urandom native module example
    • โœ… network: add testing key/cert to SSL HTTP server example
    • natmod: add very simple features0 example to compute factorial

    miscellaneous:

    • top: add CODEOFCONDUCT.md document based on the PSF code of conduct
    • ๐Ÿ— gitignore: put build-*/ pattern in top-level gitignore file
    • gitattributes: mark *.a files as binary