MicroPython change log ======== Tue, 20 Feb 2024 22:59:55 +1100 v1.22.2 Patch release for rp2 DMA, UART and BLE, esp32 BLE, renesas-ra I2C This is a patch release containing the following commits: - py/compile: fix potential Py-stack overflow in try-finally with return - extmod/asyncio: support gather of tasks that finish early - extmod/modssl_mbedtls: fix cipher iteration in SSLContext.get_ciphers - extmod/btstack: reset pending_value_handle before calling write-done cb - extmod/btstack: reset pending_value_handle before calling read-done cb - esp32/mpnimbleport: release the GIL while doing NimBLE port deinit - esp32: increase NimBLE task stack size and overflow detection headroom - mimxrt/modmachine: fix deepsleep wakeup pin ifdef - renesas-ra/ra: fix SysTick clock source - renesas-ra/boards/ARDUINO_PORTENTA_C33: fix the RTC clock source - renesas-ra/ra/ra_i2c: fix 1 byte and 2 bytes read issue - rp2/rp2_dma: fix fetching 'write' buffers for writing not reading - rp2/machine_uart: fix event wait in uart.flush() and uart.read() - rp2: change machine.I2S and rp2.DMA to use shared DMA IRQ handlers ======== Fri, 5 Jan 2024 12:33:34 +1100 v1.22.1 Patch release for rp2 atomic mutex This is a patch release to fix a race condition and potential deadlock in the rp2 port's mp_thread_begin_atomic_section() function, when the second core is in use. ======== Wed, 27 Dec 2023 15:35:31 +1100 v1.22.0 SSL support in asyncio, sorted qstr pools, common machine module bindings This release of MicroPython introduces SSL/TLS support to asyncio, for both the client and server sides. The interface matches CPython: `asyncio.open_connection()` and `asyncio.start_serve()` now both accept an `ssl` argument to supply an `SSLContext` object. As part of this, new methods were added to `SSLContext` to load certificates, and certificate date/time validation was enabled on all ports that use mbedTLS. Qstr pools are now sorted, which provides a significant performance boost for `qstr_find_strn()`, which is called a lot during parsing and loading of .mpy files, as well as interning of string objects, which happens in most string methods that return new strings. The static pool (part of the .mpy ABI) isn't currently sorted, but could be in the future. There have been many internal changes to the `machine` module (and on some ports the `os` module) to factor the Python bindings to a common location, reduce code duplication and make the API more consistent across all the ports. And a new `boardgen.py` script has been added to factor pin generation and enable a more consistent `machine.Pin` across ports. For consistency, the following user-facing changes have been made: - cc3200 port: The `machine` module gains `soft_reset()`, `mem8`, `mem16`, `mem32` and `Signal`; it loses `POWER_ON` (replaced by `PWRON_RESET`). `disable_irq()` now returns an (opaque) integer rather than a bool, and `enable_irq(state)` must be passed an argument which is the return value of `disable_irq()`, rather than a bool. In the `os` module, `dupterm()` has been converted to use the common implementation and has semantics the same as other ports, and `uname()` is removed to save space (sys.version and sys.implementation can be used instead). - esp32 port: In the `machine` module, `lightsleep()` and `deepsleep()` no longer take the `sleep` keyword argument, instead it's positional to match other ports. Also, passing 0 here will now do a 0ms sleep instead of acting like nothing was passed. And `reset_cause()` no longer accepts any arguments (before it would just ignore them). - esp8266 port: `machine.idle()` now returns None instead of the time elapsed. The `machine.WDT()` constructor now takes keyword arguments, and accepts the `timeout` argument but raises an exception if it's not the default value (this port doesn't support changing the timeout). - mimxrt port: `machine.freq()` now accepts an argument but raises `NotImplementedError`, and `machine.lightsleep()` has been added but also just raises `NotImplementedError` (this is to make these functions use an implementation common to the other ports). - nrf port: The `machine` module gains `unique_id()` (returns an empty bytes object), `freq()` (raises `NotImplementedError`) and `Signal`. `UART.sendbreak()` is removed, but this method previously did nothing. The `os.dupterm()` function has changed to match the semantics used by all other ports (except it's restricted to accept only `machine.UART` objects). - qemu-arm port: The `machine` module gains `soft_reset()` and `idle()`. - samd port: The `machine.deepsleep()` function now resets after sleeping. - unix port: Gains `machine.soft_reset()`. - zephyr port: The `machine` module gains `soft_reset()`, `mem8`, `mem16`, and `mem32`. The `UART` class gains the following methods: `init()` which supports setting `timeout` and `timeout_char`, `deinit()` which does nothing, `flush()` which raises `OSError(EINVAL)` because it's not implemented, and `any()` and `txdone()` which both raise `NotImplementedError`. The teensy port has been removed in this release. This port was largely unmaintained, had limited features (the only hardware support was for GPIO and timer, and no `machine` module), and only supported a small number of Teensy boards. A new preview versioning scheme has been introduced, whereby non-release builds are a preview of the next, upcoming release. This scheme is compatible with semver and should help to eliminate confusion matching documentation and firmware version numbers, among other things. Black has been replaced with ruff format as the Python code formatter. This required a few small changes to Python code, and now allows linting and formatting with ruff. Bound method instances now support comparison and hashing, matching CPython semantics. The .mpy sub-version has been updated from 6.1 to 6.2 due to a change in the native .mpy ABI. A new option `MICROPY_PREVIEW_VERSION_2` has been added which provides a way to enable features and changes slated for MicroPython 2.x, by running `make MICROPY_PREVIEW_VERSION_2=1`. This is an alternative to having a 2.x development branch, and any feature or change that needs to be "hidden" until 2.x will use this flag. LittleFS has been updated to v2.8.1. The associated MicroPython VfsLfs2 driver can read existing LFS2 filesystems, but any writes will update the filesystem to a newer LFS2 version that cannot be read by older drivers, so take this into account when updating, for example update mboot first. The VFS sub-system has a new file ioctl to set the read-buffer size, which is used by mpremote to significantly increase performance of the "mpremote mount" feature. Manifest files now allow registering an external library path via `add_library(name, path)`. `sys.stdout.buffer.write()` now returns the actual number of bytes written (although this is complicated when output goes to multiple destinations). The esp32 port has been updated to use IDF version 5.0.4, and the initial GC heap size tuned so that, after doubling the heap size, WiFi can still be started and an SSL connection made. `RMT.source_freq()` is now a class method, socket connect timeout has been implemented, RTC user memory is now preserved over most reset causes, and `hashlib.md5` enabled. The mimxrt port has RTC alarm/wakeup functionality added, along with support for `machine.deepsleep()`. The rp2 port sees the introduction of a new `rp2.DMA` class for control over DMA transfers. It has switched to use the same math library as other ports to get more accurate floating point behaviour, and enabled `os.dupterm_notify()` for WebREPL use. The TinyUSB stack is now scheduled to run from the IRQ handler (instead of polled in the VM) which slightly improves performance of the VM and USB. The port also makes better use of event scheduling and WFE to be more efficient. It also has added support for external ADC channels (for example when using the ninaw10 driver). The stm32 port has improved support for STM32H5xx MCUs, including Ethernet support, frequency scaling with HSI, sleep mode and SD card support. The NUCLEO_WL55 board now freezes in the LoRa driver, the I2S driver has improved accuracy of the clock frequency, and mboot now supports Microsoft WCID to set the USB driver. New boards added in this release are: UM_TINYWATCHS3 (esp32 port), POLOLU_3PI_2040_ROBOT, POLOLU_ZUMO_2040_ROBOT and SIL_RP2040_SHIM (rp2 port), NUCLEO_H563ZI (stm32 port). The change in code size since the previous release for various ports is (absolute and percentage change in the text section): bare-arm: +216 +0.381% minimal x86: +624 +0.340% unix x64: +8283 +1.050% stm32: +1368 +0.350% cc3200: +1184 +0.649% esp8266: +800 +0.114% esp32: +35348 +2.100% mimxrt: +2172 +0.602% renesas-ra: +96 +0.015% nrf: +1460 +0.785% rp2: +6100 +1.880% samd: +1476 +0.568% The changes that dominate these numbers are: - bare-arm, minimal: comparing and hashing bound methods, sorted qstr pools - unix: updating LittleFS to 2.8.1, enabling certificate date/time validation, adding SSLContext certificate methods, asyncio SSL support - stm32: sorted qstrs, updating LittleFS to 2.8.1, I2S clock frequency improvements, asyncio SSL support - cc3200: sorted qstrs, more machine module functions, use of the common `os.dupterm` implementation - esp32: switching ESP-IDF from 5.0.2 to 5.0.4 - esp8266: updating LittleFS to 2.8.1 - mimxrt: adding RTC alarm/wakeup functionality, updating LittleFS to 2.8.1, asyncio SSL support - nrf: updating LittleFS to 2.8.1, enabling `machine.Signal`, asyncio SSL support - rp2: using locally-provided math library, adding new `rp2.DMA` class - samd: sorted qstrs, updating LittleFS to 2.8.1, asyncio SSL support With the new sorted qstr pools, performance is significantly improved for qstr-heavy operations, between +50% and +200% improvement. Other areas have their performance unchanged since the last release. Thanks to everyone who contributed to this release: Alessandro Gatti, Andrew Leech, Angus Gratton, Carlosgg, Christian Walther, Damien George, Daniël van de Giessen, Elias Wimmer, Glenn Moloney, iabdalkader, Ihor Nehrutsa, Jeff Epler, Jim Mussared, Kwabena W. Agyeman, Maarten van der Schrieck, Mark Blakeney, Mathieu Serandour, Matthias Urlichs, MikeTeachman, Ned Konz, Nicko van Someren, Pascal Brunot, Patrick Van Oosterwijck, Paul Grayson, Peter Züger, Rene Straub, robert-hh, Scott Zhao, Sebastian Romero, Seon Rozenblum, stijn, Thomas Ackermann, Thomas Wenrich, ThomHPL, Trent Piepho. Contributions were made from the following timezones: -0800, -0700, -0600, -0500, +0000, +0100, +0200, +1000, +1100. The work done in this release was funded in part through GitHub Sponsors, and in part by George Robotics, Planet Innovation, Espressif, Arduino, LEGO Education and OpenMV. What follows is a detailed list of changes, generated from the git commit history, and organised into sections. Main components =============== all: - switch to new preview build versioning scheme - replace "black" with "ruff format" - update Python formatting to ruff-format py core: - vm: don't emit warning when using "raise ... from None" - builtinevex: handle invalid filenames for execfile - objboundmeth: support comparing and hashing bound methods - objboundmeth: optimise check for types in binary_op - obj: generalise mp_get_buffer so it can raise if a flag is set - dynruntime: add mp_get_buffer - persistentcode: bump .mpy sub-version - modthread: initialise nlr_jump_callback_top on threads - makeqstrdefs.py: print a nicer error when preprocessing stage fails - mkrules.mk: add MICROPY_PREVIEW_VERSION_2 - asm: remove unused asm helper macros - qstr: add support for sorted qstr pools - mkrules.mk: add rule for compiling auto-generated source files - runtime: remove declaration of function from inside function - lexer: change token position for new lines - misc: change sizeof to offsetof for variable-length alloc - qstr: special case qstr_find_strn for empty string - obj: fix mp_obj_is_type compilation with C++ - objslice: validate that the argument to indices() is an integer - mkrules: add support for custom manifest variables - modbuiltins: share vstr_add_char's implementation of utf8 encoding - mphal: move configuration of ATOMIC_SECTION macros to mphal.h - add port-agnostic inline functions for event handling - modsys: implement optional sys.intern - mkrules.mk: list hash files as byproducts - makeqstrdefs.py: don't skip output for stale hash file - makeqstrdefs.py: stop generating temporary intermediate file - gc: improve calculation of new heap size in split-heap-auto mode - mkrules.mk: fix dependency file generation for compiler wrappers extmod: - moductypes: validate that uctypes.struct addr argument is an int - asyncio: emit errors to stderr, not stdout - modframebuf: validate FrameBuffer bounds against input buffer - modframebuf: fix FrameBuffer get-buffer implementation - modframebuf: remove FrameBuffer1 from natmod build - vfs_posix: fix relative root path - vfs_posix: fix accidentally passing tests - vfs_posix: fix relative paths on non-root VFS - vfs_posix: fix getcwd() on non-root VFS - vfs_posix: additional tests for coverage of error cases - network_ninaw10: raise an error if nina_ioctl fails - machine_wdt: factor ports' WDT Python bindings to common code - machine_pwm: remove header file and move decls to .c file - machine_i2s: factor ports' I2S Python bindings to common code - machine_i2s: factor stream and ring-buf code - machine_i2s: factor I2S.shift method - machine_i2s: factor I2S.irq method - machine_i2s: factor print function - machine_i2s: factor init_helper argument parsing - machine_i2s: factor comments, some enums and macros - machine_adc: factor ports' ADC Python bindings to common code - machine_uart: factor ports' UART Python bindings to common code - modmachine: clean up decls of machine types to use common ones - modmachine: consolidate simple machine headers into modmachine.h - modmachine: consolidate mem, i2c and spi headers to modmachine.h - network_ninaw10: fix select flags handling in socket poll - remove empty utime_mphal.h file - machine_adc_block: factor esp32 ADCBlock bindings to common code - machine_i2c: do a fast poll during I2C.scan() - vfs_reader: add file ioctl to set read buffer size - modbluetooth: initialise nlr_jump_callback_top for IRQ handlers - vfs_posix_file: make standard file objects non-const - extmod.mk: allow enabling lwip loopback support - modmachine: make I2C/SPI defns available when soft impl enabled - modmachine: factor ports' machine module dict to common code - modmachine: provide common Python bindings for machine.idle() - modmachine: add MICROPY_PY_MACHINE_PIN_BASE option - modmachine: provide common Python bindings for bootloader() - modmachine: provide common bindings for 6 bare-metal functions - modmachine: provide common implementation of disable/enable_irq - mbedtls: enable certificate time/date validation by default - modnetwork: add deinit function to NIC protocol - network_ninaw10: switch to using soft-timer for polling - switch to use new event functions - add lists of libm/libm_dbl source files for ports to use - modssl_mbedtls: add SSLContext certificate methods - modssl_mbedtls: make SSLSocket.getpeercert() optional - modssl_mbedtls: fix parsing of ciphers in set_ciphers method - asyncio: add ssl support with SSLContext - modonewire: adopt Maxim recommended read timings - modonewire: improve write timings for better reliability - modos: factor os.dupterm_notify() function to common extmod code - os_dupterm: prevent recursive execution of mp_os_dupterm_rx_chr - asyncio: remove non-working Stream __aenter__/__aexit__ methods - modselect: handle growing the pollfds allocation correctly - modhashlib: support MD5 with mbedtls 3.x - os_dupterm: let mp_os_dupterm_tx_strn() return num bytes written - vfs_lfs: fix lfs cache_size calculation - nimble: do not set GAP device name after sync shared: - libc/string0: don't deref args for n==0 case - tinyusb: schedule TinyUSB task function from dcd_event_handler - tinyusb: expose mp_usbd_task as a public function - tinyusb: add a helper for hex string conversion - runtime/softtimer: generalise soft_timer to work without SysTick drivers: - ninaw10: add ioctl for reading analog pins - ninaw10: add support for external ADC channels mpy-cross: no changes specific to this component/port lib: - littlefs: update LittleFS to v2.8.1 - uzlib: for matches of the same length, take the closest one - mbedtls_errors: update error list for latest esp32 mbedtls - micropython-lib: update submodule to latest Support components ================== docs: - reference/mpyfiles: document change in .mpy sub-version - library/io: remove io.FileIO and io.TextIOWrapper - reference/micropython2_migration: add migration guide - mimxrt: change the examples which denote a Pin with a number - samd: fix the pinout for SAMD21 Itsy Bitsy Express M0 - library/esp: correct the description of esp.osdebug() - esp32/quickref: add DAC example - library: document SSLContext cert methods and asyncio support examples: - pins.py: remove this pins printing example tests: - basics/boundmeth1.py: add tests for bound method equality/hash - perf_bench: add string/qstr/map tests - extmod/asyncio_as_uasyncio.py: fix qstr order dependency - net_hosted/asyncio_loopback.py: add loopback test - extmod/deflate_compress.py: add a test for optimal compression - float/inf_nan_arith.py: include -inf in argument combos - run-tests.py: skip Thumb2 tests if target doesn't support them - update SSL network tests to use SSLContext, and work on CPython tools: - ci.sh: ensure enough commits are fetched for a common ancestor - boardgen.py: add initial implementation of a common make-pins.py - tinytest-codegen.py: externalise tests list - mpremote: add ioctl to specify large read buffer size - ci.sh: build ESP32_GENERIC-SPIRAM as part of esp32 CI - ci.sh: set `ulimit -n` for unix CI - manifestfile.py: add support for external libraries CI: - workflows: pin ruff to 0.1.0 and change flags for new version - workflows: cache ESP-IDF checkout and installation - workflows: use build matrix for esp32 port - workflows: enable build matrix for stm32 port - workflows: enable ccache for esp32 build - workflows: bump actions/github-script from 6 to 7 - workflows: bump actions/setup-python from 4 to 5 - workflows: bump actions/upload-artifact from 3 to 4 The ports ========= all ports: - make all ports skip execution of main.py if boot.py fails - remove SRC_QSTR_AUTO_DEPS from all ports' Makefiles - standardise arguments and output for make-pins.py script - fix incorrect identifiers on Arduino boards - move definitions of ATOMIC_SECTION macros to mphalport.h - switch build to use common lib/libm list of source files - fix sys.stdout.buffer.write() return value bare-arm port: - lib: add minimal strncmp implementation cc3200 port: - boards/make-pins.py: don't generate qstrs - boards/make-pins.py: add a note about tools/boardgen.py - mods/modmachine: use common implementation of disable/enable_irq - convert dupterm to use common extmod implementation - convert os module to use extmod version - eliminate dependency on stm32's irq.h - application.mk: don't add stm32 to build include path embed port: no changes specific to this component/port esp8266 port: - rename MICROPY_ESPNOW to MICROPY_PY_ESPNOW - machine_spi: rename machine_hspi to machine_spi - esp_mphal: make atomic section more atomic - modmachine: use common implementation of disable/enable_irq - avoid including ep_mphal.h directly - update port to use new event functions esp32 port: - rename MICROPY_ESPNOW to MICROPY_PY_ESPNOW - boards: update UM board image names for consistency - boards/UM_TINYWATCHS3: add new UM TinyWATCH S3 board - boards: update UM board settings to use custom PID/VID - network_ppp: allow building with IPv6 disabled - poll serial/JTAG for unread data to prevent blocking - mpconfigport: remove port-specific GAP name - machine_uart: add error checking for IDF API's - network_ppp: reduce PPP thread CPU usage - boards: disable ALPN support - network_lan: fix and simplify the code for ETH-SPI devices - network_lan: fix LAN.isconnected() - network_lan: register the hostname setting for Ethernet - modmachine: fix deepsleep() when previous sleep delay was set - boards: reduce size of D2WD and OTA firmware - use better build settings for ESP32-C3 - mphalport: add function to wake main from separate FreeRTOS task - usb: wake main thread when USB receives data - machine_pin: make irq object a sub-field of pin object - esp32_rmt: change RMT.source_freq() to class method - esp32_rmt: add RMT.PULSE_MAX constant - modsocket: implement socket connect timeout - modsocket: try garbage collection if the socket limit is reached - boards/sdkconfig.base: fix increasing log level via esp.osdebug() - boards/ESP32_GENERIC: reduce size of D2WD variant to fit in flash - uart: preserve console UART clock, fix UART console with DFS - uart: make compatible with sclk type change in ESP-IDF 5.3 - network_wlan: reduce RAM usage if SPIRAM fails to initialise - network_wlan: fix network.WLAN.status() to return better info - esp32_rmt: fix RMT looping - enable mbedtls cert time validation - boards: enable further IRAM saving opts to fit ESP32-SPIRAM fw - machine_rtc: preserve RTC user memory over most reset causes - boards/UM_TINYPICO: fix typo in baudrate instructions - boards/sdkconfig.base: disable unused mbedtls options - machine_i2c: use APB_CLK_FREQ instead of I2C_APB_CLK_FREQ - modnetwork: add WiFi AUTH_WPA3_ENT_192 authenticate mode - machine_dac: support one-shot mode of driver - modmachine: fix deprecated esp_pm_config_XXX_t - machine_i2s: fix deprecated fields and constants - mpconfigport: keep some funcs out of IRAM for ESP32-SPIRAM builds - boards/ESP32_GENERIC: disable network.LAN and VM-opt on D2WD - change minimum supported IDF version to v5.0.4 - re-enable custom mbedtls error string tables - add MICROPY_GC_INITIAL_HEAP_SIZE option and tune it - mpconfigport: enable MICROPY_PY_HASHLIB_MD5 mimxrt port: - led: fix LED init call from main, and simplify led_init - boards: define missing SNVS pins for all processors - machine_rtc: add RTC alarm/wakeup functionality - modmachine: add support for machine.deepsleep - boards/make-pins.py: update to use tools/boardgen.py - modmachine: fix settings for the MIMXRT1170 board - boards/OLIMEX_RT1010: adjust the UART pin assignment minimal port: no changes specific to this component/port nrf port: - boards: automatically configure MICROPY_PY_MACHINE_PWM - modules/machine: use SPI Python bindings provided by extmod - boards/make-pins.py: don't generate qstrs - boards/make-pins.py: add a note about tools/boardgen.py - use MICROPY_PY_MACHINE_SPI instead of MICROPY_PY_MACHINE_HW_SPI - use dupterm_objs[0] instead of board_stdio_uart - convert os module to use extmod version - mpconfigport: enable MICROPY_PY_MACHINE_BOOTLOADER - boards/ARDUINO_NANO_33_BLE_SENSE: don't enable MICROPY_MBFS - main: add /flash and /flash/lib to sys.path pic16bit port: no changes specific to this component/port powerpc port: no changes specific to this component/port qemu-arm port: no changes specific to this component/port renesas-ra port: - boards/make-pins.py: don't generate qstrs - boards/make-pins.py: update to use tools/boardgen.py - boards/ARDUINO_PORTENTA_C33: fix incorrect I2C pins - consolidate MICROPY_PY_MACHINE_I2C option rp2 port: - cyw43_configport: use m_tracked_calloc and m_tracked_free - machine_adc: add support for external ADC channels - boards/ARDUINO_NANO_RP2040_CONNECT: add external analog pins - boards/make-pins.py: don't generate qstrs - machine_uart: fix handling of serial break condition - machine_adc: refactor channel/pin validation code - remove 1ms timeout to make idle waiting tickless - change to use TinyUSB dcd_event_handler hook - mphalport: run TinyUSB stack while waiting for CDC input/output - integrate soft_timer using the alarm pool - mpbthciport: rework HCI polling timer to use soft_timer - mpnetworkport: rework lwIP polling to use soft_timer - mphalport: optimise exit of mp_hal_delay_ms loop - cyw43_configport: implement cyw43_delay_ms as mp_hal_delay_ms - switch to locally provided math library - switch rp2 and drivers to use new event functions - main: enable SEVONPEND CPU interrupt bit - mpconfigport: enable MICROPY_PY_OS_DUPTERM_NOTIFY - add new NO_DEFAULT_PINS config options for i2c, spi, and uart - boards: add support for Pololu 3pi+ and Zumo robots - boards: add SIL_RP2040_SHIM board by Silicognition LLC - rp2_dma: introduce a new rp2.DMA class for control over DMA xfers samd port: - boards/make-pins.py: update to use tools/boardgen.py - mpconfigport: set MICROPY_USE_INTERNAL_ERRNO to 1 - machine_uart: add machine_uart_set_baudrate() function - pin_af: fix a typo in a conditional compile - switch TinyUSB to run via a scheduled task - mphalport: run TinyUSB stack while waiting for CDC input/output - switch to shared TinyUSB implementation - use unique id for USB serial number stm32 port: - boards/ARDUINO_GIGA: add QSPI fix/workaround to early init - boards/ARDUINO_GIGA: fix name of pins in board init - eth: add Ethernet support for H5 MCUs - boards/STM32H573I_DK: enable ETH and DAC peripherals - powerctrl: add support for frequency scaling with HSI on H5 MCUs - boards/make-pins.py: don't generate qstrs - boards: fix errors in pins.csv and af.csv - boards: format stm32 alternate function csv files - rename pin_obj_t to machine_pin_obj_t - boards/make-pins.py: update to use tools/boardgen.py - boards/make-pins.py: add initial support for H7 dual-pad pins - add configuration options for analog switches - add STM32H5 support for sleep mode - boards/make-pins.py: fix H7 ADC generation - boards/stm32f4x9_af.csv: fix DCMI_VSYNC - boards/stm32g474_af.csv: fix final row ADC column - boards/make-pins.py: only support ADC1-3 - boards/NUCLEO_WL55: freeze LoRa driver - mpu: enable STM32WB mpu use to support qspi flash - add optional lwip loopback support - boards/NUCLEO_F446RE: add UARTs 1, 3 and 4 - boards/NUCLEO_H563ZI: add new NUCLEO-H563ZI board definition - sdcard: add SD card support for H5 MCUs - boards/STM32H573I_DK: enable the SD card - add missing header include for debug builds - modmachine: only enable machine.I2C if hardware I2C is enabled - usbd_cdc_interface: include header to get machine_bootloader decl - machine_i2s: improve accuracy of SCK frequency - usbdev: optionally pass through vendor requests to Setup function - mboot: guard use of tx_pending with USE_USB_POLLING option - mboot: expand device descriptor to make it easier to understand - mboot: add support for Microsoft WCID teensy port: - remove the teensy port unix port: - mbedtls: enable mbedtls cert time validation - update port to use the new event functions webassembly port: no changes specific to this component/port windows port: - use the MicroPython logo as application icon - implement MICROPY_INTERNAL_WFE() macro zephyr port: no changes specific to this component/port ======== Fri, 6 Oct 2023 10:32:07 +1100 v1.21.0 U-module renaming, deflate module, IDF 5, board variants and Pico-W BLE This release of MicroPython sees the renaming of built-in modules to remove the u-prefix, a new deflate module with optional compression support, the introduction of board variants, switching of the esp32 port to use IDF 5 together with improved heap management, support for BLE on RPi Pico W boards, and STM32H5xx support. The project is also now using codespell and ruff to improve code quality. New boards added in this release are: ARDUINO_NANO_ESP32 and UM_NANOS3 (esp32 port), ADAFRUIT_METRO_M7 (mimxrt port), ARDUINO_PORTENTA_C33 and VK_RA6M5 (renesas-ra port), ADAFRUIT_METRO_M4_EXPRESS (samd port), NUCLEO_L4A6ZG and STM32H573I_DK (stm32 port). The renaming of built-in modules to remove the u-prefix -- for example utime becomes time, uasyncio becomes asyncio -- is done to improve compatibility with CPython and eliminate confusion about whether to import the u-version or the non-u-version of the name. Now, one should just always import the non-u-version and no longer think about u-naming. The only remaining module with a u-prefix is uctypes because it is not compatible with the CPython ctypes modules. The following modules are still available via their u-names for backwards compatibility: array, asyncio, binascii, bluetooth, collections, cryptolib, errno, hashlib, heapq, io, json, machine, os, platform, random, re, select, socket, ssl, struct, time, websocket. These modules (except for asyncio) are also extensible and can be overridden by a file with the same name, eg time.py. To force the import of a built-in, one must first clear (and subsequently restore) sys.path; the ability to write to the sys.path attribute has also been implemented in this release. For further information see the discussion at https://github.com/micropython/micropython/issues/9018. Furthermore, importing itself has been tweaked and optimised, and importing of built-ins no longer touch the filesystem, which makes a typical built-in import take ~0.15ms rather than 3-5ms. For modules that fail to import, they are now removed from sys.modules, allowing the import to be attempted again. This required adding "NLR jump callbacks" to efficiently run some code if an exception is raised. Additional improvements to the core runtime include support for conversion specifiers in f-strings (e.g. !r), speeding up of incremental GC cycles by tracking the last used block, addition of a new MICROPY_GC_SPLIT_HEAP_AUTO "auto grow heap" mode and support for pad bytes in struct format. The documentation, examples and test have also seen general improvements and additions. For the extended modules, the zlib C module has been removed and replaced with a new MicroPython-specific deflate module and DeflateIO class that is optimised to provide efficient streaming compression and decompression. The zlib (and gzip) modules are now implemented in pure Python on top of the deflate module. The timeq module has been removed, it existed only for a previous version of (u)asyncio and is no longer used. In the ssl module, SSLContext has been added to be more compatible with CPython. The select module now supports using system/POSIX poll when possible and the unix port now uses this implementation instead of its own one. That means the unix port can now select/poll on custom Python objects that implement the appropriate ioctl. The socket module now supports SO_BROADCAST, and sys.std*.buffer objects now exist on unix. There is also a new esp-hosted network driver for external ESP32-based network coprocessors. mpy-cross now allows reading source files from stdin and writing compiled code to stdout. The esp8266 and esp32 ports add support for the Espressif ESP-NOW protocol, and the ability to set/get the power saving mode of the WLAN hardware. The esp8266 port adds board-variant support, combining all boards into a single ESP8266_GENERIC with FLASH_512K, FLASH_1M and OTA variants. The esp32 port has now switched exclusively to ESP-IDF 5, and all existing components have been updated to work with this new IDF (except esp32.hall_sensor() which has been removed). The FSM ULP has been enabled for S2 and S3 chips, sockets now support SO_BINDTODEVICE, and board-named pins and the Pin.board dict have been implemented. The MicroPython heap has been reworked on this port to support the large variety of memory configurations: it now starts at 64kbytes and automatically grows as needed, with new segments allocated from the IDF heap. This means that boards with SPIRAM have much faster GC collection times if only a small amount of RAM is used, all available RAM can be used if needed, and the IDF has access to enough RAM for things like SSL sockets. For more information see https://github.com/micropython/micropython/pull/12141. The esp32 port has also had its generic boards consolidated and renamed to ESP32_GENERIC, ESP32_GENERIC_C3, ESP32_GENERIC_S2 and ESP32_GENERIC_S3, and some now have variants such as SPIRAM. The mimxrt port has fixes and improvements to PWM and Pin.irq, as well as support for UART hardware flow control and UART.deinit. It has also seen integration of WiFi via the CYW43 driver, and Bluetooth via NimBLE. The mbedTLS bindings have enabled time validation of certificates. The renesas-ra port has changed board names to match the product name, updated to use FSP v4.4.0, added support for: RA6M5 MCUs, machine PWM, DAC, RNG and SDCard classes, TinyUSB, Bluetooth via NimBLE, networking via lwIP, and mbedTLS. Bluetooth support has also been added to the rp2 port for the Pico W board. And the RPi boards have been renamed from PICO to RPI_PICO, and PICO_W to RPI_PICO_W. Lightsleep has been fixed on this port so it works while WiFi is powered off, and time.time_ns() now has microsecond resolution. The samd port sees the addition of SPI and QSPI flash drivers to support filesystems on external flash. The stm32 port add support for STM32H5xx MCUs, basic support for the OCTOSPI peripheral, and USB support for STM32L1xx MCUs. New functions have been added to the stm module to support the sub-GHz radio on STM32WL55. In micropython-lib, an extensive LoRa module has been added along with drivers for SX126x and SX127x chipsets, and the STM32WL55. This module supports both synchronous and asynchronous (asyncio) mode. Also, as part of the u-module renaming, urequests has been renamed to requests (but for backwards compatibility "import urequests" still works for now). The change in code size since the previous release for various ports is (absolute and percentage change in the text section): bare-arm: +192 +0.340% minimal x86: +310 +0.169% unix x64: +4784 +0.610% stm32: -524 -0.134% cc3200: +280 +0.154% esp8266: +8016 +1.151% esp32: +112133 +7.293% mimxrt: +3624 +1.015% renesas-ra: -2184 -0.348% nrf: +616 +0.332% rp2: +1920 +0.595% samd: -7904 -2.953% The changes that dominate these numbers are: - bare-arm, minimal, cc3200, nrf: NLR jump callbacks and support for extensible modules - unix: update of mbedTLS to v2.28.1, support for polling Python objects in select module - stm32: removal of the timeq module - esp8266: addition of the espnow module - esp32: switching to ESP-IDF 5 - mimxrt: UART features, time validation of SSL certificates - renesas-ra: move to FSP v4.4.0, remove timeq module - rp2: machine.PWM enhancements - samd: drop support for VfsLfs1 Performance is effectively unchanged since the previous release. Note that this is the last release to use the current versioning scheme for nightly/unstable builds, whereby a build between releases is versioned as v1.20.0--g (following the release of v1.20.0). Moving forward, nightly builds will now be called preview builds and be versioned with the next release number. For example, if the last release was v1.21.0 then preview releases will be of the form v1.22.0-preview..g. For discussion see https://github.com/micropython/micropython/issues/12127. Thanks to everyone who contributed to this release: Adam Green, Alexander Wilde, algonell, Andrew Leech, Andy Piper, Angus Gratton, Armin Brauns, brave ulysses, Brett Cannon, Brian 'redbeard' Harrington, Carlosgg, Chris Wilson, Christian Clauss, Damien George, Damien Tournoud, Daniël van de Giessen, David Grayson, David Lechner, David Yang, dotnfc, Duncan Lowther, Elecia White, elibdev, Elvis Pfutzenreuter, Felix Dörre, Francis Dela Cruz, Glenn Moloney, glenn20, iabdalkader, Ihor Nehrutsa, Jared Hancock, Jim Lipsey, Jim Mussared, Jon Nordby, Jonas Scharpf, Jos Verlinde, Kwabena W. Agyeman, Luca Burelli, marble, Mark Grosen, mbedNoobNinja, mcskatkat, Mingjie Shen, Mirko Vogt, Nicholas H. Tollervey, Oliver Joos, Ondrej Wisniewski, patrick, Peter Harper, Phil Howard, Philipp Ebensberger, Rene Straub, robert-hh, Sebastian Romero, Seon Rozenblum, stephanelsmith, stijn, Takeo Takahashi, Thomas, Tobias Thyrrestrup, UnexpectedMaker, Victor Rajewski, vsfos, Wang Xuancong, Wanlin Wang, Wilko Nienhaus, Wind-stormger, Yaroslav Halchenko, Yilin Sun, Yuuki NAGAO. The work done in this release was funded in part through GitHub Sponsors, and in part by George Robotics, Planet Innovation, Espressif, Arduino, LEGO Education and OpenMV. What follows is a detailed list of changes, generated from the git commit history, and organised into sections. Main components =============== all: - fix spelling mistakes based on codespell check - fix strings with backslash by using raw string literals - fix various Python coding inconsistencies found by ruff - fix cases of Python variable assigned but never used - rename MP_QSTR_umodule to MP_QSTR_module everywhere - rename mp_umodule*, mp_module_umodule* to remove the "u" prefix - rename mod_umodule*, ^umodule* to remove the "u" prefix - rename UMODULE to MODULE in preprocessor/Makefile vars - rename *umodule*.h to remove the "u" prefix - rename *umodule*.c to remove the "u" prefix - use MP_REGISTER_EXTENSIBLE_MODULE for overrideable built-ins - replace all uses of umodule in Python code - remove the zlib module - remove query-variants make target - add missing imports for micropython.const - add Black configuration section to pyproject.toml - add ruff to pre-commit - CODECONVENTIONS: require that commits be signed-off by the author py core: - ringbuf: implement put_bytes/get_bytes functions - parse: fix build when COMP_CONST_FOLDING=0 and COMP_MODULE_CONST=1 - compile: remove over-eager optimisation of tuples as if condition - stackctrl: add gcc pragmas to ignore dangling-pointer warning - gc: make improvements to MICROPY_GC_HOOK_LOOP - obj: remove mp_generic_unary_op() - objslice: ensure slice is not hashable - objdict: fix __hash__ for dict_view types - objarray: disallow memoryview addition - objstr: return unsupported binop instead of raising TypeError - runtime: if inplace binop fails then try corresponding normal binop - change MP_UNARY_OP_INT to MP_UNARY_OP_INT_MAYBE - obj: accept user types in mp_obj_get_int_maybe - objint: allow int() to parse anything with the buffer protocol - builtinimport: handle empty sys.path correctly - builtinimport: optimise sub-package loading - builtinimport: allow builtin modules to be packages - objmodule: don't use sys.modules to track a builtin __init__ - nlrsetjmp: use MP_NLR_JUMP_HEAD macro to simplify code - nlr: remove commented-out debugging code - nlr: implement jump callbacks - use nlr jump callbacks to optimise compile/execute functions - builtinimport: remove partially-loaded modules from sys.modules - builtinimport: remove weak links - makemoduledefs.py: add a way to register extensible built-in modules - objmodule: add a table of built-in modules with delegation - objmodule: workaround for MSVC with no module delegation - mpconfig: enable module delegation if sys needs it - modsys: allow sys.path to be assigned to - mkrules.mk: automatically configure frozen options when manifest set - parsenum: fix typo in #endif comment - nlraarch64: fix dangerous use of input register - makemoduledefs.py: fix declaring multiple module delegations - makemoduledefs.py: automatically declare delegation attr functions - lexer: allow conversion specifiers in f-strings (e.g. !r) - mkrules.mk: allow $(AFLAGS) to set flags to $(AS) - compile: fix async for's stack handling of iterator expression - builtinimport: fix built-in imports when external import is disabled - stream: add mp_stream___exit___obj that calls mp_stream_close - runtime: always initialise sched_state in mp_init - mpconfig: add MICROPY_PY_PLATFORM, enabled at extra features level - gc: speed up incremental GC cycles by tracking the last used block - gc: apply some code formatting cleanup - gc: add new MICROPY_GC_SPLIT_HEAP_AUTO "auto grow heap" mode - profile: remove the requirement to disable MICROPY_COMP_CONST - mpconfig: enable SSL finalizers if finalizers are enabled - objstr: fix `str % {}` edge case - modstruct: support pad bytes in struct format - dynruntime.h: implement MP_OBJ_NEW_QSTR - modthread: return thread id from start_new_thread() - malloc: fix DEBUG_print() args in m_realloc_maybe - runtime: add helpers to call a general function on nlr jump callback - parse: always free lexer even if an exception is raised - persistentcode: always close reader even if an exception is raised - gc: add "max new split" value in result of gc.mem_free() - nlrx64: mark nlr_push() as naked function when possible - mkrules.mk: don't strip binary if STRIP variable is unset - change ifdef DEBUG_PRINT to if DEBUG_PRINT - lexer: add missing initialisation for fstring_args_idx extmod: - utime_mphal: provide a general mktime function - modutime: provide a generic time module - machine_pwm: remove PWM_INIT and PWM_DUTY_U16_NS config options - network_cyw43: add power management constants - vfs_lfsx: fix offset used before range check - extmod.mk: suppress deprecated-non-prototype warning - moduos: move os.sync() into extmod/moduos.c - modtimeq: remove timeq module - btstack: add cmake support for BTstack - btstack: fix marking of static addresses in set_random_address - asyncio: rename uasyncio to asyncio - asyncio/uasyncio.py: add backwards-compatible uasyncio alias - modbinascii: fix buffer length error - update to support mbedtls 3.x - modplatform: set MICROPY_PLATFORM_ARCH on riscv platforms - modbtree: undefine queue macros before including berkeley-db - modssl: add SSLContext class - moddeflate: add deflate module providing the DeflateIO class - modssl_mbedtls: reference SSLContext from SSLSocket - vfs_posix_file: add poll support for missing ERR,HUP,NVAL values - modselect: abstract out a poll_set_t struct and functions - modselect: factor low-level polling code into common function - modselect: add optimisation to use system poll when possible - modselect: remove undocumented support for flags arg to poll - modssl_mbedtls: reject ioctls that are not supported - modssl_mbedtls: fix ioctl of a socket in closed/error state - modselect: properly track number of poll objects that are fd's - modssl_mbedtls: clear sock member if error creating SSLSocket - moddeflate: change default window size - vfs_posix_file: fix flush handling on macOS - vfs_posix_file: implement sys.std*.buffer objects - modlwip: add support for SO_BROADCAST socket option - modsocket: add support for SO_BROADCAST socket option - modssl_mbedtls: call func psa_crypto_init if PSA is used - modssl_mbedtls: ignore err ERR_SSL_RECEIVED_NEW_SESSION_TICKET - modlwip: fix setting of IP option SOF_BROADCAST - network_esp_hosted: add ESP-Hosted networking interface - modssl_axtls: only close underlying socket once if it was used - asyncio/event.py: fix ThreadSafeFlag.ioctl return - btstack/btstack_hci_uart: trigger a poll after UART data is sent - asyncio/stream.py: fix cancellation handling of start_server - modnetwork: increase max hostname length to 32 - modnetwork: forward if.config(hostname) to network.hostname - vfs_posix_file: fix flush handling in msvc builds shared: - upytesthelper: fix spelling of "default" - libc/printf: fix stdout destination for putchar and puts - tinyusb: avoid symbol clash on targets with external TinyUSB - tinyusb: support HS endpoint sizes - netutils/dhcpserver: reply on correct netif drivers: - cyw43: make the CYW43 Bluetooth HCI driver more portable - esp-hosted: add host driver for ESP-Hosted firmware - ninaw10/nina_bt_hci: make some minor fixes to HCI driver - esp-hosted: fix pin IRQ - esp-hosted: fix MTU size - esp-hosted: add support for WiFI LED activity indicator mpy-cross: - allow specifying source files starting with - - allow reading from stdin and writing to stdout - when reading from stdin, write output to stdout - allow specifying stdin as input without -- - fix source file name in file-not-found error lib: - mbedtls_errors: update error list for current version of mbedtls - mbedtls: update to mbedtls v2.28.1 - mbedtls_errors: add esp32-specific mbedtls error file - mbedtls_errors: update patch and error list for new mbedtls - mbedtls: update to mbedtls v2.28.3 - fsp: update FSP for renesas-ra to the latest version v4.4.0 - cyw43-driver: update driver to latest version v1.0.1 - btstack: update to v1.5.6.2 - pico-sdk: update to version 1.5.1 - stm32lib: update library for H5 v1.0.0 - oofatfs: fix speculative read in create_name - uzlib: add memory-efficient, streaming LZ77 compression support - uzlib/lz77: always use separate history buffer - uzlib/defl_static: implement some code size improvements - uzlib: clean up tinf -> uzlib rename - uzlib: combine zlib/gzip header parsing to allow auto-detect - uzlib/tinflate: implement more compact lookup tables - uzlib/defl_static: optimize zlib_start/finish_block - uzlib: add a source_read_data var to pass to source_read_cb - tinyusb: update to the most recent master - protobuf-c: add protobuf-c library - cyw43-driver: update driver to latest version v1.0.2 - micropython-lib: update submodule to latest Support components ================== docs: - reference: remove double 'are' in glossary - update the PWM examples based on recent API improvements - samd: make use of pin names more consistent in examples - reference/mpyfiles: add release info on v6.1 - library/espnow: update espnow docs for WLAN.config(pm=x) options - develop/porting: add missing code to example main.c and Makefile - reference/speed_python: remove 4-arg limit for viper - mimxrt: add the pin-out for the Adafruit Metro M7 board - samd: add the pin-out for the Adafruit Metro M4 Airlift board - library/index: update built-in extension docs - reference/packages: add GitHub repo to package example dependency - reference/mpremote.rst: extend the mpremote guide - library/index: update docs after umodule rename - rename uasyncio to asyncio - esp32: update esp32 docs based on IDF v5 changes - library/ssl: add documentation for SSLContext - esp32/quickref: add LAN example for WT32-ETH01 version 1.4 - library/deflate: add docs for deflate.DeflateIO - develop/gettingstarted: clarify submodule initialization - develop/gettingstarted: update ARM package list - library/neopixel: change link to a micropython-lib reference - library/platform: add docs for the platform library - library/network: clarify network.hostname() behaviour - esp32/tutorial: add example for pin access via registers - library/esp32: update ESP32 idf_heap_info docs to match behaviour - library/gc: clarify mem_alloc and mem_free only for Python heap - conf.py: add sphinxcontrib.jquery to extensions - add requirements.txt file with dependencies for Sphinx - change remaining "urequests" references to "requests" examples: - usercmodule: add a sub-package example - natmod: rename umodule to module - hwapi: rename uasyncio to asyncio - natmod/deflate: add deflate as a dynamic native module - mark asm, pio, etc. as noqa: F821 (undefined-name) - hwapi: add missing import for 96Boards Carbon example - bluetooth: raise ValueError when advertising data is too large - bluetooth: link to aioble in BLE examples - natmod: add features4 as a class definition example - unix/machine_bios.py: fix typo tests: - run-tests.py: ensure correct cwd for mpy tests - basics: add more tests for hashing of various types - basics: remove __index__ and __inv__ from special methods tests - import/builtin_ext.py: add test for built-in module override - import/import_pkg9.py: add test for subpackage attribute - replace umodule with module everywhere - run-multitests.py: don't allow imports from the cwd - run-perfbench.py: don't allow imports from the cwd - run-natmodtests.py: don't allow imports from the cwd - float: test domain errors for more combos of args to math funcs - rename uasyncio to asyncio - extmod/uctypes_array_assign_le: fix buffer - extmod/framebuf: fix buffer size issues - extmod: add tests for ssl.SSLContext - extmod: add test for passing cadata into ssl.wrap_socket() - extmod: add deflate.DeflateIO tests - extmod: add coverage tests for select module - extmod: skip select/socket tests if they can't create UDP socket - extmod/select_poll_eintr.py: improve robustness of test - misc/sys_settrace_features.py: fix to run on newer CPython - unix/mod_os: make os.system() test work on windows - run-tests.py: capture output of stderr when running on CPython - multi_net: increase asyncio tests timeouts - stress/bytecode_limit.py: reverse order of cases - float/float_format_ints.py: put power-of-10 test in separate file - extmod/deflate_decompress.py: skip test when not enough memory - extmod/ssl_cadata.py: skip test on axtls - float/math_domain.py: tweak test to also pass with obj-repr-C - extmod/vfs_fat_finaliser.py: tweak test so files are collected - README: document ./run-internalbench.py - run-internalbench.py: remove old CPython reference - multi_net/ssl_cert_rsa.py: update test certificate - extmod/asyncio_threadsafeflag.py: update for unix select tools: - pyboard.py: rename ProcessPtyToTerminal member "ser" to "serial" - mpremote: remove unused import of serial - pyboard.py: import serial.tools.list_ports - pyboard.py: import errno to fix undefined name in PyboardError - manifestfile.py: fix license capturing - mpremote: add repl option to escape non-printable characters - pydfu.py: use getattr to retrieve getargspec function - mpremote: add `sleep` command - mpremote: allow terminator for shortcut commands - mpremote: add `rtc` commands to get and set the RTC - mpremote: handle `cp` without destination - mpremote: detach mpremote from pyboard.py - mpremote: fix use of stdout_write_bytes function - mpremote: fix exec_ -> exec in commands.py - autobuild: update auto-build code to build esp32 port with IDF v5 - autobuild: add support for application .bin files for esp32 - mpy-tool.py: use isinstance() for type checking - codeformat.py: skip formatting ESP-IDF managed components - codeformat.py: use pyproject.toml for black config - mpremote: make soft-reset count as an action - autobuild: automatically build all variants for each board - mpy_ld.py: pre-declare some local variables to appease linter - mpy-tool.py: ignore linter failure in Python 2 compatibility code - mpy_ld.py: support more complex rodata sections - metrics.py: fix nrf and rp2 board names after renaming - autobuild: include .bin firmware in renesas-ra build output - autobuild/build-downloads.py: verify standard features - mpremote: add support for rfc2217, serial over TCP - metrics.py: fix esp32 and esp8266 board names after renaming - change remaining "urequests" references to "requests" CI: - ci.sh: build both SAMD21 and SAMD51 boards as part of samd CI - ci.sh: add functions to check code spelling using codespell - ci.sh: add mimxrt and samd ports to code size build - ci.sh: build PICO_W board as part of rp2 CI - ci.sh: add a H5 board to stm32 CI build - ci.sh: add ARDUINO_PORTENTA_C33 to RA CI build - workflows: fetch full history for mpremote workflow - workflows: add spell check to code formatting workflow - workflows: add GitHub Action to lint Python code with ruff - workflows: force use of Ubuntu-20.04 for unix 32-bit builds - workflows: update esp32 CI to use IDF v5.0 - workflows: bump actions/checkout from 3 to 4 The ports ========= all ports: - use extmod version of mktime instead of port-specific one - remove os.sync() implementation from stm32 and renesas-ra - enable os.sync() for esp32, esp8266, rp2, mimxrt, samd51 - standardise docs link in help text - in machine_i2s.c, rename uasyncio to asyncio - simplify board feature tags in board.json - */boards/*/board.json: remove "id" field - restrict board.json to standard features - rename Arduino board LED pins to be consistent bare-arm port: no changes specific to this component/port cc3200 port: - mods/modutime: use extmod version of time module - tools: fix exception raised on process failure - Makefile: build firmware.zip embed port: no changes specific to this component/port esp8266 port: - modutime: use extmod version of time module - add support for the Espressif ESP-NOW protocol - machine_pwm: implement duty_u16() and duty_ns() for consistency - add support to set/get power saving mode of WLAN - change network.WLAN from a function to a type - allow Ctrl-C to interrupt the corrupt-fs while loop - machine_pin: accept an integer argument to mp_obj_get_pin_obj - add board variant support - boards/ESP8266_GENERIC: add image filename - boards: make sure modespnow.o is placed in irom0 - boards/ESP8266_GENERIC: remove urllib from the 2MiB manifest esp32 port: - modutime: use extmod version of time module - add support for the Espressif ESP-NOW protocol - add support to set/get power saving mode of WLAN - change network.WLAN from a function to a type - boards: add some missing board configs for two UM boards - esp32_ulp: enable FSM ULP for S2 and S3 chips - uart: use xtal as UART clock source on S3 and C3 - modespnow: change name of buffer size config option to "rxbuf" - CMake: change PROJECT_DIR to CMAKE_CURRENT_LIST_DIR - esp32_ulp: fix ULP (FSM) support for S2 and S3 - allow Ctrl-C to interrupt the corrupt-fs while loop - switch from UART driver to UART HAL - ppp_set_auth: add pppapi_set_auth from ESP-IDF - modesp32: remove esp32.hall_sensor function - update port to support IDF v5.0.2 - in recv_cb, get espnow rssi from recv_info->rx_ctrl - network_wlan: wait for WIFI_EVENT_STA_START after activating - Makefile: provide more IDF shortcuts - boards: change SDK config parameters from deprecated to new ones - modules/inisetup.py: format partition as FAT if its label is ffat - machine_uart: always select a source_clk value in UART config - re-enable mDNS after move to IDF v5.0.2 - boards/GENERIC_OTA: enable silent checks to reduce firmware size - network_wlan: wait for STA/AP START/STOP event in wlan.active - machine_timer: switch from legacy driver to timer HAL - machine_pin: add a pin-find func and use it in machine_pin_get_id - use always machine_pin_get_id for getting a Pin id - add support for board-named pins and the Pin.board dict - collect properties from IDF-managed components as well - modmachine: add generic machine.bootloader() - usb: add custom TinyUSB callback support - boards/ARDUINO_NANO_ESP32: add support for Arduino Nano ESP32 - CMakeLists: enable multiple extra component directories in build - boards/ARDUINO_NANO_ESP32: fix deploy instructions - main: remove unused mbedtls debug function - machine_wdt: allow feeding WDT from threads - machine_hw_spi: fix access of SPI(2) - machine_hw_spi: remove unnecessary duplicate SPI pin defaults - machine_hw_spi: remove SPI host renaming for C3 and S3 variants - machine_hw_spi: check for valid SPI id in constructor, not init - boards: remove references to the IDF version in board.md files - README: specify that only IDF v5.0.2 is supported - allow malloc() to allocate from SPIRAM - enable automatic Python heap growth - gccollect: make level arg volatile to force recursive function - Makefile: implement `make submodules` to match other ports - boards/GENERIC: merge with GENERIC_{SPIRAM,OTA,D2WD,UNICORE} - boards/GENERIC_C3: merge with GENERIC_C3_USB - boards/GENERIC_S2: merge with ESP32_S2_WROVER - boards/GENERIC_S3: merge with GENERIC_S3_{SPIRAM,SPIRAM_OCT} - partitions.csv: rename to partitions-4MiB.csv - use uppercase variant names - Makefile: append board variant to BUILD - rename GENERIC* boards to ESP32_GENERIC* - boards/ESP32_GENERIC_C3: enable UART REPL - modsocket: add support for SO_BROADCAST socket option - modnetwork: add support for SO_BINDTODEVICE socket option - support JTAG console, free up UART - machine_uart: release GIL for blocking reads - boards: add pins.csv to UM boards and other minor changes - boards/UM_NANOS3: add new UM NanoS3 board - network_ppp: block after deleting task - boards/ARDUINO_NANO_ESP32: clarify recovery instructions - boards/UM_FEATHERS3: fix I2C pins in pins.csv - skip validation of image on boot from deepsleep - machine_pin: fix null pointer access in machine_pin_find - mphalport: add function/line/file info to check_esp_err exception - fix Partition.writeblocks() partial write corruption - boards: fix VBAT voltage calculation for UM S3 boards - boards: add bootloader rollback support for all builds - main: allow a board to override the MicroPython task stack size - boards/ARDUINO_NANO_ESP32: use Arduino USB IDs - boards/manifest.py: freeze aioespnow into firmware by default mimxrt port: - modutime: use extmod version of time module - machine_pwm: start PWM only if freq and duty are set - flash: separate low level driver code from flash object - mpconfigport: add back lost uos.urandom() - add missing UART defintion and remove obsolete config - machine_spi: ignore transfers with len=0 - machine_pin: perform full configuration in machine_pin_set_mode - sdcard: fix GCC 13 build error with sdcard_cmd_set_bus_width - led: add support for up to four LEDs - boards/ADAFRUIT_METRO_M7: add Adafruit Metro M7 board definition - machine_pwm: fix freq change, PWM print, and error checks - Makefile: use a specific fsl_flexspi_nor_boot.c for mimxrt1062 - machine_pin: fix bug when Pin.irq is called without a handler - hal/pwm_backport: fix 0 and 65536 edge cases of PWM's duty_u16 - machine_uart: add uart.deinit method and machine_uart_deinit_all - machine_uart: add support for UART hardware flow control - boards: add support for GPIO control of SNVS pins - hal: make flash clock frequency configurable - fix UART RTS/CTS assignments for the OLIMEX and Adafruit boards - machine_pin: extend pin configuration functions - sdio: add SDIO driver - integrate support for WiFi via the CYW43 driver - integrate Bluetooth support with NimBLE bindings - irq: move all IRQ related definitions to dedicated header - machine_uart: fix and complete UART.deinit and uart_deinit_all - boards: fix use of MICROPY_HW_SDRAM_AVAIL in MIMXRT1176.ld - machine_uart: support slow baud rates for UART - machine_uart: add a helper function to change the baudrate - sdio: move config guard so headers are only included if used - Makefile: update to work with latest TinyUSB - mpconfigport: don't override parse chunk alloc - sdio: add support for the 117x series - mimxrt_sdram: allow boards to override the default SDRAM config - Makefile: enable the FSL USDHC for supported MCU series - remove SDCARD Makefile config option - mpbthciport: enable flow control for BT HCI UART - mbedtls: enable certificate validity time validation - machine_uart: set the UART clock to a fixed 40MHz value - boards/MIMXRT1176_clock_config: fix comments about UART clocks - boards: fix naming of SD-card config option - mpbthciport: allow disabling UART flow control for BLE - machine_rtc: improve the RTC init at boot minimal port: no changes specific to this component/port nrf port: - modules/utime: use extmod version of time module - boards: rename all nRF boards to use uppercase pic16bit port: no changes specific to this component/port powerpc port: - mpconfigport: don't override parse chunk alloc qemu-arm port: no changes specific to this component/port renesas-ra port: - change MICROPY_HW_BOARD_NAME definition to product name - modutime: use extmod version of time module - update boards and ra directory files to support FSP v4.4.0 - add a macro definition to avoid compile error of FSP v4.4.0 - irq: fix typo in comment about IRQ priorities - consolidate hal_entry.c code and remove hal_entry() func - boards/make-pins.py: fix PA/PB pins support - consolidate all fsp_cfg header files to one location - support changing baudrate for UART - add support for RA6M5, and add machine PWM, DAC, SDCard - boards/VK_RA6M5: add new board definition - remove duplicate machine module from constants list - machine_spi: consistently use machine_pin_find to get pin - boards: remove unreachable code in make-pins.py - Makefile: generate binary firmware output - add TinyUSB support - add Bluetooth support using NimBLE - add RNG driver - add networking support using lwIP - add mbedTLS support - fsp_cfg: add common FSP config files - boards/ARDUINO_PORTENTA_C33: add support for Portenta C33 - boards/ARDUINO_PORTENTA_C33: update WiFi config - tune lwip buffers and timing to improve network performance rp2 port: - modutime: use extmod version of time module - machine_pwm: enable keyword args in constructor and add init method - machine_pwm: add support for inverting a PWM channel output - machine_pwm: add duty_x() checks and return 0 if PWM is not started - make rp2_state_machine_exec accept integers - CMakeLists: allow relative MICROPY_BOARD_DIR when invoking cmake - mphalport: only use CYW43 MAC for WLAN0 interface - CMake: normalize MICROPY_PORT_DIR - add Bluetooth support via cyw43 - mpbthciport: cancel existing alarms - boards/PICO_W: enable Bluetooth Low Energy support - machine_pin: factor out pin-find code from machine_pin_make_new - use uppercase variant names - Makefile: append board variant to BUILD - rename PICO, PICO_W to RPI_PICO, RPI_PICO_W - machine_timer: fix printing of timer period - mpbthciport: switch to static scheduler nodes - mpbthciport: fix HCI UART config - mpconfigport: disable BLE locking when MICROPY_PY_BLUETOOTH enabled - boards/ARDUINO_NANO_RP2040_CONNECT: use standard HCI UART baudrate - modmachine: fix lightsleep while wifi is powered off - msc_disk: allow configuring the USB MSC inquiry response - README: fix name of RPI_PICO_W board - CMakeLists: enable debug symbols in all builds - implement time.time_ns with time_us_64 so it has us resolution samd port: - modutime: use extmod version of time module - machine_pwm: add init() method to PWM and simplify the PWM code - mpconfigport: drop support for SoftSPI max speed - boards/MINISAM_M4: update pins.csv for the Mini SAM M4 board - rearrange the MCU-specific loader files - mcu/samd51: enable MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF - boards: add default deploy instructions - main: fix sercom deinit ordering in soft-reset - modmachine: add machine.deepsleep as alias of machine.lightsleep - modmachine: make some machine classes configurable by #defines - boards/SEEED_WIO_TERMINAL: rename two pins starting with a digit - mcu: reduce the startup time after hard reset - machine_uart: add support for UART hardware flow control - boards/ADAFRUIT_METRO_M4_EXPRESS: add Metro M4 Express Airlift - boards: rename flash pins consistently for QSPI and SPI - samd_spiflash: add SPI flash driver and configure it accordingly - samd_qspiflash: add QSPI flash driver and configure it accordingly - adapt existing samd.Flash and integrate with (Q)SPI flash in boot - boards: extend the code size limit for boards with external flash - set the LFS type in mpconfigmcu.mk instead of mpconfigboard.mk - Makefile: move the math lib files from mpconfigmcu.mk to Makefile - Makefile: print memory region usage instead of totals - mpconfigport: enable DHT and onewire drivers on all MCUs/boards - mpconfigport: provide the platform module - modules/_boot.py: add /lib to sys.path - mpconfigport: don't override parse chunk alloc stm32 port: - modutime: use extmod version of time module - boards/ARDUINO_PORTENTA_H7: enable FDCAN - boards/stm32h723_af.csv: fix ADC AF definitions - mboot: fix alignment of packed final buffer - irq: fix typo in comment about priorities - usb: fix USB support on STM32G4 - boards/NUCLEO_G474RE: make it easier to enable USB - adc: add support for STM32L4A6 MCUs - boards/NUCLEO_L4A6ZG: add new board definition - help: don't include unavailable features in help() - help: exclude legacy entries from help, and adjust constant names - mpconfigboard_common: provide default spidev config - boards: use default spibdev config where appropriate - Makefile: pass relevant CPU flags to assembler - make-stmconst.py: support structs with names ending in _t - main: start UART REPL as early as possible - usbd_conf: treat G0 USB periph as MICROPY_HW_USB_IS_MULTI_OTG=0 - machine_adc: handle ADC resolution less than 8 bits on all MCUs - add initial support for H5 MCUs - boards: add ld, af.csv and hal_conf_base.h files for H5 MCUs - octospi: add preliminary support for OCTOSPI peripheral - boards/STM32H573I_DK: add H5 board definition files - add USB support for STM32L1 MCUs - modify RCC->APB2ENR directly instead of HAL API - modmachine: remove duplicate machine_timer_type declaration - modmachine: make machine_reset_cause_obj public - dac: fix dac.write_timed on G4 MCUs to use 32-bit DMA access - adc: fix ADC clock prescaler for G4 MCUs - adc: fix pyb.ADCAll.read_core_temp for G4 MCUs - adc: fix reading internal ADC channels on G4 MCUs - machine_adc: fix machine.ADC to work on G4 MCUs - adc: add workaround for ADC errata with G4 MCUs - adc: fix pyb.ADCAll.read_core_bat on G4 and L4 MCUs - qspi: allow qspi_write_cmd_data to write cmd with 1 data byte - mpconfigport: always define MICROPY_SOFT_TIMER_TICKS_MS - remove duplicate machine module from constants list - boards/B_L072Z_LRWAN1: add pin definitions for internal SX1262 - boards/B_L072Z_LRWAN1: lower default ROM level to "Core" - spi: add STM32WL5 SUBGHZ SPI peripheral - powerctrlboot: support STM32WL system clock from HSE+PLL - dma: fix DMA completion on WL55 boards - subghz: add STM32WL55 subghz radio interface to stm module - modstm: add MICROPY_PY_STM_CONST flag, clear it for STM32WL5 - use uppercase variant names - Makefile: append board variant to BUILD - mboot: fix fwupdate by replacing zlib with new deflate module - uart: fix UART timeout issue with low baudrate on G4 MCUs - timer: fix deadtime config on Advanced Timer peripherals - dma: add support for SPI1 DMA on H5 MCU's - octospi: add support for dual-line SPI interface - powerctrlboot: allow using PLL3 for USB clock on H5 MCU's - timer: fix use of TIM8 on H5 MCU's - uart: add support for UART10 when it's a USART - powerctrlboot: allow PLL1 Q and R outputs to be enabled on H5 - adc: fix STM32H5 support - adc: add support for STM32H5 ADC2 inputs - adc: optimize sampling time for G4, H5, L4 and WB MCUs - machine_adc: fix and improve STM32H5 support - dac: add STM32H5 DAC support, with dma_nohal implementation - boards: move includes to after defines in all hal_conf.h files - uart: generalise UART source clock calculation for H5 and H7 MCUs - dma: remove unbalanced ) - usbd_msc_interface: allow configuring the MSC inquiry response - boards/ARDUINO_GIGA: update board config - i2c: add support for I2C4 on H7 MCUs teensy port: no changes specific to this component/port unix port: - modutime: use extmod version of time module - Makefile: allow variants to add QSTR_DEFS - main: add NLR scope for checking module __path__ - README: fix Markdown link markup - modsocket: add poll support for missing ERR,HUP,NVAL poll values - modselect: remove unix-specific implementation of select module - modjni: fix build errors with type definitions and error strings - main: fix memory leakage if MICROPY_USE_READLINE is disabled webassembly port: - modutime: use extmod version of time module - make mp_js_do_str asynchronous - make mp_js_process_char asynchronous - replace typeof window check with ENVIRONMENT_IS_NODE flag windows port: - Makefile: allow variants to add QSTR_DEFS zephyr port: - modutime: use extmod version of time module ======== Wed, 26 Apr 2023 15:42:28 +1000 v1.20.0 New mip package manager, compressed type structs and Pico W support This release of MicroPython introduces a new lightweight package manager called mip, which uses a custom protocol to query and install packages that is optimised for embedded systems. It is intended to take over the role of upip and supports installing packages from micropython-lib as well as any URL. Mip can be run directly on a device (with network connectivity) or via mpremote. As part of this, all pure-Python drivers have been moved from the micropython repository to the micropython-lib repository, making it easier to install the packages needed for a given project. In the MicroPython runtime, core/built-in types have been compressed by only including in the C-level type struct as many slots for C function pointers as is needed for a given type (instead of storing NULL pointers for unused slots). This resulted in a reduction of code size of many kilobytes for all ports (eg around 1200 for bare-arm) with a very minimal loss in performance. Any third-party C extensions will need to be updated to work with this change. See commits 662b9761b37b054f08fe2f7c00d0fce3a418d0b0 and 3ac8b5851e5f4dade465d52b91ed2ccc17851263 for details. The MicroPython VM/runtime has also seen many improvements and bug fixes, including: addition of hex/fromhex methods to bytes/memoryview/bytearray, dictionary union (PEP 584), support for __float__ and __complex__ functions, support for __dict__ on module objects and UTF-8 validation of all strings. Whole number floats are now formatted exactly, and there have been other accuracy improvements to parsing and formatting of floats. A sub-version has been introduced for .mpy files which is used only when a .mpy file includes native code, allowing the native ABI to change while retaining backwards compatibility with pure bytecode .mpy files. There is now an option to have the GC heap split across more than one pool of memory, although this is not yet in use by the ports. And root pointer registration has been simplified with the new MP_REGISTER_ROOT_POINTER macro. In the network module, the keyword arguments to scan(), connect() and config() have been renamed to be more consistent across ports and drivers. The changed argument names are: "essid" changed to "ssid", "auth" or "authmode" changed to "security", and "password" changed to "key". The old keyword arguments are still supported so this change is backwards compatible. The functions network.hostname() and network.country() have also been added and provide a standard interface across ports to set the global networking configuration for all interfaces and interface types. In particular, setting the hostname is now supported for all CYW43xx-based boards (pyboard-D, Arduino Portenta, Pico W, and others). The mbedtls (SSL library) settings have also been unified across ports that use this library and enable elliptic curve DH and DSA cryptography enabled so that devices can connect to more websites. The cert_reqs and cadata arguments have also been implemented. Sockets now support leaving multicast groups. WebREPL will now run the page from the device, allowing WebREPL resources to load from a HTTPS site. The bluetooth module has a minor breaking change for IRQ_GATTC_CHARACTERISTIC_RESULT: def_handle has been replaced with end_handle. This is not expected to affect most programs as def_handle is unlikely to be used. See commit cacc96d98c2a70dc7e5194331ea70746c39746ec. The uasyncio module now supports stream read(-1), handles gather with no awaitables, and adds a clear() method to ThreadSafeFlag. The framebuf module adds ellipse and polygon drawing methods, and a fill argument to rect() for consistency with those new methods. A new port has been added, the "embed" port, which is a port of MicroPython that targets the C language and outputs a set of self-contained .c and .h files for embedding into a wider project. An example is provided to show how this works. The esp8266 port has reverse-special-methods enabled on the GENERIC board, uart.flush() and uart.txdone() added, real open drain output enabled on pins driven by PWM, and adds the ability to set TX power for the WLAN interface. The esp32 port now uses synchronous BLE events which allows support for BLE pairing and bonding. The LAN driver adds support for LAN8710, KSZ8081, configuration of ETH ref_clk pin, and support for SPI-based Ethernet chips. UART now supports setting timeout_char and implements uart.flush() and uart.txdone(). New boards include ESP32S3 with octal SPIRAM, Olimex PoE boards and a generic board for unicore chips. There have also been many bug fixes, in particular for newer MCU versions such as S2, S3 and C3. The mimxrt port has seen a lot of clean up of the code, support for MIMXRT1176 MCUs and the MIMXRT1170_EVK board, a soft-timer implementation of machine.Timer, addition of machine.bootloader(), as well as uart.flush() and uart.txdone(). On the nrf port, machine.UART and machine.PWM have been improved to match other ports (the PWM change is a breaking change), and machine.I2C now supports the freq argument. New boards include the Arduino Nano 33 BLE sense board and the Seeed XIAO NRF52840 Sense. The rp2 port sees the integration of the CYW43xx WiFi driver which is used in the new Pico W board, a board similar to the Pico but with WiFi support. Other new boards include W5500_EVB_PICO, WEACTSTUDIO and the nullbits Bit-C PRO board. Support has been added for named pins, including Pin.board and Pin.cpu attributes, consistent with other ports that support this feature. The machine.lightsleep() function has been implemented, along with SSL certificate time validation, and more accurate formulas are used to determine PWM frequency and duty. The GC heap available to MicroPython programs has been increased to use the maximum available free RAM, adding about 20k to the user heap. There have also been important bug fixes to threading and concurrency when using both cores. The samd port has been significantly extended to include: named pins with a pins.csv file, and Pin.board and Pin.cpu attributes; ADC, PWM, DAC, SoftSPI, SoftI2C, SPI, I2C and RTC classes added to the machine module; pin.irq() method and OPEN_DRAIN mode for pins; freq, disable_irq, enable_irq, idle, lightsleep and time_pulse_us functions added to the machine module. Floating point support has been added for SAMD21 devices, and the math module enabled for SAMD51. A board definition for Sparkfun Think Plus has been added. The stm32 port sees support added for STM32L1xx MCUs, STM32H723, USB on STM32G0xx and mboot support for STM32G0xx. The existing CYW43xx WiFi driver has been replaced with the open-source version of cyw43-driver and this has been integrated with all existing boards with CYW43xx chips. Support for the CC3000 WiFi driver has been removed, and the Wiznet driver integration has been reworked to use the generic one shared with other ports (and also uses lib/wiznet5k instead of the old drivers/wiznet5k). Hardware I2C implementation has been added for STM32L1xx and STM32L4xx, support added for Arduino 1200bps touch to enter the bootloader (only on Arduino boards), mbedtls (SSL) certificate time validation added, and link-time-optimisation (LTO) enabled by default on boards with small flash size. New board definitions include: LEGO Hub No. 7, NUCLEO-L152RE, NUCLEO-F756ZG, NUCLEO-H723ZG, Arduino Nicla Vision and Arduino Giga H7. Arduino boards also now include a range of frozen libraries including senml. For the unix and windows ports, build outputs (including executables) are now kept inside the $(BUILD) directory associated with the build. As part of this the variant suffix has been removed from the executable name. For example, what was micropython-coverage is now build-coverage/micropython, and the standard variant is build-standard/micropython. Furthermore, the dev variant has been removed and its features enabled instead on the standard variant, which now enables the same feature set as a typical bare-metal board, making it more convenient to use for development. The remaining variants are: minimal, standard, nanbox, coverage. The SSL implementation for this port has switched from axtls to mbedtls, again to match most bare-metal ports. The javascript port has been renamed to the webassembly port, and adds support for VFS and VfsPosix using Emscripten's POSIX filesystem layer. The way stdout printing works has also changed to dispatch via a custom event called "micropython-print". The zephyr port upgraded Zephyr to v3.1.0, added custom configuration for bbc_microbit_v2, and enabled finalisers. The change in code size since the previous release for various ports is (absolute and percentage change in the text section): bare-arm: -1124 -1.934% minimal x86: -4322 -2.967% unix x64: +264181 +50.533% standard stm32: -3592 -0.906% PYBV10 cc3200: -1832 -0.990% esp8266: -2284 -0.327% GENERIC esp32: +9659 +0.632% GENERIC nrf: -84 -0.045% pca10040 rp2: +13096 +4.291% PICO samd: +127776 +90.488% ADAFRUIT_ITSYBITSY_M4_EXPRESS The changes that dominate these numbers are: - bare-arm, minimal, stm32, cc3200, esp8266: reduced size due to compressed type structs - unix: switching axtls for mbedtls, merging in dev configuration options and features - esp32: new Ethernet drivers and some additional machine module functionality - nrf: compressed type struct and machine module improvements - rp2: additional mbedtls features and ciphers - samd: many new features, and machine module classes and functions Thanks to everyone who contributed to this release: Alex Riesen, Andrew Leech, Andrew Scheller, Angus Gratton, Antonello Margottini, Antonin ENFRUN, Ayke van Laethem, Blake Felt, brave ulysses, Brian Cooke, Brian Pugh, Carlosgg, Chris Overgaauw, Chris Swan, Chris Waggoner, chrismas9, Christian Clauss, Christian Walther, Clayton Cronk, cpottle9, Dale Weber, Damiano Mazzella, Damien George, Damien Tournoud, Dan Ellis, Daniel Jour, David (Pololu), David Grayson, David Lechner, David Peake, David Yang, Dorukyum, Efi Weiss, enriquezgarc, Felix Dörre, Florian Weimer, glenn20, hoihu, Howard Lovatt, iabdalkader, Ian Davies, IcedRooibos, Ihor Nehrutsa, Jacob Siverskog, Jan Hrudka, Jan Willeke, Jared Hancock, Jatty_, Jay Greco, Jeff Epler, Jeremy Rand, Jim Mussared, Jonas Scharpf, Jos Verlinde, Juan Francisco Cantero Hurtado, Koen De Vleeschauwer, Kyuchumimo, Lars Haulin, Laurens Valk, LiaoJingyi_winY7kp, Luiz Brandao, ma-lalonde, manobendro, Maripo GODA, Mark Grosen, Martin Milata, Mat Booth, Matt Trentini, Maureen Helm, Michael Bentley, Michael Mogenson, MrJake222, Nathan Hendler, Ned Konz, Nicholas H.Tollervey, Oliver Joos, omogenot, Patrick, Patrick Joy, Paul Grayson, Paul Warren, Pepijn de Vos, Peter Harper, Peter Hinch, PGE, Phil Howard, Philip Peitsch, Philipp Ebensberger, pmendham, Rayane Chatrieux, Red_M, Rob Knegjens, robert-hh, Sebastian Romero, Simon Arlott, Sky, Stewart C. Russell, Stig Bjørlykke, stijn, Stuart Langridge, Takeo Takahashi, Thorsten von Eicken, Tim Gates, Tobias Thyrrestrup, Tomasz 'CeDeROM' CEDRO, Tomofumi Inoue, TPReal, Trammell hudson, Wind-stormger, yn386, Yonatan Goldschmidt, 小权一句两句. The work done in this release was funded in part through GitHub Sponsors, by George Robotics, and by Planet Innovation. What follows is a detailed list of changes, generated from the git commit history, and organised into sections. Main components =============== all: - fix paths to mpy-cross and micropython binaries - remove MICROPY_PY_IO_FILEIO config option - update all manifest.py files to use new features - simplify buffer protocol to just a "get buffer" callback - standardise mp_obj_type_t initialisation - make all mp_obj_type_t defs use MP_DEFINE_CONST_OBJ_TYPE - fix #if inside MP_DEFINE_CONST_OBJ_TYPE for msvc - remove unnecessary locals_dict cast - use += rather than = everywhere for CFLAGS/LDFLAGS/LIBS - keep msvc build output in build/ directories - fix Python comparison to None and True, and use "not in" - use micropython-lib unconditionally in manifests - replace upip with mip everywhere - update Python formatting to black "2023 stable style" - update copyright year range to include 2023 py core: - vm: change comparison for finally handler search from > to >= - emit: remove logic to detect last-emit-was-return-value - emit: suppress unreachable bytecode/native code that follows jump - objcell: make cell get/set funcs static-inline to reduce code size - parsenum: support parsing complex numbers of the form "a+bj" - parsenum: fix parsing of complex "j" and also "nanj", "infj" - parsenum: optimise when building with complex disabled - objclosure: forward function attributes for closures - objfun: support function attributes on native functions - builtin: remove unnecessary module declarations - builtinhelp: don't show help for an MP_MODULE_ATTR_DELEGATION_ENTRY - mkrules.cmake: improve printing of git-submodules error - scheduler: de-inline and fix race with pending exception / scheduler - vm: document internal SELECTIVE_EXC_IP option - emitnative: fix STORE_ATTR viper code-gen when value is not a pyobj - vm: remove check for ip being NULL when handling StopIteration - vm: in YIELD_FROM opcode, expand helper macros and remove them - vm: consistently indent #if guards to match the code they surround - objnamedtuple: fix segfault with empty namedtuple - misc: add MP_STATIC_ASSERT_NOT_MSC() - obj: add static safety checks to mp_obj_is_type() - obj: add debug-only runtime checks to mp_obj_is_type() - make_root_pointers: add MP_REGISTER_ROOT_POINTER parser/generator - mpstate: drop MICROPY_PORT_ROOT_POINTERS from mp_state_vm_t - persistentcode: use MP_REGISTER_ROOT_POINTER() - modsys: use MP_REGISTER_ROOT_POINTER() - scheduler: use MP_REGISTER_ROOT_POINTER() - misc: fix msvc compilation with compressed error messages - qstr: make mp_decompress_rom_string decl and def the same - gc: allow the GC heap to be split over multiple memory areas - gc: reduce code size when MICROPY_GC_SPLIT_HEAP is disabled - obj: add support for __float__ and __complex__ functions - obj: make mp_obj_get_complex_maybe call mp_obj_get_float_maybe first - compile: support large integers in inline-asm data directive - modio: remove FileIO and TextIOWrapper from io module - formatfloat: format all whole-number floats exactly - builtinimport: remove duplicate static function argument - mkenv.mk: use micropython-lib from submodule by default - runtime: fix crash in star arg unpacking - mpprint: fix formatting typo with mp_print_ext_t struct name - objstr: reformat str access macros to make them readable - mkrules.mk: keep all build artefacts inside $(BUILD) directory - dynruntime.mk: allow building assembly source in natmods - nlrpowerpc: fix generation of ppc64 code on ppc32 build - qstr: change qstr hash type from mp_uint_t to size_t - objstr: consolidate methods for str/bytes/bytearray/array - objstr: add hex/fromhex to bytes/memoryview/bytearray - objstr: remove str function object declarations from header file - mkrules: use abspath to find directory for mpy-cross dependency - parsenum: ensure that trailing zeros lead to identical results - formatfloat: use pow(10, e) instead of pos/neg_pow lookup tables - dynruntime: add mp_obj_is_true - clean up formatting of union definitions - builtinimport: allow overriding of mp_builtin___import__ - objstr: split mp_obj_str_from_vstr into bytes/str versions - objstr: always ensure mp_obj_str_from_vstr is unicode-safe - objstr: optimise mp_obj_new_str_from_vstr for known-safe strings - objstr: always validate utf-8 for mp_obj_new_str - persistentcode: clarify ValueError when native emitter disabled - objpolyiter: add a new polyiter type with finaliser support - mpconfig: add LFS1/LFS2 options to match FAT/posix - mpconfig: make feature levels available to mpconfigport.h - mpconfig: add "everything" features from unix coverage - objpolyiter: fix comment about finaliser method - mkrules.mk: add link to build troubleshooting on failure - obj: add macro to declare ROM mp_obj_type_t instances - objexcept: make MP_DEFINE_EXCEPTION use MP_DEFINE_CONST_OBJ_TYPE - obj: add "full" and "empty" non-variable-length mp_obj_type_t - obj: add accessors for type slots and use everywhere - obj: add slot-index mp_obj_type_t representation - obj: remove basic mp_obj_type_t sparse representation - objtype: optimise slot RAM usage for instance types - objnamedtuple: optimise slot RAM usage for namedtuple - obj: merge getiter and iternext mp_obj_type_t slots - obj: convert make_new into a mp_obj_type_t slot - obj: optimise code size and performance for make_new as a slot - persistentcode: introduce .mpy sub-version - objmodule: add support for __dict__ - runtime: add mp_raise_OSError_with_filename helper function - include filename in errors from loading/saving files via "open" - parse: allow const types other than int to optimise as true/false - objstr: don't treat bytes as unicode in str.count - mkenv.mk: make CPP definition explicit for consistency - objstr: add a helper to set mp_obj_str_t data - modsys: add support for sys.executable - py.mk: make user-C-module handling self-contained in py.mk - misc: remove use of bitfield from vstr_t - obj: verify floating point type is correct for repr C - persistentcode: only emit sub-version if generated code has native - obj: add comments explaining the slot index scheme - makeversionhdr: fall back to py/mpconfig.h instead of docs/conf.py - builtinimport: fix crash handling "weak link" module names - objarray: detect bytearray(str) without an encoding - emitnative: ensure load_subscr does not clobber existing REG_ARG_2 - nlrmips: add native NLR support for MIPS architecture - makeversionhdr.py: allow running outside of repo - objdict: implement dictionary union (PEP 584) - bc: fix checking for duplicate **kwargs - modmicropython: make module optional - mpconfig: include micropython module in core features - remove the word "yet" from exception messages - pass in address to compiled module instead of returning it - gc: avoid valgrind false positives - gc: ensure a gap of one byte after the ATB - gc: fix debug printing of GC layout - obj: remove unused MP_DEFINE_CONST_OBJ_FULL_TYPE macro - emitnative: initialise locals as Python object type for native code - map: clear value when re-using slot with ordered dictionaries - gc: increase the address length in gc_dump_alloc_table() - objarray: raise error on out-of-bound memoryview slice start - lexer: wrap in parenthesis all f-string arguments passed to format - add parenthesis to default impl of MP_OBJ_TO_PTR, MP_OBJ_FROM_PTR - objint_mpz: catch and reject @ and @= operating on big integers - mkrules: support mpy-tool-flags in cmake frozen code generation - mkrules.cmake: force build mpversion.h and frozen_content.c - modmath: fix two-argument math function domain check - emitnative: explicitly compare comparison ops in binary_op emitter - makeversionhdr.py: optionally get git tag and git hash from env vars - compile: fix scope of assignment expression target in comprehensions - gc: make gc_dump_info/gc_dump_alloc_table take a printer as argument - mpconfig: provide config option for internal printf printer - builtinimport: fix unix port build with external imports disabled - makeversionhdr.py: always add micro to version string even if it's 0 - obj: add MP_NOINLINE to mp_obj_malloc_helper - mpstate: add mp_thread_is_main_thread() helper macro - scheduler: implement VM abort flag and mp_sched_vm_abort() - obj: fix spelling of staticmethod - makeqstrdefs.py: fix handling GreenHills C/C++ preprocessor output extmod: - network_cyw43: rename WLAN keyword args to ssid/security/key - network_ninaw10: rename WLAN connect argument from essid to ssid - modlwip: clean up inclusion of modlwip in build process - extmod.cmake: only include modbtree in build if it's enabled - extmod.mk: separate out extmod file list from py.mk to extmod.mk - modbtree: use buffer protocol for keys/values - uasyncio: attempt to write immediately in Stream.write method - uasyncio: implement stream read(-1) to read all data up to EOF - vfs: prevent uninitialized variable warning for path_out - network_cyw43: support new cyw43-driver - modnetwork: include cyw43-driver header if it's enabled - network_cyw43: add "security" config option to get/set auth mode - btstack: use MP_REGISTER_ROOT_POINTER() - nimble: use MP_REGISTER_ROOT_POINTER() - modnetwork: use MP_REGISTER_ROOT_POINTER() - uos_dupterm: use MP_REGISTER_ROOT_POINTER() - modlwip: use MP_REGISTER_ROOT_POINTER() - vfs: use MP_REGISTER_ROOT_POINTER() - modbluetooth: use MP_REGISTER_ROOT_POINTER() - always use custom mbedtls error message code - modussl_mbedtls: implement cert_reqs and cadata arguments - btstack: fix descriptor discovery handle range and events - network_ninaw10: move ninaw10 root pointer registrations here - modbluetooth: add support for running sync irq on system thread - webrepl: allow the page to run from the device (over HTTP) - uasyncio: handle gather with no awaitables - ntptime: factor out ntptime module from esp8266 port - modussl_mbedtls: set a more sensible default debug log level - network_cyw43: add hostname config option - network_wiznet5k: register NIC when the lwIP stack is used - network_wiznet5k: drop obsolete argument count check - network_wiznet5k: deinit the NIC before (re-)initialisation - network_wiznet5k: schedule clearing of interrupt flags - network_wiznet5k: rearrange the function wiznet5k_poll() - network_wiznet5k: extract SPI transfer function dynamically - uasyncio: add clear method to ThreadSafeFlag - uasyncio: rename internal _flag to state, to save a qstr - modlwip: add support for leaving multicast groups - vfs_posix_file: remove unused MICROPY_VFS_POSIX_FILE - modframebuf: optimise argument handling - modframebuf: add fill argument to rect() - modframebuf: add ellipse drawing method - modframebuf: add polygon drawing methods - modframebuf: improve poly-fill boundary pixels - network_wiznet5k: use the configured DNS address if available - machine_i2c: call MICROPY_PY_EVENT_HOOK during i2c.scan() - modure: convert byte offsets to unicode indices when necessary - modbluetooth: fix descriptor registration with empty tuple - modbluetooth: replace def_handle with end_handle in char IRQ - vfs: add finaliser to ilistdir to close directory handle - vfs_posix_file: implement finaliser for files - modbluetooth: change data_len type from size_t to uint16_t - modbluetooth: do GATTC reassembly in protected uPy context - modbluetooth: run BLE IRQ callback in protected NLR context - extmod.mk: make extmod.mk handle GIT_SUBMODULES - make extmod.mk self-contained - utime_mphal: make ticks_add check for overflow of delta - btstack: update BTstack bindings to work with latest BTstack - mbedtls: add common configuration file, and use it in all ports - mbedtls: enable MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE - mbedtls: enable elliptic curve DH and DSA cryptography - mbedtls: remove MBEDTLS_ECP_DP_CURVE25519_ENABLED config - mbedtls: remove brainpool curves from config - machine_timer: move stm32's implementation of machine.Timer here - vfs_posix: include errno.h and unistd.h headers - extmod.cmake: allow overriding the default MBEDTLS_CONFIG_FILE - modlwip: use actual errno in exception for error in listen - extmod.mk: set default mbedtls config file in extmod Makefile - btstack: allow the BTstack config to be overridden by a board - add and reorganise compilation guards and includes - extmod.cmake: add MICROPY_PY_BTREE compiler definition - moduplatform: remove _M_IX86 test for xtensa - moduplatform: fix MSVC x86_64 check - modframebuf: fix crash in FrameBuffer scrolling beyond extents - uasyncio: fix syntax of generator functions - modnetwork: use a type protocol to implement NIC functions - modussl_mbedtls: fix support for ioctl(MP_STREAM_POLL) - network_cyw43: fix handling of networks with open security - axtls-include: add back needed header files for building axTLS - utime_mphal: fix comment re delta range check in time_ticks_add - modbtree: move system includes within MICROPY_PY_BTREE guard - modnetwork: add network.hostname() and network.country() - modnetwork: allow more extensive port-specific customisation - network_cyw43: use CYW43_CHANNEL_NONE for default arg in connect - vfs_posix: do not filter '..*' in ilistdir when filtering '..' - network_ninaw10: check socket types when creating new sockets - network_cyw43: fix setting hostname using config() method - network_cyw43: add support to get STA RSSI using status() method - network_ninaw10: add missing raw socket type to socket() - btstack: switch to use hci_dump_init instead of hci_dump_open - modbluetooth: merge gatts_notify/indicate implementation - btstack: fix indicate/notify queuing - btstack: include value handle in client read/write events - btstack: fix MTU handling - btstack: add support for CCCD to allow client subscriptions - nimble: fix flags for descriptor registration - modbluetooth: make all HCI transports trace in the same format - btstack/modbluetooth_btstack: add default services shared: - runtime/tinyusb_helpers: add TinyUSB helper functions - netutils/dhcpserver: match default DNS to server IP - readline: use MP_REGISTER_ROOT_POINTER() - runtime/pyexec: use MP_REGISTER_ROOT_POINTER() - runtime/softtimer: move softtimer.[ch] to shared/runtime - runtime/softtimer: remove obsolete #include statement - runtime/sys_stdio_mphal: make func static and remove some TODOs - runtime/gchelper_native: fix pointer cast on x86_64 - netutils: add "py/obj.h" header include - tinyusb: create common TinyUSB code for reuse by ports - tinyusb: further refactor static USB device implementation - tinyusb: fix CDC bNumInterfaces value - runtime: use mp_printf consistently, instead of printf - runtime/gchelper: drop cpu directive from ARM asm helpers - runtime/softtimer: use consistently the same clock source - runtime/softtimer: fix ticks range when computing ticks diff - tinyusb: allow max USB descriptor string to be configured - runtime/pyexec: don't allow Ctrl+C to interrupt frozen boot code - tinyusb: revert setting of CFG_TUD_CDC_EP_BUFSIZE to 256 drivers: - hts221: add HTS221 humidity sensor driver - lsm9ds1: add LSM9DS1 IMU driver - lps22h: add LPS22HB/HH pressure sensor driver - lps22h: use machine.idle for power saving - ninaw10/nina_wifi_bsp: use MP_REGISTER_ROOT_POINTER() - fix a few typos in comments - cyw43: allow configuring the netif/mDNS hostname - sdcard: add delay in init_card_v1 to make timeout work - wiznet5k: remove old Wiznet driver - cc3000: remove CC3000 WiFi driver files - display: don't include tests by default - remove drivers that are now in micropython-lib - ninaw10: connect to WiFi asynchronously - bus: detect QSPI transfer errors and pass up to spiflash driver - bus: change QSPI read_cmd signature to return an error code - ninaw10: implement machine.Pin external pin controls - cyw43: use board-defined BLE UART secondary baudrate - cyw43: use a different baudrate for BT firmware download - ninaw10: fix machine_pin GPIO read - cyw43: include CYW43 config file - ninaw10: add missing external pins 34 and 39 - ninaw10: fix ESP32 input-only pins mpy-cross: - Makefile: respect existing CFLAGS and LDFLAGS - remove .gitignore file - include alloca.h for NetBSD - mpy_cross: add Python wrapper for mpy-cross - mpy_cross: fix default path to mpy-cross binary - mpy_cross: add a way to query the mpy version - mpy_cross: add list of architectures to `__all__` - mpy_cross: add docstrings to public methods - main: don't set a default native architecture - main: add MSVC-compatible architecture checks - force forward slashes in paths - main: fix return type of mp_import_stat lib: - cyw43-driver: add new submodule for CYW43xx WiFi driver - pico-sdk: update to version 1.4.0 - cyw43-driver: update cyw43-driver to fix ap_auth mode setting - tinyusb: update to the most recent master - cyw43-driver: update driver to latest version - micropython-lib: add micropython-lib as a submodule - lwip: update lwIP to v2.1.3, tag STABLE-2_1_3_RELEASE - micropython-lib: update to latest version with manifest changes - micropython-lib: update submodule to latest - stm32lib: update library to get L1 v1.10.3, and some other fixes - micropython-lib: update submodule to latest - btstack: update to v1.5.3 - micropython-lib: update submodule to latest - libm: use __asm__ instead of asm - btstack: update to v1.5.4 - cyw43-driver: update driver to latest version - re1.5: reduce code size when checking for named class char - re1.5: add support for named classes in class sets - micropython-lib: update submodule to latest - cyw43-driver: update driver to latest version - pico-sdk: update to version 1.5.0 - cyw43-driver: update driver to latest version v0.9.0 - micropython-lib: update submodule to latest - stm32lib: update library to get H7 v1.11.0 - cyw43-driver: update driver to latest version v1.0.0 - micropython-lib: update submodule to latest Support components ================== docs: - update to use new WLAN argument names for ssid/security/key - library/pyb.Timer: document `brk` argument and its constants - library: remove unnecessary "pyb." prefix on class names - set LaTeX engine to XeLaTeX for PDF generation - library/machine: add note on interrupts being critical to system - library/uasyncio: consistently use "uasyncio" instead of "asyncio" - library/bluetooth: add link to aioble - library/neopixel: add note that neopixel is included in rp2 builds - library/time: provide more info about which epoch is used - library/pyb.Pin: fix out-of-context paragraphs, and AF_PP typo - library/pyb.Pin: add Pin.ALT constant - library/pyb.Timer: document how to use BKIN pin with example - update links for Arm GCC toolchain - library/rp2: fix pull_thresh docs to use pull instead of push - esp32: fix string quoting consistency in SDCard mount example - update CPython differences and improve the look of table layouts - esp32: update UART quickref on input-only pins - library/machine.UART: add notes about UART init and deinit - library: fix nested rst styles not rendering - library/micropython: fix spelling of compiler - templates/topindex.html: update forum link - library/machine.I2C: add a note about I2C pull-up resistors - library/machine.UART: add docs for uart.flush() and uart.txdone() - renesas-ra: add pin drive keyword argument description - Makefile: enable parallel compilation for Sphinx - templates/layout.html: indicate latest vs release docs - samd: add documentation for the samd port - library/machine: add machine.memX to docs with brief example - samd/pinout: fix the pin numbering for the default assignments - develop: fix mp_compile snippet to match latest code - renesas-ra: correct the internal file system size of EK-RA6M2 - library/array: add docs for dunder methods - library/pyb.CAN: update the recv example to take a 5-tuple - library/uasyncio: describe restriction on ThreadSafeFlag - library/framebuf: clarify docs for blit regarding palette - library/struct: fix buffer argument description - library/struct: embed format tables - library/neopixel: update GitHub URL for neopixel.py link - differences: update Python 3.9 status - differences: add Python 3.10 page - rp2: make LED have exactly 50% duty cycle in PIO 1Hz example - library/rp2.StateMachine: expand put() documentation - library/socket: use correct sockaddr variable name - esp32/quickref: add docs for the LAN interface constructor - library/machine.Timer: add freq argument to machine.Timer - reference/constrained: add missing heap-dump symbols to mem_info() - zephyr/quickref: fix zsensor module usage examples - library/network: update docs for network.country, network.hostname - update copyright year range to include 2023 examples: - embedding: remove obsolete axtls build target - usercmodule: add example of a native C class - embedding: rework example to use ports/embed - rp2: add comment that examples using IO25 don't work on Pico W - bluetooth: fix check for _conn_handle being None - usercmodule/cexample: use mp_obj_malloc() - bluetooth/ble_temperature_central.py: remove service tuple tests: - extmod: add heap-lock test for stream writing - basics: add tests for __name__ and __globals__ attrs on closures - perf_bench: add some configurations for N=32, M=10 - add an explanation of run-perfbench.py - fix run-perfbench parsing "no matching params" case - micropython: add test for builtin execfile() function - extmod/ussl_basic: make test run on axtls and mbedtls - cpydiff: fix formatting of code snippet to use double quotes - run-tests.py: provide better default MPYCROSS value for Windows - extmod/ubinascii: add tests for bytes.hex etc - update path to unix micropython executable - unicode: add test for invalid utf-8 file contents - renesas-ra: update pin test to support all boards - extmod/uasyncio_heaplock.py: force SKIP on stackless - frozen: move frozentest.mpy from ports/ to tests/ - run-multitests: extend usage information - run-multitests: make paths more deterministic - allow 'special' tests to output "SKIP" on a single line - extmod: add test for sleep_ms value that overflows ticks - run-perfbench: support --heapsize argument and pass to executable - basics: add exp file for builtin_str_hex test - run-tests.py: use host arch for mpy-cross for target=unix - misc: add test for cexample module - misc/cexample_module: test class presence - misc/cexample_class: fix timing sensitivity - extmod/framebuf_scroll: add tests for FrameBuffer scrolling - unix/mod_os: add test for os module - extmod/ure_namedclass: add tests for named classes in class sets - float: skip new complex tests if complex unavailable - extmod: get DecompIO test running on low-memory targets - extmod: skip vfs tests if target doesn't have enough memory - micropython: split viper_misc test into two files - float: add domain checks for log and also -inf - float: make output of math function tests more readable - run-multitests.py: add ability to test instance over reboot - multi_bluetooth: add bluetooth multi-test for deepsleep - run-multitests.py: support outputting test metrics - multi_bluetooth: use multitest.output_metric in BLE perf tests - extmod/vfs_fat_ilistdir_del.py: use 512-byte erase block size - multi_bluetooth: use time.sleep_ms instead of time.sleep - multi_bluetooth/ble_mtu: split peripheral/central-initiated - multi_bluetooth/ble_subscribe: use end_handle in desc discovery - multi_bluetooth: add test for descriptors - multi_bluetooth/ble_characteristic.py: add write-no-response - multi_bluetooth: use multitest.broadcast instead of sleep tools: - metrics.py: add mimxrt and renesas-ra to list of available ports - ci.sh: drop ppa requirement for code formatting CI - pyboard.py: add verbose option to filesystem_command - mpremote: don't be verbose when using cat command - autobuild: add nrf port to autobuild scripts - ci.sh: initialise submodules for more ports - ci.sh: force mpy-cross build for samd and teensy - update path to unix micropython executable - mpremote: allow + terminator for fs commands - pyboard.py: add "touch" filesystem command - mpremote: add "edit" command - ci.sh: split the stm32 builds for wiznet5k and cc3k - mpremote: print a nicer error when a filesystem command fails - pyboard.py: remove implicit fs_put if source starts with ./ - pyboard.py: add fs_cp function for direct device-to-device copy - mpremote: print nicer errors for unsupported 'cp -r' arguments - manifestfile.py: add library for working with manifests - makemanifest.py: update to use mpy_cross module - manifestfile.py: allow include of directory path - manifestfile.py: allow require() to specify unix packages - manifestfile.py: allow manifests to set metadata - autobuild: use distinct directory for building stm32 variants - makemanifest.py: force the repo version of the mpy_cross package - pyboard.py: support Windows pathname separators - manifestfile.py: add `author` kwarg to metadata() - manifestfile.py: replace recursive glob with os.walk - mpremote: simplify dispatch of commands - mpremote: use argparse for command line parsing - mpremote: add `mpremote mip install` to install packages - pyboard.py: handle unsupported fs command - add note about uncrustify versions - add pre-commit support - mpremote: fix argument handling for follow and add help strings - mpremote: bump version to 0.4.0 - verifygitlog.py: ignore comment lines in commit messages - verifygitlog.py: add additional help for subject line issues - mpremote: handle FileNotFound exceptions in listdir - mpremote: make RemoteFile objects iterable - makemanifest.py: fix printing of mpy_cross.CrossCompileError - gen-cpydiff.py: use os.path.join and os.path.isdir - gendoc.py: remove unused script - ci.sh: add ARDUINO_NANO_RP2040_CONNECT to rp2 CI build - ci.sh: remove one build from zephyr CI to speed it up - ci.sh: don't print python2 version - mpremote: allow EDITOR environment variable to work on Windows - mpremote: only auto connect to serial device with USB VID/PID - autobuild: create .uf2 file for seeed_xiao_nrf52 - pyboard.py: fix Python 2 compatibility - pyboard.py: add parse kwarg to eval - pyboard.py: add fs_{listdir,readfile,writefile,stat} - pyboard.py: set DTR on Windows to avoid ESPxx hard reset - mpy-tool.py: initialize line_info_top - ci.sh: install pkg-config for macos builds - ci.sh: add unix, stm32 and rp2 ports to code size check - mpremote: use hatch to build mpremote package - pyboard.py: use '/' exclusively when dealing with paths - pyboard.py: fix joining of path in filesystem_command - pyboard.py: fix ESPxx boards hanging in bootloader after reset - manifestfile.py: add support for publishing packages to PyPI - mpremote: add ctrl-x as additonal mpremote disconnect shortcut CI: - ISSUE_TEMPLATE: make minor improvements to placeholder text - ISSUE_TEMPLATE: replace forum with Discussions - workflows: print test failures for webassembly workflow - workflows: bump actions/checkout to v3 - add dependabot to update GitHub Actions - workflows: bump codecov/codecov-action from 1 to 3 - workflows: bump actions/setup-python from 1 or 2 to 4 - workflows: run unix port workflow if mpy-cross changes - workflows: use ubuntu-20.04 when python2 is required - workflows: run mpy-format CI when tests and examples change - workflows: comment on code size change instead of failing CI - workflows: fix code size comment workflow for non-PR - workflows: cancel when branch is updated - workflows: update existing comments for code_size_comment - workflows/code_size: print code size change - workflows: add "shared/**" to list of paths that trigger CI - workflows: add workflow to build mpremote wheel - workflows: bump actions/setup-python from 1 to 4 - workflows: bump actions/checkout from 2 to 3 - workflows: bump actions/upload-artifact from 2 to 3 The ports ========= all ports: - adapt mimxrt, nrf and rp2 ports to work with latest TinyUSB - fix a few typos in comments - remove unused mp_type_{fileio/textio} macros in mpconfigport.h - always include debug information in the ELF - always append to GIT_SUBMODULES - use micropython-lib version of drivers in manifests - make generated pin.c handling more consistent across ports - make all network-capable boards use bundle-networking - make BOARD default from BOARD_DIR in Makefile's - rename remaining "Micro Python" to "MicroPython" - fix MCU tags in Arduino board.json files - implement simple write polling for stdout bare-arm port: no changes specific to this component/port cc3200 port: - mpconfigport: remove mp_const_user_interrupt - use MP_REGISTER_ROOT_POINTER() - fix various array-based compiler warnings - mods/pybuart: implement uart.flush() and uart.txdone() - remove unused NIC type customisation embed port: - add new "embed" port which builds a simple C package - fix arguments to mp_raw_code_load_mem esp8266 port: - modnetwork: rename WLAN keyword args to ssid/security/key - mpconfigport: switch to ROM feature level configuration - mpconfigport: disable MICROPY_PY_UTIMEQ - rename WLAN dhcp_hostname config to hostname - boards: enable reverse-special-methods on GENERIC board - use MP_REGISTER_ROOT_POINTER() - modnetwork: add support for WLAN.config(protocol=XX) option - README: update build instructions to match ci.sh - machine_uart: implement uart.flush() and uart.txdone() - modmachine: move dht_readinto() to the machine module - machine_pwm: enable real open drain output on pin driven by PWM - machine_pin: disable open drain when pin becomes input/output - modnetwork: add ability to set tx power for WLAN interface - README: remove notice about port being "experimental" - use extmod/modnetwork.c instead of port-specific version esp32 port: - network_wlan: rename WLAN keyword args to ssid/security/key - machine_uart: implement the functionality of timeout_char arg - boards: increase 512 bytes limit on ULP programs to 2040 - modesp32: add wake_on_ulp() so ULP can wake CPU from deepsleep - network_wlan: don't raise exception when scan returns no results - rename WLAN dhcp_hostname config to hostname - modmachine: fix machine.freq to allow maximum 160MHz on ESP32-C3 - use MP_REGISTER_ROOT_POINTER() - mpconfigport: enable BLE synchronous events and pairing/bonding - Makefile: force micropython-lib as a required submodule - network_wlan: use esp_wifi_set/get_channel to config wifi channel - network_wlan: add support to set/get the wifi protocol - modnetwork: add network.MODE_LR constant - machine_uart: change sendbreak time to be at least 15 bit times - machine_timer: support all init arguments in Timer constructor - boards: merge manifest_release modules into standard manifest - machine_sdcard: free SPI bus when deiniting SD card - machine_uart: implement uart.flush() and uart.txdone() - mphalport: fix calculation of large sleep by using 64-bit arith - Makefile: add link to build troubleshooting on failure - modsocket: use mp_obj_is_integer to test port type - machine_pwm: don't use LEDC_USE_REF_TICK on ESP32-C3 variants - machine_i2s: add I2S finaliser which calls deinit() - machine_hw_spi: use auto DMA channel on S2, S3, C3 chips - rename machine I2C and SPI types consistently across ports - machine_i2c: fix clocks and timeouts for ESP32-C3, ESP32-S3 - machine_pin: fix size of machine_pin_irq_handler array - machine_pwm: verify PWM is active when config methods are called - add 32MiB partition table templates - usb: add a timeout to usb_tx_strn() - modmachine: move dht_readinto() to the machine module - boards/GENERIC_S3_SPIRAM: enable BLE support - boards/GENERIC_S3_SPIRAM: enable BLE - machine_timer: fix ESP32C3 timer period doubling - machine_touchpad: fix TouchPad for ESP32S2, ESP32S3 - main: don't call usocket_events_deinit if unavailable - usb: cleanup connection detection - boards/GENERIC_S3_SPIRAM_OCT: add ESP32S3 board with Octal SPIRAM - network_lan: add support for LAN8710 PHY - network_lan: support configuration of ETH ref_clk pin - network_lan: add support for SPI-based ethernet chips - network_lan: fix setting MAC address of ethernet devices - network_lan: fix compilation on IDF lower than v4.4 - machine_sdcard: change dma_channel to SPI_DMA_CH_AUTO for ESP32S3 - boards: add board definition for Olimex ESP32 PoE boards - boards/GENERIC_UNICORE: add board definition for unicore chips - network_lan: add support for Ethernet PHY KSZ8081 - add a small delay before leaving wlan.active() - boards/OLIMEX_ESP32_POE: remove id from and update board.json - Makefile: allow specifying BOARD_DIR on make command line - use extmod/modnetwork.c instead of port-specific version - machine_pin: use const for size of machine_pin_irq_handler array - esp32_rmt: fix looping behaviour for RMT on ESP32-S3 mimxrt port: - Makefile: refactor Makefile and divide it into sections - Makefile: modify handling of SDRAM option - Makefile: modify handling of SDCARD option - Makefile: rework board flash type handling - Makefile: rework floating point config - Makefile: fix some minor formatting inconsistencies - boards: remove conditional assignment of flash type/size - use MP_REGISTER_ROOT_POINTER() - machine_uart: implement uart.flush() and uart.txdone() - machine_uart: drop a few commented lines about TX ring buffer - format the firmware image to match the new teensy loader - machine_spi: allow a setting of -1 for cs in the constructor - machine_uart: set the UART ioctl write poll flag properly - machine_uart: fix a bug in UART.write() - Makefile: split up SRC_C variables - machine_pin: add the Pin.toggle() method - fix CPU freeze when calling __WFE() in MICROPY_EVENT_POLL_HOOK - machine_timer: use soft-timer implementation for machine.Timer - machine_timer: use extmod version of machine.Timer - mphalport: add a timeout to mp_hal_stdout_tx_strn() - modmachine: move dht_readinto() to the machine module - add support for MIMXRT1176 MCUs, and MIMXRT1170_EVK board - README: add build and flashing instructions - usb: change macro name MICROPY_HW_USB_STR_MANUF - network: rename the argument clock_mode to ref_clk_mode - Makefile: set MPY_CROSS_FLAGS - mpconfigport: remove config options that are set by default - machine_rtc: set the microsecond value to 0 - sdcard: fix an error when writing large blocks - sdcard: remove obsolete code already excluded by preprocessor - set MICROPY_GC_STACK_ENTRY_TYPE to uint32_t for large RAM - Makefile: move the FROZEN_MANIFEST setting after board config - enable ROM text compression - pendsv: add MICROPY_BOARD_PENDSV_ENTRIES for board customisation - pendsv: clean up PendSV code - Makefile: fix internal flash configuration and build - boards/MIMXRT1064_EVK: fix board config to use internal flash - mpconfigport: allow configuring different network interfaces - modmachine: implement machine.bootloader() - fix the build for boards without ROM API minimal port: - Makefile: avoid terminal reset, use BUILD variable - Makefile: set linker to $(CC) - increase heap size for Linux builds nrf port: - main: add startup and early-init board hook macros - modmachine: add machine.bootloader() and make it customisable - enable optional support for Arduino 1200bps touch - Makefile: drop unused MPY_CROSS and MPY_TOOL variables - boards/arduino_nano_33_ble: add Arduino Nano 33 BLE sense board - modmachine: add machine.idle() function - mpconfigport: remove obsolete module declarations - drivers/bluetooth: handle PHY_UPDATE messages, used in Bluetooth 5 - drivers/usb: probe for interrupt char in USB CDC task - drivers/usb: add a tud_cdc_rx_cb() callback to check interrupt char - mpconfigport: call tud_task() in MICROPY_EVENT_POLL_HOOK - drivers/usb: fix reading of a single USB CDC character - use MP_REGISTER_ROOT_POINTER() - boards/arduino_nano_33_ble_sense: update deploy instructions - main: call usb_cdc_init() before executing boot.py and main.py - modules/ubluepy: use mp_obj_str_get_data to extract str data - don't enable debug info by default if LTO is on - modules/machine/uart: implement uart.flush() and uart.txdone() - Makefile: split up SRC_C variables - rename machine I2C, PWM, SPI, UART types consistently across ports - rename MICROPY_PY_MACHINE_TIMER to MICROPY_PY_MACHINE_TIMER_NRF - boards/seeed_xiao_nrf52: add defn for Seeed XIAO NRF52840 Sense - mpconfigport: enable seeding of the PRNG by the hardware RNG - Makefile: add support for BOSSAC flasher - boards/arduino_nano_33_ble_sense: add support for REV-2 chipset - modules/machine/pwm: add paramter checks and error messages - modules/machine/pwm: use extmod/machine_pwm.c for PWM module - modules/machine/soft_pwm: add PWM for nrf51x boards using soft PWM - modules/machine/pwm: support using all 4 channels of a PWM module - modules/machine/uart: add timeout keyword options and "any" method - nrfx_config: use the UARTE definitions and drivers for the NRF52xx - modules/machine: use a dedicated function for machine.idle() - modules/machine: support the freq=n argument for machine.I2C - modules/machine/pwm: fix resource conflict, and change id to device - nrfx_config: use UARTE for nrf52xxx devices - modules/machine/uart: prevent UART lock-up after a receive error pic16bit port: - pic16bit_mphal: use MP_REGISTER_ROOT_POINTER() powerpc port: no changes specific to this component/port qemu-arm port: no changes specific to this component/port renesas-ra port: - modmachine: allow boards to provide custom bootloader code - machine_i2c: remove unnecessary start/stop dummy functions - mpconfigport: drop pyb_hid_report_desc root pointer - use MP_REGISTER_ROOT_POINTER() - softtimer: switch to use softtimer code from shared/runtime - machine_pin: support drive keyword and fix GPIO setting - rename machine SPI type consistently across ports - machine_timer: use extmod version of machine.Timer - boards: update linker script to detect code flash overflow - disable debugging option for RA4 to reduce code size - change file system size to 64KB for RA6M1 - add the UART methods uart.txdone() and uart.flush() rp2 port: - modmachine: allow boards to provide custom bootloader code - boards/ARDUINO_NANO_RP2040_CONNECT: enable Arduino 1200bps touch - modmachine: implement lightsleep() with optional sleep period - mpthreadport: ensure core1 doesn't hold gc lock in deinit - mbedtls: enable some more mbedtls options - lwip_inc: enable lwIP status callback - rp2_flash: add asserts for size of flash filesystem partition - mpnetworkport: convert network task scheduling to use PendSV IRQ - integrate CYW43xx WiFi driver - boards/PICO_W: add new Pico W board, an RP2040 with WiFi - boards/GARATRONIC_PYBSTICK26_RP2040: change pico-sdk board name - main: set default AP auth mode to WPA2_AES_PSK - mpconfigport: factor core event handling to EVENT_POLL_HOOK_FAST - Makefile: regenerate cmake if generated Makefile missing - CMakeLists: give error if required submodules are missing - CMakeLists: don't override cyw43-driver unless necessary - boards/ARDUINO_NANO_RP2040_CONNECT: add urequests module - run USB stack task exclusively from core 0 - make atomic sections suspend the other core (if active) - mpconfigport: make networking options consistent across boards - mphalport: fix missing storage_read_blocks symbol in debug build - CMakeLists: use armv6m mpy-cross arch for rp2 - use MP_REGISTER_ROOT_POINTER() - mpbthciport: remove mp_bthci_uart from set of root pointers - cyw43_configport: set CYW43_EVENT_POLL_HOOK value - cyw43_configport: set CYW43_WIFI_NVRAM_INCLUDE_FILE value - rp2_pio: fix StateMachine.restart when PIO program is shared - cyw43_configport: add event hook into cyw43_delay_ms - Makefile: always use cmake to discover submodules - mbedtls: enable certificate validity time validation - machine_spi: add mp_hal_get_spi_obj helper function - boards/W5500_EVB_PICO: add new board definition for W5500_EVB_PICO - mark gc_heap NOLOAD for faster boot - correctly determine path to arm-none-eabi-size - machine_wdt: check for the maximum timeout value of watchdog - machine_uart: implement uart.flush() and uart.txdone() - mbedtls: fix missing time.h include - rp2_flash: add start/len support to rp2.Flash() constructor - boards: set PICO_BOARD correctly for each board - machine_spi: use pico-sdk's default pins for SPI - machine_i2c: use pico-sdk's default pins for I2C - boards: remove all I2C,SPI pin defs that already match pico-sdk - Makefile: add link to build troubleshooting on failure - Makefile: add support for BOARD_VARIANTS - boards/WEACTSTUDIO: add WEACTSTUDIO with multiple variants - fatfs_port: fix the modification date of files - rename machine I2C type consistently across ports - mphalport: add a timeout to mp_hal_stdout_tx_strn() - cyw43_configport: make sure only core0 executes a __WFI() - modmachine: move dht_readinto() to the machine module - allow enabling USB device without enabling USB-CDC - boards/ARDUINO_NANO_RP2040: add more modules and enable MD5 hash - fix lightsleep to work with interrupts and cyw43 driver - machine_pwm: use more accurate formulas for freq and duty_u16 - machine_pwm: fix overflows with freq > 268 MHz - mphalport: change order of pin operations to prevent glitches - rp2_flash: call MICROPY_EVENT_POLL_HOOK_FAST after reading flash - machine_pin: refactor the machine.Pin class for external GPIO - machine_pin: add support for named pins and alternate functions - boards: add pin CSV files to board definitions - fix crash in a pin.irq handler - main: use mp_printf in nlr_jump_fail - machine_pin: fix configuring OPEN_DRAIN with initial value - boards/NULLBITS_BIT_C_PRO: add Bit-C PRO board - rp2_pio: track use of PIO resources and free them on soft reset - boards/ARDUINO_NANO_RP2040_CONNECT: use default aioble - mpconfigport: enable os.dupterm and hashlib.sha1 on all boards - cyw43_configport: specify the chipset firmware include file - Makefile: allow specifying BOARD_DIR on make command line - pendsv: add MICROPY_BOARD_PENDSV_ENTRIES for board customisation - boards/ARDUINO_NANO_RP2040_CONNECT: include "time" in manifest - boards/ARDUINO_NANO_RP2040_CONNECT: add more external pins - boards/ARDUINO_NANO_RP2040_CONNECT: include "senml" in manifest - modrp2: support reading the BOOTSEL button on the Pico board - modrp2: disable other core, shorten delay to 8us in bootsel_button - allocate GC heap from unused RAM - allow disabling USB via MICROPY_HW_ENABLE_USBDEV config - main: keep UART REPL with DEBUG=1 and MICROPY_HW_ENABLE_UART_REPL=1 - machine_uart: fix setting of UART LCR parameters - machine_i2c: add timeout parameter for machine.I2C() - memmap_mp.ld: allow a board to reserve memory for the C heap samd port: - mpconfigport: enable MICROPY_ENABLE_FINALISER when VFS is used - remove the existing provisional support for REPL on UART - boards: replace pins.c and pins.h by pins.csv - boards: move mcu-specific settings into a mpconfig_samdXX.h file - Makefile: alphabetically sort the source code files in Makefile - boards: add ADAFRUIT_FEATHER_M4_EXPRESS and _ITSYBITSY_M0_EXPRESS - clock_config: set up the clock configuration - modmachine: allow changing the CPU freq with machine.freq(f) - mphalport: add pin open-drain funcs, and improve delay and ticks - samd_isr: extend systick_ms to 64 bit - machine_pin: add OPEN_DRAIN mode for pins - machine_pin: allow specifying a pin or LED by its name as a string - modmachine: enable SoftSPI and SoftI2C - boards: create pin_af_table.c from pin_af_table_SAMDxx.csv files - pin_af: add the pin af table and its helper functions - machine_adc: add the machine.ADC class - machine_pwm: add the machine.PWM class - samd_isr: rework the interrupt tables - machine_pin: add pin.irq() to the machine.Pin class - modmachine: add disable_irq(), enable_irq() and idle() to machine - machine_uart: add the machine.UART class - machine_spi: add the machine.SPI class - machine_i2c: add the machine.I2C class - moduos: add uos.dupterm() - moduos: add uos.urandom() for SAMD51 - main: use the common execution mode of boot.py and main.py - mpconfigport: enable a few more MicroPython features - samd_isr: change the way a Sercom ISR is registered and called - machine_timer: add machine.Timer based on the shared soft-timer - machine_wdt: add the machine.WDT class - modsamd: add pininfo() function to the samd module - machine_led: optimise size of the machine.LED class - machine_dac: add the machine.DAC class - modmachine: add machine.time_pulse_us - mcu: factor out MCU policy for SAMD21 and SAMD51 - mphalport: add a mp_hal_ticks_ms_64() function - modutime: enable time.time() based on systick_ms() - machine_uart: support buffered TX for UART - boards: add missing/lost board config and pin definitions - mphalport: use CYCCNT for SAMD51's mp_hal_ticks_cpu() - machine_bitstream: add the machine.bitstream() function - mpconfigport: restructure to use ROM feature levels - clock_config: split clock_config.c to separate SAMD21/SAMD51 files - clock_config: add HW_DFLL_USB_SYNC and HW_MCU_OSC32KULP extensions - pin_af: simplify the pin-af-table handling - samd_flash: remove obsolete printf's and return values instead - Makefile: fix a dependency problem with "make -j" - mphalport: fix USB endpoint handling ignoring Ctrl-C - change the symbol names for the peripheral clocks - mcu: add floating point suport for SAMD21 devices - mcu: enable the math module on SAMD51 - boards: move the flash filesystem definitions to the linker files - boards: use the same linker file for all SAMD51x19 variants - main: initialize readline on start up - mcu: use lf2s for SAMD51 and lfs1 for SAMD21 - machine_pin: change the printing of Pin and LED objects - Makefile: split up SRC_C variables - rename machine I2C type consistently across ports - clock_config: extend the range of machine.freq() - clock_config: support changing machine.freq() for SAMD21 - modmachine: add machine.reset_cause() - boards/SPARKFUN_SAMD51_THING_PLUS: add board files for Thing Plus - modmachine: add machine.dht_readinto and enable on SAMD51 - mcu/samd51: enable onewire support for SAMD51 - mcu/samd51: enable FAT support for SAMD51 - modmachine: implement machine.lightsleep() - modmachine: get the bootloader magic address from the lib - clock_config: document the #defines use in init_clocks() - machine_uart: implement uart.txdone() and uart.flush() - mcu: make some settings in mpconfigmcu.h conditional - machine_rtc: add the machine.RTC class - clock_config: extend the SAMD51 us-counter to 60 bit - boards/SEEED_WIO_TERMINAL: declare more pins for SEEED WIO board - machine_pin: change the pin handling and naming/numbering - make ADC, DAC, PWM, SPI objects consistent in how they print out - modmachine: replace the LED class by the Signal class - boards: rework the pins.csv files - machine_pwm: serialize fast update of PWM settings - machine_uart: use a finaliser to tidy up UART on soft reset - machine_spi: implement spi.deinit() and simplify sercom_deinit_all - machine_spi: register SerCom objects as root pointers - modmachine: add machine.softreset() - machine_timer: use extmod version of machine.Timer - mcu/samd51: use an additional manifest.py for SAMD51 boards - README: update README to reflect recent changes to the port - boards/SEEED_WIO_TERMINAL: enable using the 32kHz crystal - mphalport: add a timeout to mp_hal_stdout_tx_strn() - move MCU-specific CFLAGS to mpconfigmcu.mk - Makefile: set MPY_CROSS_FLAGS - mpconfigport: support MICROPY_HW_SOFTSPI_MIN_DELAY - mpconfigport: use __WFE() in MICROPY_EVENT_POLL_HOOK - avoid under-/overflow in I2C and SPI baudrate calculations - machine_uart: fix IRQ flag setting and clearing - machine_uart: simplify machine_uart_any() and machine_uart_read() - machine_uart: check the UART TX pin assignment - machine_uart: fix uart.deinit() and save some RAM - add a vref=num option to the ADC and DAC constructor - support entering bootloader via USB CDC 1200bps touch - boards/SEEED_XIAO: rename to SEEED_XIAO_SAMD21 - add Pin.board and Pin.cpu classes to Pin - boards: clean up comments and some pins in pins.csv files - mcu: rework the comments in clock_config.c - mcu: use the FDPLL96M clock for the SAMD21 CPU - mcu: implement a hardware seed for the SAMD21 random module - mcu: set the SAMD21 us-counter to 2 MHz for better resolution - moduos: add uos.urandom() using the phase-jitter rng - pendsv: add MICROPY_BOARD_PENDSV_ENTRIES for board customisation - always provide the machine.RTC class stm32 port: - modmachine: allow boards to provide custom bootloader code - modmachine: factor out mboot enter code to a function - boards/stm32f091xc.ld: allocate space for a small filesystem - boards/NUCLEO_F091RC: enable LFS1 filesystem - Makefile: set CSUPEROPT to -Os for F0 and G0 MCUs to save space - usbd_cdc_interface: add support for Arduino 1200bps touch - usb: expose USB HID device instance via usbd_hid_get() - use a separate symbol name for the bootloader state pointer - Makefile: enable link-time-optimisation via LTO=1 make option - boards: enable LTO by default on boards with smaller flash size - Makefile: fix setting of define that enables WIZNET5K driver - mboot: remove redundant code in mboot_state_change function - boardctrl: allow boards to override fatal-error handler - sdram: include boardctrl.h for fatal-error handler - use MP_REGISTER_ROOT_POINTER() - Makefile: workaround LTO linker order bug in binutils <2.35 - softtimer: switch to use softtimer code from shared/runtime - boards/LEGO_HUB_NO6: fix typo in README - boards/LEGO_HUB_NO6: use named pins - boards/LEGO_HUB_NO6/appupdate: detect filesystem size at runtime - boards/LEGO_HUB_NO6/spiflash: pick command type at runtime - boards/LEGO_HUB_NO6/cc2564: make timer configurable - boards/LEGO_HUB_NO7: add LEGO Hub No. 7 board definition - boards/NUCLEO_WB55: add error handling to firmware update scripts - don't enable debug info by default if LTO is on - switch Wiznet to use lib/wiznet5k and extmod/network_wiznet5k - add definitions required for lwIP version of Wiznet NIC - mphalport: add mp_hal_get_spi_obj() helper function - sdram: enable MPU for unaligned access on H7 MCUs - boards: increase mboot region to 32k for WB55 boards - move board variant config to mpconfigboard.mk - boardctrl: use HAL_Delay instead of mp_hal_delay_ms - remove support for CC3000 WiFi driver - machine_uart: implement uart.flush() and uart.txdone() - boards/LEGO_HUB_NO6: update manifest to new format - boards: only freeze LCD160CR driver in PYB board firmware - adc: make ADCAll.read_channel reject invalid channels - pyb_i2c: fix pyb.I2C to work with dma=True on F4 MCUs - timer: fix use of timer channel callback() method on L4 MCUs - boards: add alternate function list for STM32F446RE - boards/PYB: fix handling of BOARD_VARIANT selection - make-stmconst.py: support TypeDef's with a single char prefix - add support for STM32L1 MCUs - boards/NUCLEO_L152RE: add NUCLEO-L152RE board support - rename machine I2C and SPI types consistently across ports - boards/ARDUINO_PORTENTA_H7: revert to single-precision float - mbedtls: enable mbedtls certificate time validation - Makefile: allow overriding the default MBEDTLS_CONFIG_FILE - boards/ARDUINO_PORTENTA_H7: add custom mbedtls config - modmachine: move dht_readinto() to the machine module - spi: downgrade SPIHandle definitions to static - boards/ARDUINO_PORTENTA_H7: add more modules, I2C1 and SE pin - usbd_desc: support USB strings on CDC interface descriptors - Makefile: set MPY_CROSS_FLAGS based on MCU type - pyb_i2c: fix failing pyb.I2C(dma=True) after receiving 1 byte - i2c: fix I2C frequency calc so it doesn't exceed requested rate - adc: fix reading internal ADC channels on L4 MCUs - adc: fix ADCAll.read_core_temp() on L4 MCUs - i2c: add hardware I2C implementation for STM32L1 - i2c: add hardware I2C implementation for STM32L4 - mboot: make all mboot sectors erase/write protected - boards: add missing LPUART macros for H7 HAL - boards/NUCLEO_F429ZI: enable I2C1 and I2C2 with default pins - powerctrl: improve standby mode entry code for H7 MCUs - boards/NUCLEO_F756ZG: add board definition for NUCLEO-F756ZG - powerctrl: fix build on STM32G0xx and STM32H7Bx MCUs - boards: consolidate linker snippets to reduce duplication - Makefile: leave DFU mode after download when using dfu-util - boards/NUCLEO_H743ZI2: refer to NUCLEO_H743ZI for frozen manifest - boards/STM32F769DISC: fix building with USE_QSPI_XIP=1 - boards/ARDUINO_PORTENTA_H7: fix macro value check for QSPI - boards/ARDUINO_PORTENTA_H7: use default aioble - Makefile: clean up nested if-else to chained if-else-if - update to use the open-source lib version of cyw43-driver - boards: update linker scripts now that big_const is gone - add a default implementation of pyb.country - cyw43_configport: fix build for boards without an RF switch - boards/PYBD_SF2: set CYW43 Bluetooth fimrware download baudrate - cyw43_configport: allow boards to override default resource files - boards/ARDUINO_PORTENTA_H7: update board config files - Makefile: include HAL HSEM driver on H747 MCUs - boards/ARDUINO_NICLA_VISION: add support for Arduino Nicla Vision - boards/ARDUINO_GIGA: add support for Arduino Giga H7 board - cyw43_configport: add cyw43_sdio_enable_high_speed_4bit function - powerctrl: add sleep RCC semaphore management for WB55 MCUs - powerctrl: disable WB55 BLE before entering deepsleep - powerctrlboot: provide custom SystemInit for WB55 - powerctrl: don't compile WB helpers on WL MCUs - boards: include "senml" in manifest for ARDUINO boards - remove commented-out printf's and debugging code - main: use mp_printf instead of printf for MPY start-up messages - i2c: return error code and raise exception if I2C init fails - spi: return error code and raise exception if SPI init fails - modmachine: make machine.info print using mp_printf - extint: make ExtInt.regs print using mp_printf - pin: make pin_find debug output use mp_printf - pybthread: make pyb_thread_dump take a printer as its argument - boards/NUCLEO_H743ZI2: fix MCU tag in board.json file - mphalport: update HAL version to 1.11.0 to match stm32lib - add support for STM32H723 MCUs - boards: add ld and af.csv for H723 - boards/NUCLEO_H723ZG: add new H723 board - add support for USB on G0 MCUs - mboot: add support for G0 MCUs - boards/NUCLEO_G0B1RE: add config for USB and mboot - boards/ARDUINO_NICLA_VISION: fix incorrect bootloader PID - flash: fix get_bank function for STM32H750 - cyw43_configport: provide cyw43_hal_pin_config_irq_falling func teensy port: - mpconfigport: drop unused root pointers - teensy_hal: use MP_REGISTER_ROOT_POINTER() unix port: - variants: move setting of MICROPY_PY_USELECT to port config file - variants: enable remaining options on dev,coverage from ROM extra - variants/coverage: change config to use ROM level everything - variants/dev: allow all config options to be overridden - moduos: include errno.h - main: restore tty settings on nlr_jump_fail() - alloc: use MP_REGISTER_ROOT_POINTER() for mmap_region_head - mpconfigport: make MICROPY_EVENT_POLL_HOOK call usleep directly - mbedtls: add custom config for mbedtls - mpconfigport: switch ussl from axtls to mbedtls - Makefile: only include axtls in GIT_SUBMODULES list when enabled - Makefile: only checkout libffi submodule when used - mpconfigport: allow overriding MICROPY_EVENT_POLL_HOOK - enable MICROPY_GC_SPLIT_HEAP on coverage build - unix_mphal: allow overriding hal time functions - variants: remove variant suffix from executable filename - modjni: add missing const qualifier - remove .gitignore file - modusocket: support proto and flags arguments to getaddrinfo - include alloca.h for NetBSD - mpconfigport: enable MICROPY_ENABLE_FINALISER when VFS is used - variants: remove freedos and fast variants - refactor mpconfigport.h and mpconfigvariant.h - refactor mpconfigvariant.mk - variants/coverage: add test for manifest freeze_mpy() - enable sys.executable - Makefile: don't use _MOD variable names - modffi: move header includes inside MICROPY_PY_FFI guard - variants: change mip package to mip-cmdline - coverage: add extra GC coverage test for ATB gap byte - moduos: implement 2-arg version of os.getenv() - Makefile: disable building the shared library of libffi - main: free pathbuf when there's an error opening a file webassembly port: - Makefile: remove obsolete disable of array-bounds warning - rename this port from 'javascript' to 'webassembly' - mpconfigport: use MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES - add support for VFS and enable VFS_POSIX - use Date's now() instead of getTime() - change "stack" argument to "heapsize" - support piping in a program on stdin - dispatch micropython-print via document not mp_js_stdout - README: update README to describe new stdout behaviour - Makefile: change compiler optimisation from O3 to Os - library: make use of CustomEvent detail property - library: extract and send data to print as UInt8Array windows port: - provide a definition for MP_ALWAYSINLINE - msvc: support compressed ROM text for error messages - Makefile: update test dependency on $(PROG) - make project file read-only for IDE - .gitignore: simplify by removing build artefacts - msvc: remove variant suffix from executable filename - msvc: make mpy-cross independent of micropython variant - msvc: fix qstr generation dependency - msvc: fix module freezing zephyr port: - update include paths to use the zephyr namespace - upgrade to Zephyr v3.1.0 - use MP_REGISTER_ROOT_POINTER() - machine_uart: use mp_obj_str_get_str to get device name - boards: add config for bbc_microbit_v2 - mpconfigport: enable MICROPY_ENABLE_FINALISER when VFS is used - rename machine I2C and SPI types consistently across ports ======== Fri, 17 Jun 2022 12:57:59 +1000 v1.19.1 Bug fix for esp32 SoftI2C This is a bug fix release. The changes are: - extmod/machine_i2c: only use WRITE1 option if transfer supports it This fixes the machine.SoftI2C.readfrom_mem() method on esp32, so it writes the address to read from. ======== Thu, 16 Jun 2022 15:11:02 +1000 v1.19 New mpy 6 file format with improved bytecode, addition of renesas-ra port In this release of MicroPython the .mpy file format has been significantly reworked and bumped to version 6. The new format now contains data and bytecode organised to be mostly static and ready to run in-place. To achieve this, qstr references from bytecode (and native machine code) now go through a lookup table, to convert from local qstr number in the module to global qstr number in the runtime that the module executes within. This means bytecode (and most native code) does not need rewriting when it is imported. Along with this change, the jump opcodes have been optimised to emit 1-byte jump offsets when possible, which gives a good reduction in bytecode size, saving RAM and reducing the size of .mpy files. The change to the bytecode means that code constants (like long strings, bytes objects and floats) are now shared and de-duplicated across the whole module, rather than each code object having a separate constant table. The parser can also now turn a tuple of constants into a constant object, so the tuple doesn't need to be built at runtime each time it is used. Furthermore, any constant object can now be used in "X = const(obj)" statements. With these bytecode changes, .mpy files see around a 10% reduction in size and frozen .mpy code sees about a 5% size reduction. Heap memory use after import is also down by around 5% (more savings are seen if the code uses lots of constants). Due to the qstr indirection performance of the VM is slightly reduced on some benchmarks by a few percent, but the benefits of smaller code and reduced RAM usage are deemed to outweigh this. See commit f2040bfc7ee033e48acef9f289790f3b4e6b74e5 for more details. In the runtime, support has been added for multiple *args and **args in a function call, following PEP 448. Built-in modules can now have (optional) mutable attributes, and this is used to implement sys.ps1/sys.ps2 which allow the user to customise the REPL prompt. This can be useful, for example, to configure a different REPL for different boards so they can be easily distinguished. The sys module has also had the MicroPython git version and build date appended to sys.version, sys.implementation._machine has been added, and sys.implementation.mpy renamed to sys.implementation._mpy. The sys module can now be used to fully identify the MicroPython version and target it is running on (and the platform module provides additional information when it's available). The MP_REGISTER_MODULE macro is now used to register all built-in C modules and the third argument to this macro has been removed. Any user-C-modules will need to be updated. Also support for MICROPY_PORT_BUILTIN_MODULES is removed because this is no longer needed, and should be replaced by usage of MP_REGISTER_MODULE (see commit 0a92469c10542d57ef0ea6b6cf2ed0cae9491dbe for example). The MP_REGISTER_MODULE macro is now used to register all built-in C modules and the third argument to this macro has been removed. Also support for MICROPY_PORT_BUILTIN_MODULES is removed because this is no longer needed. mpy-cross now supports the -march=armv6m option, which can be used with the rp2 port. The -mno-unicode has been removed. The littlefs2 library has been updated to v2.5.0 which includes some performance improvements and minor fixes. At the REPL, a tab will now insert an indent when it follows whitespace, and auto-indent is automatically disabled if a space or tab follows an auto-indent. This means that Python code can be pasted into the standard REPL without messing up the indentation. mpremote is now at version 0.3.0, with a progress indicator shown when copying large files, and recursive copy fixed on Windows. It also has the following commands added: --help, --version, version, resume, soft-reset, umount. The esp32 port has a new machine.ADCBlock class and updated ADC class. Fixes have been made to ADC2 channel mapping, low PWM frequencies, UART initialisation of unspecified parameters, and RMT channel on S2/S3/C3 variants. The Pin.PULL_HOLD constant has been replaced by a "hold" keyword argument to the Pic constructor, and it's now possible to configure pin drive strength. I2C write-then-read transfers have been optimised to be faster. WLAN.config() now supports setting/getting the txpower. New boards include LOLIN C3 MINI ESP32-C3, LilyGO LoRa32, and UM ESP32-S3 based boards. The mimxrt port has updated the nxp_driver to v2.10 and fixed USB CDC RX handling to not block. Pin drive constants have been renamed to DRIVE_x to match other ports, and the machine.I2S class has been added. New boards include Olimex RT1010 and MIMXRT1015_EVK. The nrf port now includes uasyncio in the default board manifest, and additional features have been enabled on nrf52840 and nrf9160 boards to match the features on stm32, rp2 and esp32. This includes enabling the json, re, zlib and framebuf modules. There is a new renesas-ra port which targets Renesas RA4M1, RA4W1, RA6M1 and RA6M2 MCUs, with board definitions for evaluation kits for these MCUs, along with RA4M1 clicker. This port currently supports Pin, ADC, SoftI2C, I2C, SoftSPI, SPI, UART, Timer and RTC classes in the machine module, along with the VFS and an internal flash filesystem. The rp2 port now has optional USB MSC support, and optional dupterm support. The machine.UART class has init and deinit methods added, and the ucryptolib module is now available. The lwIP network stack has been integrated, along with mbedtls for the ssl module, and these can be used with the new Wiznet driver to provide Ethernet support. The Wiznet W5100S-EVB-Pico board has been added which makes use of this driver. The day-of-week value reported by time.localtime() has been fixed, memory corruption when a thread is created on core1 has been fixed, and the UART now uses a mutex when reading/writing to prevent character duplication in code that uses both cores. The stm32 port has added support for G0, G4 and WL MCUs. The new boards for these MCUs are NUCLEO_G0B1RE, NUCLEO_G474RE and NUCLEO_WL55. The ARDUINO_PORTENTA_H7 board has also been added, with full WiFi and BLE support. The rfcore on WB55 MCUs has been improved by removing an extra layer of buffering, and the restriction on the use of address resolution has been removed, meaning that the rfcore WS firmware should be updated to v1.12.0 or later; see commit 26b1d31eda292d9cd5cfc68f14ce8055256fade8. The board-level configuration of mboot has been significantly improved to allow more control over system clocks, more hooks into the start up process, and a hook for state change. And the CRC32 of DFU files is now verified before writing them. The pyb.CAN class has been improved to support FD frames and buses with mixed classic/extended-ID nodes, allowing extended IDs to be specified on a per-message basis. CAN.recv also now returns a value indicating if the received message had an extended ID or not. And CAN.initfilterbanks has been removed, replaced with the num_filter_banks keyword argument to CAN.init. These are all breaking changes to the pyb.CAN class API and code will need to be updated accordingly; see commit 5cdf9645711cc12b45e602ef5795c33895116fc4 for details. The unix port now shows compiler information in the REPL banner to make it consistent with how bare-metal ports work, and the "-X realtime" command-line option has been added for macOS to get improved timing. All variants have switched to use the VFS subsystem, and use the VfsPosix class for mounting the host's filesystem. The os module has been consolidated with all other ports and the minimal and standard variants gain the unlink, chdir, getcwd and listdir functions. The windows port has also switched to the VFS subsystem and VfsPosix. It adds support for micropython.schedule and uasyncio on the dev variant. And BCryptGenRandom has been used to implement os.urandom. The zephyr port upgraded Zephyr to v3.0.0. The change in code size since the previous release for various ports is (absolute and percentage change in the text section): bare-arm: +792 +1.394% minimal x86: +2091 +1.286% unix x64: +10231 +1.995% unix nanbox: +9777 +2.162% stm32: +184 +0.047% PYBV10 cc3200: +904 +0.493% esp8266: -1240 -0.177% GENERIC esp32: +6464 +0.425% GENERIC nrf: +11288 +6.472% pca10040 rp2: +14432 +2.929% PICO samd: +1352 +0.970% ADAFRUIT_ITSYBITSY_M4_EXPRESS The changes that dominate these numbers are: - bare-arm, minimal, cc3200, samd: reworked bytecode and mpy format, optimisation of jump opcodes to use 1-byte offsets, de-duplication of constants at the module level, and PEP 448 support - unix: switching to use VFS, and new mpy format and related changes - esp8266: removal of esp.info and machine.WDT.deinit - esp32: addition of machine.ADCBlock, and new mpy format changes - nrf: enabling uasyncio, enabling MICROPY_PY_IO - rp2: enabling ucryptolib with mbedtls Note that the stm32 port's size remained roughly unchanged. This is because it has a decent amount of frozen Python code and the reduction in frozen code size due to the reworked bytecode has offset the increase in runtime/VM size due to this change. Ports like bare-arm, minimal, cc3200 and samd do not have any frozen code so only see the increase in runtime/VM size. Production-level projects that have a significant amount of frozen code have seen around a 4% overall reduction in their firmware size. Thanks to everyone who contributed to this release: Algy Tynan, Andrew Leech, Andrew Scheller, Artyom Skrobov, Asensio Lorenzo Sempere, Bradley Wogsland, Cem Eliguzel, Chris Wilson, Christian Decker, Christian Zietz, Christophe Priouzeau, Clayton Mills, Damien George, Daniel Jour, Daniël van de Giessen, Dave Hylands, David Lechner, Emil Kondayan, Herwin Grobben, iabdalkader, IhorNehrutsa, Jan, Jared Hancock, jason, Jeff Epler, Jeremy Herbert, Jim Mussared, Jon Bjarni Bjarnason, Jonathan Hogg, Jos Verlinde, Kattni Rembor, Lars Kellogg-Stedman, Luiz Brandao, marcidy, Martin Fischer, Maureen Helm, Meriç SARIIŞIK, Michael Himing, Michael O'Cleirigh, MikeTeachman, Peter D. Gray, Peter Hinch, Peter Züger, Phil Howard, Philipp Ebensberger, Rob Knegjens, robert-hh, Sean Coates, Seon Rozenblum, Stephane Smith, stijn, Takeo Takahashi, ubi de feo, Waterlens, wemos, YoungJoon Chun, Yukai Li. What follows is a detailed list of changes, generated from the git commit history, and organised into sections. Main components =============== all: - fix MICROPY_OBJ_REPR_D compilation with msvc - update Python formatting to latest Black version 22.1.0 - use mp_obj_malloc everywhere it's applicable - reformat remaining C code that doesn't have a space after a comma - remove third argument to MP_REGISTER_MODULE - rename MICROPY_PY_WIZNET5K to MICROPY_PY_NETWORK_WIZNET5K py core: - objstr: support '{:08}'.format("Jan") like Python 3.10 - modmath: add math.tau, math.nan and math.inf constants - qstr: separate hash and len from string data - qstr: use `const` consistently to avoid a cast - gc: update debug code to compile with changes to qstr pool types - rework bytecode and .mpy file format to be mostly static data - bc.h: fix C++ compilation of public API - objmodule: support delegating failed attr lookups - modsys: add optional attribute delegation - modsys: add optional sys.tracebacklimit attribute - modsys: add optional mutable attributes sys.ps1/ps2 and use them - parse: simplify handling of const int parse nodes - parse: put const bytes objects in parse tree as const object - parse: handle check for target small-int size in parser - showbc: remove global variables and make DECODE_PTR work correctly - smallint: introduce MP_SMALL_INT_BITS macro - objgenerator: fix unused variables when native gen extracts prelude - change jump opcodes to emit 1-byte jump offset when possible - emitbc: add check for bytecode jump offset overflow - change jump-if-x-or-pop opcodes to have unsigned offset argument - builtinimport: alias sys to usys if import weak links aren't enabled - bc.h: fix C++20 compilation with "volatile" - compile: only show raw code that is bytecode - asmxtensa: fix use of l32i/s32i when offset won't fit in encoding - emitnative: don't store prelude at end of machine code if not needed - vm: prevent array bound warning when using -MP_OBJ_ITER_BUF_NSLOTS - runtime: allow multiple **args in a function call - runtime: allow multiple *args in a function call - runtime: do not overallocate when len is known - runtime: drop new_alloc < 4 check - runtime: use size_t/ssize_t instead of uint/int - emitbc: assert that a small int fits its encoding when emitting one - fix compiling and decoding of *args at large arg positions - runtime: remove unnecessary check for kw_value == MP_OBJ_NULL - makeqstrdefs: cleanup and extend source file classification - emitinlinethumb: use 16 bit encodings for PUSH LR and POP PC - scheduler: add support for scheduling static C-based callbacks - emitnative: revert "don't store prelude at end of machine code if..." - persistentcode: define enum values for obj types instead of letters - parse: factor obj extract code to mp_parse_node_extract_const_object - parse: print const object value in mp_parse_node_print - parse: add MICROPY_COMP_CONST_TUPLE option to build const tuples - persistentcode: support loading and saving tuples in .mpy files - objtype: convert result of user __contains__ method to bool - modsys: append MicroPython git version and build date to sys.version - modsys: rename sys.implementation.mpy to sys.implementation._mpy - modsys: introduce sys.implementation._machine constant - emitcommon: don't implicitly close class vars that are assigned to - obj: introduce mp_obj_malloc macro to allocate, and set object type - objfloat: explain why mp_obj_malloc isn't used - malloc: introduce m_tracked_calloc, m_tracked_free functions - objmodule: move stray #include to top of file - persistentcode: remove obsolete comment about qstr window size - persistentcode: remove unicode feature flag from .mpy file - asmx64: support full range of regs in asm_x64_lea_disp_to_r64 - bc: provide separate code-state setup funcs for bytecode and native - emitnative: put a pointer to the native prelude in child_table array - compile: allow new qstrs to be allocated at all compiler passes - compile: de-duplicate constant objects in module's constant table - parse: allow all constant objects to be used in "X = const(o)" - makemoduledefs.py: allow multiple ways to register a module - make builtin modules use MP_REGISTER_MODULE - remove support for MICROPY_PORT_BUILTIN_MODULES - asmthumb: fix PC relative load by sign extending the constant - emitnative: simplify generation of code that loads prelude pointer - emitnative: provide dedicated local for exception unwind handler ptr - asmthumb: fix offset variable name in ldr, ldrh and strh functions - asmthumb: add asm_thumb_ldrh_reg_reg_i12_optimised() helper func - asmarm: add asm_arm_ldrh_reg_reg_offset() helper func - asm: add ASM_LOAD16_REG_REG_OFFSET macro for load-u16 with offset - emitnative: access qstr values using indirection table qstr_table - asmthumb: make ARMv7-M instruction use dynamically selectable - persistentcode: select ARMV6M as maximum when __thumb2__ not defined - dynruntime.mk: add basic support for armv6m architecture - asmthumb: provide implementations of clz/ctz for msvc - builtin: clean up and simplify import_stat and builtin_open config - emitinlinethumb: make ARMv7-M instruction use dynamically selectable - emitinlinethumb: make float instruction use dynamically selectable - change makemoduledefs process so it uses output of qstr extraction - persistentcode: remove remaining native qstr linking support - bc: remove unused mp_opcode_format function - compile: give the compiler a hint about num nodes being non-zero - makemoduledefs.py: remove shebang line and adjust style of comment - parse: work around xtensa esp-2020r3 compiler bug - dynruntime: add macros to create a new dict and store to dicts - dynruntime: add macros to access more types and mp_const_empty_bytes - makemoduledefs.py: emit useful error for legacy MP_REGISTER_MODULE extmod: - network_ninaw10: implement MP_STREAM_POLL in ioctl - modusocket: make setsockopt return if NIC is not connected - modusocket: add makefile() method and common socket options - modusocket: create new sockets in blocking mode - modusocket: support additional args to getaddrinfo - machine_i2c: increase default SoftI2C timeout to 50ms - modubinascii: add newline keyword to b2a_base64 function - moduplatform: move platform PP definitions into a header - moduzlib: fix parsing zlib header dict size - moduos: create general uos module to be used by all ports - modure: set subject begin_line so ^ doesn't match interior - uasyncio: allow task state to be a callable - uasyncio: fix gather cancelling and handling of exceptions - extmod.cmake: add micropy_lib_mbedtls component - modusocket: implement optional socket.listen backlog argument - modusocket: provide config macro for socket.listen backlog deflt - uasyncio: make Python Task match C version with use of asserts - uasyncio: fix bug with task ending just after gather is cancel'd - uasyncio: rename and merge TaskQueue push/pop methods - move font_petme128_8x8.h from ports/stm32 to extmod - make extmod modules use MP_REGISTER_MODULE - make port-included extmod modules use MP_REGISTER_MODULES - revert accidental usocket->socket rename - webrepl: fix setting password in foreground mode and factor code - modusocket: fix polling of a new socket - modusocket: bind unconnected socket to default NIC in setsockopt - modusocket: fix errcode returned from socket read/write - modusocket: add socket type print function - modusocket: add support for socket events callback - modusocket: fix socket_make_new argument parsing - modusocket: add timeout and callback to socket object - modusocket: add sendall function - network_ninaw10: add support for socket events callback - machine_i2c: add optional support for write-then-read transfers - uasyncio: fix edge case for cancellation of wait_for - nimble: add support for reading whole HCI UART packets - network_wiznet5k: add Wiznet Ethernet network interface - modussl_mbedtls: poll EVENT_POLL_HOOK in ssl handshake loop - modurandom: fix missing void in empty argument list - extmod.cmake: require components to be explicitly enabled - modusocket: add socket state to track new/listening/conn/closed - modusocket: fix polling of closed sockets - extmod.cmake: fix hard-coded mbedtls config file path shared: - readline: make tab insert an indent when it follows whitespace - readline: disable auto-indent if space/tab follows added indent drivers: - ninaw10: add function to check socket state/data availability - ninaw10: fix timeout handling to match modusocket - ninaw10: return standard error numbers - ninaw10: add NIC-level ioctl function - sdcard: allow setting the final SPI baudrate - codec: add driver for the WM8960 codec - ninaw10: fix isconnected to return False when inactive - dht/dht.py: change default import module as machine - ninaw10: update driver to support firmware 1.5.0 - bus: rename MP_SPI_ADDR_IS_32B to MICROPY_HW_SPI_ADDR_IS_32BIT - lsm6dsox: add support for SPI mode - sdcard: fix CSD version 1.0 device size calculation - sdcard: make ioctl(4), ioctl(5) return num blocks, block size - sdcard: fix address calculation on v2 SDSC cards mpy-cross: - add armv6m architecture option lib: - re1.5: distinguish between subject start-of-line and start-of-srch - stm32lib: update library for G0 v1.5.1 - fsp: add renesas fsp git repository as submodule - littlefs: update littlefs2 to v2.5.0 - littlefs: guard lfs2_file_rawopen with LFS2_NO_MALLOC - littlefs: remove assignment of variables to themselves - nxp_driver: update nxp_driver to v2.10 - wiznet5k: add submodule for Wiznet Ethernet drivers Support components ================== docs: - library: specify additional ADC methods and new ADCBlock class - esp32: document expanded ADC API in quickref - differences: update differences now that math.tau/inf/nan exist - differences: update python_36 now that b2a_base64 accepts newline - remove reference to obsolete neopixel_write function - develop/porting.rst: fix build and import problems in the example - reference/isr_rules.rst: fix inconsistent variable name in example - esp32/quickref: update ADC documentation - reference/isr_rules.rst: describe uasyncio-IRQ interface - library/collections.rst: use class for deque and OrderedDict - use the correct * keyword-only notation - library/socket.rst: document socket as a class - library/pyb.Timer.rst: add pyb.Timer class constants - library/pyb.rst: add pyb.hid_mouse and pyb.hid_keyboard constants - library/pyb.DAC.rst: add DAC class constants - library/machine.SPI.rst: add class constant SoftSPI.MSB and .LSB - library/machine.WDT.rst: use correct case for WDT.feed - library/esp.rst: document the osdebug function - library/pyb.SPI.rst: document default for prescaler argument - library/machine.Pin.rst: document defaults for Pin.init - library/uasyncio.rst: fix description of ThreadSafeFlag.wait - library/machine.UART.rst: add details for `invert` parameter - differences/python_35: mark PEP 486 as not applicable - library/esp32.rst: mark esp32.Partition as not taking kw args - esp32/quickref: document GPIO drive strength - library/machine.Pin: update to use preferred DRIVE_x constants - esp32/quickref: refine deep-sleep power-saving notes - library/machine.I2S: clarify what rate refers to - library/pyb.CAN: update CAN docs to match revised API - add quickref and docs for mimxrt, including network.LAN docs - reference/mpremote: add details about mount usage over soft reboot - differences: update Python 3.5 diff, with optional listen backlog - reference: update constrained docs now that tuples can be const - library/network.WLAN: add "txpower" to list of known WLAN configs - renesas-ra: add renesas-ra docs files - update files for renesas-ra port - renesas-ra: remove unused image files - reference/mpyfiles: remove docs about mpy flags and qstr win size - mimxrt: add i.MX RT1015 to general.rst, and a few clarifications - mimxrt: move the pinout tables to a separate document - reference/manifest: add link to details about opt-level for freeze - reference/mpyfiles: update .mpy description to match latest format - update Raspberry Pi URLs from .org to .com examples: - embedding: fix build with updated sys and os modules - natmod/features3: add example to test more natmod features tests: - run-multitests.py: ignore lld_pdu_get_tx_flush_nb msgs from IDF - run-multitests.py: set HOST_IP so tests work between PC and board - multi_net: add testing key/cert to SSL server/client test - multi_net: close accepted sockets when tests are done - multi_net/udp_data.py: allow reusing port before bind - multi_net/udp_data.py: make UDP test more reliable - run-perfbench.py: allow a test to SKIP, and to have a .exp file - perf_bench: add perf tests for qstr interning and importing .mpy - perf_bench: add perf test for yield-from execution - run-perfbench.py: use SKIP consistently, and increase print width - extmod/vfs_fat_finaliser.py: make finalisation more robust - run-tests.py: skip repl tests when running windows underneath - perf_bench: skip bm_chaos test if random.randrange is unavailable - unix: add coverage test for freezing various objects - basics: add test for creating small-ints in nan-box builds - run-tests.py: include test files ending in _set as set tests - micropython: switch from set.pop to raise-0 to test exc strings - extmod/vfs_posix.py: only test statvfs if it exists - cmdline/cmd_showbc: fix spelling of sequence - extmod: add test for machine.I2S data rate - extmod: update I2S rate test to work on mimxrt - basics/fun_callstardblstar: add coverage test - basics/fun_callstardblstar: add test for large arg allocation - pyb: update CAN tests to match revised CAN API - inlineasm: add test for PUSH LR and POP PC - perf_bench: update import tests for changes to .mpy consts - micropython: add tests that const tuples don't use the heap - extmod/uasyncio_gather: make double-raise gather test reliable - run-tests.py: add timeout for running PC-based MicroPython test - cmdline: add test for REPL auto-indent - renesas-ra: add tests for renesas-ra port - run-tests.py: update for renesas-ra port - renesas-ra: remove unsupported feature test of Pin - extmod: increase timing on uasyncio tests to make more reliable - fix tests to use sys.implementation._mpy - perf_bench: update .mpy file header to remove old unicode flag - run-perfbench.py: return error code if any test fails on target - thread: use less resources for stress_aes if settrace enabled - run-tests.py: exclude settrace tests when using native emitter - multi_net: skip SSL test if relevant modules aren't available - micropython: fully unlink nested list in extreme exc test - extmod: use bytearray instead of bytes for uctypes test - micropython: add more test cases for native generators - run-tests.py: allow running tests via mpy-cross on remote targets - run-perfbench.py: allow running tests via mpy and native emitter - basics: unlock heap if skipping nanbox small-int test - run-tests.py: handle case where mpy-cross fails to compile script - run-tests.py: enable `-X realtime` option for macOS tests - extmod: change expected errno code from 36 to 30 in VfsLfs2 test - multi_net: fix TCP accept test when using system error numbers - run-multitests.py: use LAN for IP address if WLAN doesn't exist - micropython: make import_mpy_native_gc run on ARMv6-M and above - micropython: make import_mpy_native test run on all architectures - run-tests.py: add rp2 test target - move native while test from pybnative to micropython - net_inet: remove broken api.telegram.org from tests - run-multitests.py: read IP address from boot nic if available - basics: add .exp file for sys.tracebacklimit test - stress: adjust bytecode_limit test so it can SKIP if no memory tools: - mpremote: use machine instead of umachine in commands - ci: test math constants with MICROPY_OBJ_REPR_D - uf2conv.py: update to latest version - autobuild: provide .uf2 images for esp32 builds when available - mpremote: fix "fs cp -r" on Windows - mpremote: make ConsolePosix work without .raw attribute - mpremote: during soft reboot wait long enough for 115200 data - mpremote: accept both --help and help to show usage - mpremote: correctly manage mounted flag during soft-reset - mpremote: fix special handling of ctrl-D when host FS is mounted - verifygitlog.py: ignore line length in body if it's a URL - ci.sh: update IDF v4.4 build to use v4.4 tag - ci.sh: run urandom test scripts as part of native module tests - mpremote: add "resume" and "soft-reset" commands - mpremote: add "umount" command - upip.py: remove unused op_basename() function - mpy-tool.py: fix frozen comment generation to escape chars - ci.sh: run performance benchmark as part of all unix test runs - mpremote: bump version to 0.2.0 - gen-cpydiff: skip Black fmt comments - mpremote: support any prompt string when detecting soft reset - mpremote: allow running mpremote with `python -m` - mpremote: improve reliability of mount after soft reboot - mpremote: show progress indicator when copying large files - mpremote: add option to mount cmd to allow "unsafe" symlinks - mpy-tool.py: support loading tuples from .mpy files - mpy-tool.py: support freezing tuples and other consts - mpy-tool.py: optimise freezing of ints that can fit a small int - mpy-tool.py: optimise freezing of empty str and bytes objects - mpy-tool.py: make global qstr list a dedicated class - mpy-tool.py: optimise freezing of str when str data is a qstr - mpy-tool.py: intern more strings when freezing - codeformat.py: remove ports/unix/*.py from exclusion list - codeformat.py: include more ports .c/.h files in formatting - ci.sh: don't run uasyncio_gather test on macOS - ci.sh: update for ports/renesas-ra - uncrustify: make sure a space exists after a comma - autobuild: update for ports/renesas-ra - mpy_ld.py: remove obsolete QSTR_WINDOW_SIZE constant - ci.sh: run full test suite on stackless and settrace builds - ci.sh: for esp8266 CI install esptool 3.3.1 - mpy-tool.py: remove obsolete unicode flag in .mpy header - ci.sh: add build of W5100S_EVB_PICO board to rp2 CI - mpy-tool.py: rework .mpy merging feature - ci.sh: add test for mpy-tool's merging feature - mpy-tool.py: improve generated frozen identifiers - mpremote: add command to print the version - mpremote: bump version to 0.3.0 - ci.sh: build NUCLEO_H743ZI with -O2 optimisation level - mpy_ld.py: support R_XTENSA_PDIFF32 relocation - ci.sh: build native .mpy examples for armv7emsp, xtensawin in CI - mpy_ld.py: support GOT entries that reference inside mp_fun_table CI: - workflows: show context for qemu-arm test failures - workflows: add new workflow to test .mpy file format and tools - workflows: add new workflow to test embedding example - workflows: add workflow for renesas-ra port The ports ========= all ports: - consolidate inclusion of umachine module in built-ins - recompile bytecode tests now that .mpy format changed - allow boards to define additional network interfaces - recompile bytecode tests now that .mpy format changed - reformat more C and Python source code - rename thread_t to mp_thread_t - use default VFS config for import_stat and builtin_open bare-arm port: no changes specific to this component/port cc3200 port: - make port-specific modules use MP_REGISTER_MODULE esp8266 port: - moduos: convert module to use extmod version - mpconfigport.h: remove config values that are the defaults - modesp: remove esp.info() function - make port-specific modules use MP_REGISTER_MODULE - machine_wdt: remove deinit method for watchdog - etshal.h: remove unneeded function declaration esp32 port: - machine_adcblock: add new machine.ADCBlock class and update ADC - pin MicroPython to core 1 again - esp32_rmt: call rmt_driver_install directly if running on core 1 - main: allocate at most 1/2 of available IDF heap for MP heap - README.md: fix URL for esp-idf installation - modnetwork: fix test for WIFI_AUTH_MAX for IDF v4.3.0 - main: use heap_caps_get_info on IDF <4.1 to compute total heap - boards: provide custom deploy_c3.md for ESP32-C3 boards - partitions: increase size of app-part from 0x180000 to 0x1F0000 - machine_pwm: fix PWM not allowing frequencies < 611 Hz - machine_pwm: clean up macro names and their use - esp32_rmt: select correct last RMT channel on S2, S3, C3 variants - main: automatically size SPIRAM heap when allocated using malloc - adc: fix wrong mapping between ADC2 channel and GPIO number - remove unneeded modesp.h - create .uf2 binaries for S2 and S3 chips - partitions-16MiB.csv: increase 14MiB filesystem to maximum size - machine_adcblock: fix ADC bit width for ESP32-S3 - machine_adc: fix configuration of default ADC atten value - boards: add three UM ESP32-S3 based boards - mpconfigport.h: use the "extra" feature level - mpconfigport.h: enable remaining features to get to "extra" level - esp32_partition: add support for specifying block_size - modules: create ffat partition object with block_size=512 - README.md: update list of supported IDF versions - boards: add specific deploy instructions for S3 variant - uart: correctly init low-level UART driver for REPL - machine_uart: allow limited configuration of REPL UART - sleep one tick in MICROPY_EVENT_POLL_HOOK - machine_pwm: always set the duty cycle when setting the frequency - machine_uart: make UART.init preserve unspecified parameters - machine_pin: add support for pin drive strength - moduos: convert module to use extmod version - machine_pin: add new hold keyword argument and remove PULL_HOLD - modesp32: add new gpio_deep_sleep_hold function - boards/UM_TINYPICO: remove use of PULL_HOLD - boards: add LOLIN C3 MINI ESP32-C3 based board - machine_hw_spi: use automatic DMA channel selection for SPI on C3 - boards: add support for LilyGO LoRa32 boards - machine_pin: expose pin 20 for ESP32 - allow overriding cmake frozen manifest from the command line - boards: add test manifest to test freezing during build - add MICROPY_HW_ENABLE_UART_REPL and enable on generic S2/S3 - boards: compile GENERIC_SPIRAM and UM_TINYPICO with -Os - machine_pin: don't expose pins 33-37 when octal SPIRAM is enabled - modesp32: properly define RTC_VALID_EXT_PINS on S2/S3 variants - network_wlan: support setting/getting txpower in WLAN.config() - modnetwork: fix build when MICROPY_PY_NETWORK_WLAN is disabled - make port-specific modules use MP_REGISTER_MODULE - boards/UM_FEATHERS3: use correct sdkconfig.board - boards/LILYGO_TTGO_LORA32: remove ID from TTGO Lora32 board json - machine_pin: fix ESP32C3 IDFv4.4.1 build - track allocated iRAM and free it on soft reset - machine_i2c: implement write-then-read I2C transfers - machine_pin: only expose IO20 on esp32 for IDF 4.3.2 and above javascript port: - make port-specific modules use MP_REGISTER_MODULE mimxrt port: - support gaps in the SPI an I2C device numbers - allow for board-specific flash driver files - compensate for a bug in the fsl_lpspi.c file - remove two files from the Seeed Arch Mix directory - replace Pin-config constants by a function call - allow to select cs0 or cs1 for SPI - add USB ID elements - add support for the Olimex RT1010 board - simplify Makefile in selection of flash type - machine_pin: change pin drive constants to DRIVE_x naming - machine_spi: add omitted GPIO config - boards: add board files for MIMXRT1015 and MIMXRT1015_EVK - eth: fix an Ethernet transmit error - boards/TEENSY41: use the same SPI1 pins for Teensy 4.0 and 4.1 - boards: support using an optional board-specific manifest.py - eth: avoid a race condition for Ethernet - hal/pwm_backport: make PWM symmetric, and round division calcs - moduos: convert module to use extmod version - mbedtls: add NULL pointer check in m_free_mbedtls - machine_i2s: add I2S protocol support - boards: add board.json file for OLIMEX RT1010Py - modules: append /flash/lib to the default sys.path - machine_rtc: start RTC at boot and set datetime if not set - machine_spi: improve handling of busy SPI peripheral - mphalport: fix USB CDC RX handling to not block when unprocessed - mbedtls: use core-provided tracked alloc instead of custom funcs - make port-specific modules use MP_REGISTER_MODULE - boards/OLIMEX_RT1010: document the initial deploy procedure - boards: extend the deploy_teensy.md instructions - mphalport: fix strict aliasing error with unique id - update port to work with new nxp_driver v2.10 - machine_uart: fix an inconsistency for UART.init() arg handling minimal port: no changes specific to this component/port nrf port: - drivers/usb: fix background events/scheduling while at USB REPL - drivers/usb: fix MP_STREAM_POLL_RD support on USB CDC - modules: include uasyncio in default board manifest - make port-specific modules use MP_REGISTER_MODULE - mpconfigport: set MICROPY_CONFIG_ROM_LEVEL defines for each MCU - mpconfigport: enable extra features as defined by ROM levels - mpconfigport: fix MICROPY_VFS IO build support - modules/uos/microbitfs: fix MICROPY_MBFS build to use mp_obj_malloc pic16bit port: - make port-specific modules use MP_REGISTER_MODULE - use 1 byte for qstr hash len and include header to fix build powerpc port: no changes specific to this component/port qemu-arm port: - add tests for freezing viper and asm_thumb code - moduos: convert module to use extmod version - test-frzmpy: add test for freezing constant tuples - mpconfigport: define MICROPY_PY_SYS_PLATFORM renesas-ra port: - add new port to Renesas RA - boards: change device name information to show properly - rename pyb_uart_ to machine_uart_ - rename pyb_rtc_ to machine_rtc_ - make port-specific modules use MP_REGISTER_MODULE - modmachine: add missing MP_REGISTER_MODULE for umachine - machine_pin: remove code for unsupported Pin features rp2 port: - machine_i2c: provide more specific error codes from I2C transfer - mpconfigport.h: use internal error numbers - mphalport: add optional dupterm support - machine_uart: add machine.UART init/deinit methods - machine_i2c: use soft I2C only for len=0, and increase timeout - modutime: fix time.localtime day-of-week value - machine_uart: fix UART RTS behaviour so RTS is deasserted - Makefile: add FROZEN_MANIFEST Makefile option, to override default - mpthreadport: fix memory corruption when thread is created in core1 - add USB MSC support - allow Overriding cmake frozen manifest from the command line - enable ucryptolib, using mbedtls for backend functions - mphalport: fix USB CDC RX handling to not block when unprocessed - Makefile: add mbedtls to GIT_SUBMODULES list and use it in CI func - machine_uart: use read/write mutex to prevent char duplication - mpconfigport: enable execfile, NotImplemented and REPL EMACS keys - make port-specific modules use MP_REGISTER_MODULE - mpconfigport.h: enable static scheduler nodes - mpconfigport.h: allow boards to override internal errno config - boards/ARDUINO_NANO_RP2040_CONNECT: disable internal errno - boards/ARDUINO_NANO_RP2040_CONNECT: enable webrepl - mbedtls: add support for ssl module with MICROPY_SSL_MBEDTLS - machine_pin: add mp_hal_pin_interrupt C interface - Makefile: use cmake for "make submodules" task when needed - integrate lwIP network stack - add support for using Wiznet hardware as an Ethernet NIC - boards/W5100S_EVB_PICO: add Wiznet W5100S-EVB-Pico board - Makefile: build in debug mode with "make DEBUG=1" - boards/ARDUINO_NANO_RP2040_CONNECT: update USB PID - mpnetworkport: fix lwip alarm callback timing to use microseconds - CMakeLists: simplify qstr sources when enabling extmod components samd port: - moduos: convert module to use extmod version - make port-specific modules use MP_REGISTER_MODULE stm32 port: - mbedtls: enable MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE - mboot: remove custom HAL_RCC_GetHCLKFreq and use HAL provided one - pin: change remaining uses of "af" to "alt" - dac: deinit all DACs on soft reset - fdcan: fix FIFO1 usage and handling of error interrupts - fdcan: fix naming with regards to G4 series - usbd_conf: set lpm_enable and battery_charging_enable on all MCUs - powerctrlboot: set HAL uwTickPrio variable when needed - powerctrl: write bootloader-state as 64-bit word to work on H7 - mboot: use PLL3 for USB clock source on H7 MCUs - mboot: include hal_rcc_ex.c in source file list - mboot: support H7 MCUs in fwupdate.py - mboot: compute and check CRC32 of dfu file in fwupdate.py - add support for G4 MCUs, and add NUCLEO_G474RE board defn - mboot: allow HSI to be used as the main clock source - mboot: add MBOOT_BOARD_ENTRY_INIT for a board to add entry code - mboot: add support for F469/479 MCUs in fwupdate.py - rtc: use LL_RTC functions to simplify some MCU-specific code - Makefile: make stm32lib configurable - add initial support for STM32WL MCUs - boards/NUCLEO_WL55: add new board definition - system_stm32: make SystemClock_Config() a weak symbol - adc: fix L4 ADC channel numbers - adc: remove obsolete FIRST/LAST GPIO channel macros - boards/NUCLEO_L432KC: disable MICROPY_OPT_COMPUTED_GOTO - boards/NUCLEO_WB55: add Arduino pin alias definitions - mboot: allow a board to fully configure system clocks - mboot: allow a board more control over entry initialisation - moduos: convert module to use extmod version - boards: convert F4xx and F7xx to new flash FS config - mbedtls: add NULL pointer check in m_free_mbedtls - sdcard: use mp_hal_pin_input instead of HAL function - sdcard: add sdcard_select_sd/mmc functions - main: support SD cards without a partition table - dma: add option to disable auto-DMA-turn-off - mboot: add pragma for GCC to ignore array bounds warning - mboot: always check the magic number to enter filesystem loading - mboot: add support for 64-bit mboot address space for reads - mboot: add support for reading from SD card - boards/PYBD_SF2: turn on SD card in mboot init if SD enabled - mboot/fwupdate.py: simplify calculation of CRC32 - mboot: verify signature of fsload packed DFU files before writing - mboot: verify CRC32 of fsload DFU files before writing - support building for STM32F745 - machine_i2s: set FullDuplexMode to disabled on F4 - machine_i2s: allow I2S.deinit to be called multiple times - machine_i2s: fix 16-bit stereo i2s_frame_map - sdio: use runtime calculation for clock divider of sdio on H7 - modmachine: add deepsleep support to reset_cause() for WB55 - pyb_can: enable CAN FD frame support and BRS - pyb_can: add support for CAN FD extended frame ID - pyb_can: add support for bus with mixed Classic/FD nodes - pyb_can: return the filter ID and type of received messages - pyb_can: define the maximum bit timing parameters - pyb_can: replace CAN.initfilterbanks with CAN.init keyword arg - Makefile: allow overriding COPT in Makefile - mpconfigport.h: let MICROPY_PY_IO_FILEIO take its default value - machine_bitstream: include all clobbered regs in Cortex-M0 impl - mboot: consolidate all UI and add general state change hooks - mboot: add macros for use in led_state_all() - sdram: add function to enable SDRAM power-down mode - Makefile: add H747 to Makefile's MCU flags - system_stm32: add H7 switched-mode-power-supply support - system_stm32: set voltage scaling level 0 for H7 Rev-V devices - system_stm32: allow boards to configure PLL VCI, VCO and FRACN - system_stm32: improve H7 PLL and OSC configuration - boards/PYBD_SFx: allow FROZEN_MANIFEST to be overridden - mpbthciport: switch scheduling callback to use node scheduler - boards/SPARKFUN_MICROMOD_STM32: fix incorrect UART and I2C config - mphalport: fix I/O glitches when switching GPIO mode to alt-func - boards/ADAFRUIT_F405_EXPRESS: use external SPI flash for storage - boards/LEGO_HUB_NO6: exclude BTstack code from formatting - qspi: support common flash sizes in MPU configuration - qspi: wait for a free FIFO location before writing to DR - qspi: workaround for SR set immediately after setting AR - ulpi: add USB3320 ULPI low-power functions - ulpi: include missing py/mperrno.h header - boards/ARDUINO_PORTENTA_H7: add support for Arduino Portenta H7 - storage: add support for internal storage on Cortex-M0 MCUs - add support for G0 MCUs - boards/NUCLEO_G0B1RE: add NUCLEO_G0B1RE board definition - mbedtls: use core-provided tracked alloc instead of custom funcs - make port-specific modules use MP_REGISTER_MODULE - rfcore: revert "intercept addr-resolution HCI cmd to work arou..." - mboot: move remaining led_state_all call into mboot_state_change - mboot: add update_app_elements to return mboot fsload elements - mboot: make 0x70ad0000 values named constants with macros - mboot: pass initial_r0 to early-init and get-reset-mode funcs - boards/LEGO_HUB_NO6: make all SPI flash transfers use 32-bit addr - boards/LEGO_HUB_NO6: add support for mboot to access SPI flash - boards/LEGO_HUB_NO6: use multi-colour LED for mboot status - boards/LEGO_HUB_NO6: implement robust filesystem-load updates - boards/LEGO_HUB_NO6: add helper scripts to update app firmware - rfcore: remove extra layer of buffering on BLE IPCC - flash: remove FLASH_OPTR_DBANK condition in L4, H7 get_bank func - machine_i2c: enable timingr constructor keyword on H7 MCUs - powerctrl: disable sys tick interrupt in stop mode on some STM32s - usbd_conf: remove disable of SYSCFG clock - mboot: add board-configurable SysTick hook - mboot: remove MP_WEAK on led funcs and make some of them static - boards/LEGO_HUB_NO6: add comment to readme about powering off - mboot: only include UI code if at least one board LED is defined teensy port: - make port-specific modules use MP_REGISTER_MODULE - mpconfigport.h: remove obsolete macros unix port: - Makefile: remove explicit addition of -std=c++ flag - show compiler info in REPL banner - .gitignore: remove *.py from ignore list - moduos: convert module to use extmod version - mpconfigport.h: collect together config options from extra level - variants: use rom feature config for standard, dev, coverage - variants: enable a few optimisations and features on dev, coverage - make port-specific modules use MP_REGISTER_MODULE - implement `-X realtime` command-line option on macOS - factor out code that generates random bytes to a new func - variants: enable seeding random module on import in dev, coverage windows port: - README.md: fix broken mingw link - add micropython.schedule support - mingw: include extmod/shared/lib sources properly - uselect: enable micropython select in dev variant - uasyncio: add support for uasyncio to windows dev variant - appveyor: fix printing of test failures - Makefile: specify CXXFLAGS in the Makefile - unify project file headers - switch to VFS subsystem and use VfsPosix - consolidate all sleep-related functions into windows_mphal.c - avoid busy loop when using scheduler - use BCryptGenRandom to implement os.urandom - factor out code that generates random bytes to a new func zephyr port: - update include path to disk_access.h - upgrade to Zephyr v3.0.0 - prj.conf: enable CONFIG_BUILD_OUTPUT_HEX to generate .hex output - moduos: convert module to use extmod version - make port-specific modules use MP_REGISTER_MODULE - modusocket: fix function object wrapper for listen method ======== Mon, 17 Jan 2022 09:50:31 +1100 v1.18 Boosted performance, board.json metadata, more mimxrt, rp2, samd features This release of MicroPython sees a boost to the overall performance of the VM and runtime. This is achieved by the addition of an optional cache to speed up general hash table lookups, as well as a fast path in the VM for the LOAD_ATTR opcode on instance types. The new configuration options are MICROPY_OPT_MAP_LOOKUP_CACHE and MICROPY_OPT_LOAD_ATTR_FAST_PATH. As part of this improvement the MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE option has been removed, which provided a similar map caching mechanism but with the cache stored in the bytecode, which made it not useful on bare metal ports. The new mechanism is measured to be at least as good as the old one, applies to more map lookups, has a constant RAM overhead, and applies to native code as well as bytecode. These performance options are enabled on the esp32, mimxrt, rp2, stm32 and unix ports. For esp32 and mimxrt some code is also moved to RAM to further boost performance. On stm32, performance increases by about 20% for benchmarks that are heavy on name lookups, like misc_pystone.py and misc_raytrace.py. On esp32 performance can increase by 2-3x, and on mimxrt it is up to 6x. All boards in all ports now have a board.json metadata file, which is used to automatically build firmware and generate a webpage for that board (among other possibilities). Auto-build scripts have been added for this purpose and they build all esp32, mimxrt, rp2, samd and stm32 boards. The generated output is available at https://micropython.org/download. Support for FROZEN_DIR and FROZEN_MPY_DIR has been deprecated for some time and was finally removed in this release. Instead of these, FROZEN_MANIFEST can be used. The io.resource_stream() function is also removed, replaced by the pure Python version in micropython-lib. The search order for importing frozen Python modules is now controlled by the ".frozen" entry in sys.path. This string is added by default in the second position in sys.path. User code should adjust sys.path depending on the desired behaviour. Putting ".frozen" first in sys.path will speed up importing frozen modules. A bug in multiple precision integers with bitwise of -0 was fixed in commit 2c139bbf4e5724ab253b5b034ce925e04267a9c4. The platform module has been added to allow querying the compiler and underlying SDK/HAL/libc version. This is enabled on esp32, mimxrt and stm32 ports. The mpremote tool now supports seek, flush, mkdir and rmdir on PC-mounted filesystems. And a help command has been added. The documentation has seen many additions and improvements thanks (for a second time) to the Google Season of Docs project. The rp2 documentation now includes a reference for PIO assembly instructions, a PIO quick reference and a PIO tutorial. The random and stm modules have been documented, along with sys.settrace, manifest.py files and mpremote. There is also now more detail about the differences between MicroPython and standard Python 3.5 and above. The esp32 port sees support for ESP32-S3 SoCs, and new boards GENERIC_S3, ESP32_S2_WROVER, LOLIN_S2_MINI, LOLIN_S2_PICO and UM_FEATHERS2NEO. The PWM driver has been improved and now supports all PWM timers and channels, and the duty_u16() and duty_ns() methods, and it keeps the duty constant when changing frequency. The machine.bitstream() function has been improved to use RMT, with an option to select the original bit-banging implementation. The mimxrt port gained new hardware features: SDRAM and SD card support, as well as network integration with a LAN driver. The machine.WDT class was added along with the machine.reset_cause(), machine.soft_reset(), machine.unique_id() add machine.bitstream() functions. DHT sensor support was added, and f-strings were enabled. The rp2 port now has support for networking, and bluetooth using NimBLE. The Nina-W10 WiFi/BT driver is fully integrated and supported by the new Arduino Nano RP2040 connect board. I2S protocol support is added along with a machine.bitstream() driver and DHT sensor support. The PWM driver had a bug fix with the accuracy of setting/getting the frequency, and the duty value is now retained when changing the frequency. On the samd port there is now support for the internal flash being a block device, and for filesystems and the os module. Pin and LED classes have been implemented. There are more time functions, more Python features enabled, and the help() function is added. SEEED_WIO_TERMINAL and SEEED_XIAO board definitions are now available. The stm32 port now has support for F427, F479 and H7A3(Q)/H7B3(Q) MCUs, and new board definitions for VCC_GND_H743VI, OLIMEX_H407, MIKROE_QUAIL, GARATRONIC_PYBSTICK26_F411, STM32H73B3I_DK. A bug was fixed in the SPI driver where a SPI transfer could fail if the CYW43 WiFi driver was also active at the same time. On the windows port the help() function has been enabled, and support for build variants added, to match the unix port. The zephyr port upgraded Zephyr to v2.7.0. The change in code size since the previous release for various ports is (absolute and percentage change in the text section): bare-arm: -1520 -2.605% minimal x86: -2256 -1.531% unix x64: -457 -0.089% unix nanbox: -925 -0.204% stm32: +312 +0.079% PYBV10 cc3200: -176 -0.096% esp8266: +532 +0.076% GENERIC esp32: +27096 +1.820% GENERIC nrf: -212 -0.121% pca10040 rp2: +9904 +2.051% PICO samd: +35332 +33.969% ADAFRUIT_ITSYBITSY_M4_EXPRESS The changes that dominate these numbers are: - bare-arm, minimal: use of new MICROPY_CONFIG_ROM_LEVEL_MINIMUM option and subsequent disabling of remaining optional features - unix, cc3200, nrf: general code size reductions of the core - stm32: performance improvements, addition of platform module - esp8266: enabling f-strings - esp32: use of -O2 instead of -Os - rp2: machine.I2S and other new hardware features - samd: filesystem support and other new hardware features Thanks to everyone who contributed to this release: Alan Dragomirecký, Alexey Shvetsov, Andrew Leech, Andrew Scheller, Antoine Aubert, Boris Vinogradov, Chris Boudacoff, Chris Fiege, Christian Decker, Damien George, Daniel Gorny, Dave Hylands, David Michieli, Emilie Feral, Frédéric Pierson, gibbonsc, Henk Vergonet, iabdalkader, Ihor Nehrutsa, Jan Hrudka, Jan Staal, jc_.kim, Jim Mussared, Jonathan Hogg, Laurens Valk, leo chung, Lorenzo Cappelletti, Magnus von Wachenfeldt, Matt Trentini, Matt van de Werken, Maureen Helm, Michael Bentley, Michael Buesch, Mike Causer, Mike Teachman, Mike Wadsten, Ned Konz, NitiKaur, oli, patrick, Patrick Van Oosterwijck, Peter Boin, Peter Hinch, Peter van der Burg, Philipp Ebensberger, Pooya Moradi, retsyo, robert-hh, roland van straten, Scott Armitage, Sebastian Wicki, Seon Rozenblum, Sergei Silnov, Simon Baatz, Stewart Bonnick, stijn, Tobias Thyrrestrup, Tomas Vanek, YoungJoon Chun. What follows is a detailed list of changes, generated from the git commit history, and organised into sections. Main components =============== all: - remove MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE - update Python formatting to latest Black version 21.12b0 - remove support for FROZEN_DIR and FROZEN_MPY_DIR py core: - parse: simplify parse nodes representing a list - emitnative: ensure load_subscr does not clobber existing REG_RET - mpconfig.h: define initial templates for "feature levels" - vm: add a fast path for LOAD_ATTR on instance types - map: add an optional cache of (map+index) to speed up map lookups - builtinimport: forward all debug printing to MICROPY_DEBUG_PRINTER - add wrapper macros so hot VM functions can go in fast code location - runtime: fix crash when exc __new__ doesn't return an exc instance - mpconfig.h: define the "extra" feature level - mpconfig.h: revert MICROPY_REPL_INFO to disabled at all levels - gc: add hook to run code during time consuming GC operations - showbc: print unary-op string when dumping bytecode - modsys: replace non-ASCII quote char with ASCII char - runtime: allow types to use both .attr and .locals_dict - lexer: support nested [] and {} characters within f-string params - objfun.h: remove obsolete comments about entries in extra_args - builtinimport: refactor module importing - showbc: fix printing of raw bytecode header on nanbox builds - modio: remove io.resource_stream function - only search frozen modules when '.frozen' is found in sys.path - mkrules.cmake: set frozen preprocessor defs early - runtime: allow initialising sys.path/argv with defaults - mpstate.h: only include sys.path/argv objects in state when enabled - mpz: fix bugs with bitwise of -0 by ensuring all 0's are positive - qstr: reset mpstate.qstr_last_chunk before raising an error - modbuiltins: add additional macro for extending builtins - mpconfig.h: define MICROPY_PY_USSL_FINALISER only if not defined extmod: - machine_i2c: make SoftI2C configurable via macro option - machine_spi: make SoftSPI configurable via macro option - modonewire: make _onewire module configurable via macro option - machine_pwm: factor out machine.PWM bindings to common code - move modnetwork and modusocket from stm32 to extmod - modnetwork: add STA_IF and AP_IF constants - modnetwork: add extended socket state - modusocket: add read/write stream methods to socket object - modnetwork: define network interfaces in port config files - network_cyw43: make consistent use of STA and AP constants - modnetwork: remove STM32 references - modnetwork: remove modnetwork socket u_state member - mpbthci.h: add mp_bluetooth_hci_uart_any prototype - nimble: add nimble CMake fragment file - add platform module - moduplatform: improve implementation for PC ports - vfs_posix_file: support MP_STREAM_POLL in vfs_posix_file_ioctl - modbluetooth: add connection interval to gap_connect - nimble: update to NimBLE v1.4 - nimble: remove workaround for OS_ENOMEM - uasyncio: fix gather returning exceptions from a cancelled task - uplatform: remove unused definitions - uplatform: use generic custom platform string - network_ninaw10: fix scan list order to match other NICs - modbluetooth: support gap_connect(None) to cancel a connection - modure: redirect regex debug printing to mp_printf - network_ninaw10: fix config of AP mode - network_ninaw10: disable active connections before connecting - network_ninaw10: make NIC state persistent - network_ninaw10: return -1 on timeout from recv/send - network_ninaw10: make recv/recvfrom interchangeable - moduplatform: detect xtensa arch - modusocket: allow setting timeout on unbound sockets - modusocket: initialise accepted socket state - network_ninaw10: use socket timeout preset in modusocket - modbluetooth: fix conditional compilation of ringbuf_put_uuid - modbluetooth: put declaration of connect_cancel in correct place shared: - libc/string0: don't include string.h, and provide __memcpy_chk - runtime/pyexec: cleanup EXEC_FLAG flag constants drivers: - ninaw10: add ublox Nina-W10 WiFi/BT module driver - lsm6dsox: add LSM6DSOX driver and examples - neopixel: avoid heap alloc in fill() - ninaw10: fix BSSID byte order, and add null byte to ESSID - ninaw10/nina_wifi_drv: fix DNS resolution mpy-cross: no changes specific to this component/port lib: - mynewt-nimble: switch to the MicroPython fork of NimBLE - asf4: point submodule to latest commit on circuitpython branch - update pico-sdk to 1.3.0 and tinyusb to 0.12.0 - stm32lib: update library for L4 v1.17.0, new G4, WL, and MMC fixes - stm32lib: update library for fix to F7 USB HS Support components ================== docs: - library/os.rst: clarify littlefs requirements for block erase - library/bluetooth.rst: update incorrect link to gatts_write - make.bat: change Windows output dir from '_build' to 'build' - library/machine.I2S.rst: specify that I2S.shift args are kw-only - esp32: explain ESP32 PWM modes, timers, and channels - rp2: add reference for PIO assembly instructions, and PIO tutorial - library/random.rst: document the random module - reference/mpremote.rst: add docs for mpremote - reference/manifest.rst: add docs for manifest.py files - library/stm.rst: document the stm module - esp32/tutorial: add an example of peripheral control via regs - rp2/general.rst: fix typo with missing spaces - library/framebuf.rst: adjust dimensions in example - library/rp2.rst: update function asm_pio_encode to add sideset_opt - reference/filesystem.rst: add detail on how to use littlefs fuse - rp2/quickref.rst: add section on PIO - library/sys.rst: add docs for sys.settrace - esp8266/tutorial: fix comments of FrameBuffer examples - library/uasyncio.rst: detail exception behaviour in cancel/timeout - library/machine.Timer.rst: document 'id' as positional-only arg - library/machine.SPI.rst: add example SPI usage - library/machine.Timer.rst: document `period` and `callback` args - library/machine.Pin.rst: add Pin.ANALOG mode constant - remove trailing spaces and convert tabs to spaces - library/sys.rst: add note about '.frozen' as an entry in sys.path - differences: document details of new PEPs/features in Python 3.5+ - update copyright year range to include 2022 - esp32: update RMT quickref example to match latest code examples: no changes specific to this component/port tests: - perf_bench: use math.log instead of math.log2 - basics: add tests for type-checking subclassed exc instances - micropython/const.py: add comment about required config for test - cpydiff: clarify f-string diffs regarding concatenation - basics/int_big_cmp.py: add more tests for big-int comparison - extmod: skip uselect_poll_udp when poll() is not available tools: - autobuild: add auto build for GENERIC_C3_USB - ci.sh: use IDF v4.4 as part of esp32 CI and build GENERIC_S3 - autobuild: add the MIMXRT1010_EVK board to autobuild - ci.sh: use a specific ESP IDF v4.4 commit - autobuild: add script to generate website board metadata - dfu.py: make tool work with python3 when parsing DFU files - autobuild: automatically build all mimxrt, rp2 and samd boards - autobuild: automatically build all stm32 boards - mpremote: implement seek and flush in ioctl method - autobuild: automatically build all esp32 boards - upip.py: support == to specify exact package version - makemanifest.py: make str conversion compatible with Python 2 - makemanifest.py: merge make-frozen.py - mpremote: add mkdir and rmdir to RemoteFS - mpremote: add help command - mpremote: add link to mpremote docs URL in help message - upip.py: skip '.frozen' entry in sys.path for install path - autobuild: build esp8266 OTA image with GENERIC_1M board - ci.sh: upgrade Zephyr docker image to v0.21.0 - ci.sh: build zephyr nucleo_wb55rg to test zephyr bluetooth build CI: - workflows: use Python 3.8 for macos workflow - workflows: add new workflow to build ports download metadata The ports ========= all ports: - add board.json for all boards - add images, features and urls to board.json - add '.frozen' as the first entry in sys.path - move '.frozen' to second entry in sys.path bare-arm port: - mpconfigport.h: use MICROPY_CONFIG_ROM_LEVEL_MINIMUM - mpconfigport.h: disable remaining optional features cc3200 port: no changes specific to this component/port esp8266 port: - boards/GENERIC: enable f-strings - extract qstr from object when comparing keys in config() - etshal.h: remove unneeded function declarations - allow building a board to any dest directory esp32 port: - boards: add new FeatherS2-Neo board definition - machine_timer: use tx_update member for IDF 4.4 and above - add support for ESP32-S3 SoCs - boards: add new GENERIC_S3 board definition - machine_hw_spi: fix hardware SPI DMA channels for S2/S3 - boards: add board definition for ESP32-S2-WROVER module - boards: add LOLIN_S2_MINI ESP32-S2 board - machine_pwm: add support for all PWM timers and channels - README: updated readme with req IDF vers for ESP32-S2, C3 and S3 - usb: add USB host connection detection for CDC serial output - machine_pin: block out IO16 and IO17 when using SPIRAM on ESP32 - mpthreadport: fix TCB cleanup function so thread_mutex is ready - main: add option for a board to hook code into startup sequence - split out WLAN code from modnetwork.c to network_wlan.c - enable optimisations and move code to iRAM to boost performance - usb: improve speed of USB CDC output - add specific deploy_s2.md instructions for esp32-s2 - boards/LOLIN_S2_MINI: add image to board.json - boards: update board and deploy metadata for UM_xxx boards - usb: further improve speed of USB CDC output - boards/LOLIN_S2_PICO: add LOLIN_S2_PICO board definition files - boards/ESP32_S2_WROVER: link to specific deploy_s2 instructions - support building with latest IDF v5 - in machine_i2s, send null samples in underflow situations - in machine_i2s, make object reference arrays root pointers - add SDCard support for S3, and a GENERIC_S3_SPIRAM board - boards/GENERIC_S3: enable BLE on ESP32 S3 - machine_pwm: implement duty_u16() and duty_ns() PWM methods - extract qstr from object when comparing keys in config() - machine_pin: make GPIO 26 usable for S2,S3 if SPIRAM not config'd - machine_hw_spi: fix SPI default pins reordering on ESP32-S2/S3 - machine_hw_spi: set proper default SPI(id=1) pins on S2,S3 and C3 - machine_hw_spi: set proper default SPI(id=2) pins on S2 and S3 - boards: remove SPI pin defaults from GENERIC S2/S3 boards - modnetwork: synchronize WiFi AUTH_xxx constants with IDF values - machine_pwm: keep duty constant when changing frequency - machine_bitstream: replace bit-bang code with RMT-based driver - machine_i2s: add support for ESP-IDF 4.4 - machine_bitstream: fix signal duplication on output pins - esp32: enable platform module with IDF version - boards/GENERIC_D2WD: build with -Os optimisation - esp32_rmt: install RMT driver on core 1 - machine_bitstream: reinstate bitstream bit-bang implementation javascript port: no changes specific to this component/port mimxrt port: - sdcard: implement SDCard driver - machine_bitstream: add bitstream function to machine module - rework flash configuration - sdram: add SDRAM support - eth: add LAN support and integrate the network module - modmachine: implement machine.WDT() and machine.reset_cause() - boards: fix the D14/D15 pin assignment of MIMXRT1050/60/64_EVK - hal: remove duplicate definitions from flexspi_hyper_flash.h - dma_channel: fix the DMA channel management - fix cycle counter for time.ticks_cpu() and machine.bitstream() - add dht_readinto() to the mimxrt module, and freeze dht.py - extend the help() message and README.md - mpconfigport.h: enable f-strings - modmachine: implement soft_reset() and unique_id() functions - boards/make-pins.py: allow empty lines and comments in pins.csv - optimize the runtime speed - enable the platform module - boards: add the Seeed ARCH MIX board - boards: update the board.json files and add deploy_xx.md files - fix mp_hal_quiet_timing_enter()/exit() so timer still runs - support PWM using the FLEXPWM and QTMR modules - define UART 0 on MIMXRT boards - support selection of PHY type and address - re-enable eth checksum creation by HW - fix a tiny unnoticed bug in sdcard.c - add a driver for the DP83848 PHY device - refactor the reading of the machine id - enable ticks_cpu at boot time for NDEBUG builds only - use -Og instead of -O0 for DEBUG builds - tidy up the board flash related files - hal: allow readSampleClkSrc to be configured by a board - enable MICROPY_PY_USSL_FINALISER minimal port: - mpconfigport.h: use MICROPY_CONFIG_ROM_LEVEL_MINIMUM - Makefile: don't force a 32-bit build - mpconfigport.h: disable features that are not needed nrf port: - Makefile: improve Black Magic Probe commands - main: use VFS helper function to mount fs and chdir pic16bit port: no changes specific to this component/port powerpc port: no changes specific to this component/port qemu-arm port: no changes specific to this component/port rp2 port: - mpconfigport.h: enable heapq module - add support for bluetooth module using NimBLE - add framework for networking - mpconfigport.h: use the "extra" feature level - enable optimisations (comp goto, map cache, fast attr) - machine_i2s: add I2S protocol support - add support for Nina-W10 WiFi/BT module - boards: add support for Arduino Nano RP2040 - machine_bitstream: implement the machine.bitstream driver - boards: add neopixel.py to manifest.py - rp2_pio: support exec with sideset - boards/PIMORONI_PICOLIPO_16MB: fix 16MB flash size - boards: add PYBSTICK26 RP2040 board definition - machine_uart: handle and clear UART RX timeout IRQ - boards/ARDUINO_NANO_RP2040_CONNECT: set default I2C pins - machine_pwm: fix PWM frequency setting - machine_pwm: keep duty value when changing the frequency - add support for DHT11 and DHT22 sensors - CMakeLists.txt: allow a board to override PICO_BOARD - boards/GARATRONIC_PYBSTICK26_RP2040: use correct pico-sdk board cfg samd port: - integrate latest asf4, add help, more time funcs and uPy features - samd_soc: allow a board to configure the low-level MCU config - add internal flash block device, filesystem and uos support - add Pin and LED classes, and machine.unique_id - boards/ADAFRUIT_FEATHER_M0_EXPRESS: update for flash and pins - boards/ADAFRUIT_ITSYBITSY_M4_EXPRESS: update for flash and pins - boards/MINISAM_M4: update for flash and pins - boards/ADAFRUIT_TRINKET_M0: update for flash and pins - boards/SAMD21_XPLAINED_PRO: update for flash and pins - boards/SEEED_WIO_TERMINAL: add new board definition - boards/SEEED_XIAO: add new board definition - README.md: update README to reflect new features and boards stm32 port: - pin: enable GPIO clock of pin if it's constructed without init - main: don't unconditionally enable GPIO A,B,C,D clocks - boards/VCC_GND_H743VI: add board definition for VCC_GND_H743VI - boards/OLIMEX_E407: add Ethernet RMII support - boards/LEGO_HUB_NO6: remove user paths from cc2564 init file - boards: remove trailing spaces, and add newline at end of file - add basic support for STM32H750 - add support for H7A3(Q)/H7B3(Q), and STM32H73B3I_DK board defn - suggest putting code in main.py not boot.py - boards/make-pins.py: allow a CPU pin to be hidden - boards/make-pins.py: allow empty lines and comments in pins.csv - dma: add functions for external users of DMA to enable clock - enable LOAD_ATTR fast path, and map lookup caching on >M0 - boards: add OLIMEX H407 board definition - enable platform module - extended flash filesystem space to 512K on H743 boards - boards/NUCLEO_H743ZI: enable VfsLfs2 on NUCLEO_H743ZI(2) boards - boards: add PF11-BOOT0 to stm32f091_af.csv - machine_i2c: use hardware I2C for STM32H7 - sdram: enforce gcc opt, and use volatile and DSB in sdram_test - usbd_cdc_interface: allow a board to hook into USBD CDC RX events - mpbthciport: allow a board to hook BT HCI poll functions - pendsv: allow a board to add entries for pendsv_schedule_dispatch - boards: add images to board.json for Adafruit and VCC_GND boards - uart: fix race conditions and clearing status in IRQ handler - mpconfigport.h: use the "extra" feature level - in machine_i2s, send null samples in underflow situations - in machine_i2s, make object reference arrays root pointers - led: support an extra 2 LEDs in board configuration - boards/MIKROE_CLICKER2_STM32: add more detail to board.json - boards: add new board MikroElektronika Quail, and F427 support - main: run optional frozen module at boot - sdio: don't explicitly disable DMA2 on deinit of SDIO - dma: make DMA2_Stream3 exclusive to SDIO when CYW43 enabled - boards: build NUCLEO_WB55 and STM32F769DISC without mboot enabled - boards: add PYBSTICK26 F411 board definition - boards/NADHAT_PYBF405: rename board to GARATRONIC_NADHAT_F405 - usb: use a table of allowed values to simplify usb_mode get/set - boards/NUCLEO_WB55: update rfcore_firmwre for new WS - flashbdev: support generic flash storage config via link symbols - boards: convert F413,F439,H743,L4xx,WB55 to new flash FS config - add support for F479 MCUs - include HAL MMC code in F4 builds - boards/make-pins.py: use cpu pins to define static alt-fun macros - boards/NUCLEO_WB55: fix LED ordering - boards/LEGO_HUB_NO6: set filesystem label as HUB_NO6 - boards: remove stray '+' characters at start of lines in ld files - boards: remove unused MICROPY_HW_ENABLE_TIMER config - boards: enable MICROPY_HW_ENABLE_SERVO on various boards - update L4 code to build with latest stm32lib and L4 HAL 1.17.0 - main: call sdcard_init when only MICROPY_HW_ENABLE_MMCARD enabled - sdcard: support 8-bit wide SDIO bus - sdcard: add config option to force MM card capacity - factoryreset: init vfs flags before calling pyb_flash_init_vfs - qspi: fix typo in address comment - boards/make-pins.py: generate empty ADC table if needed - boards/OLIMEX_H407: fix typo in OLIMEX H407 board.json - network_wiznet5k: fix build error with wiznet5k and lwip enabled - enable MICROPY_PY_USSL_FINALISER teensy port: - switch to use manifest.py instead of FROZEN_DIR unix port: - enable LOAD_ATTR fast path, and map lookup caching - modusocket: support MP_STREAM_POLL in unix socket_ioctl - modos: add support for uos.urandom(n) - coverage: change remaining printf to mp_printf - Makefile: use -Og instead of -O0 for debug builds windows port: - README: remove unsupported Python instructions for Cygwin - mpconfigport.h: enable help and help("modules") - add support for build variants to windows port - run tests via Makefile - appveyor: build both standard and dev variants - appveyor: build mpy-cross only once for mingw-w64 - msvc: run qstr preprocessing phase in parallel zephyr port: - mphalport.h: remove unused and unimplemented C-level pin API - increase minimum CMake version to 3.20.0 - update include path to reboot.h - get UART console device from devicetree instead of Kconfig - use CONFIG_USB_DEVICE_STACK for conditional USB device support - upgrade to Zephyr v2.7.0 - modbluetooth_zephyr: provide dummy connect_cancel function ======== Thu, 2 Sep 2021 00:07:13 +1000 v1.17 F-strings, new machine.I2S class, ESP32-C3 support and LEGO_HUB_NO6 board This release of MicroPython adds support for f-strings (PEP-498), with a few limitations compared to normal Python. F-strings are essentially syntactic sugar for "".format() and make formatting strings a lot more convenient. Other improvements to the core runtime include pretty printing OSError when it has two arguments (an errno code and a string), scheduling of KeyboardInterrupt on the main thread, and support for a single argument to the optimised form of StopIteration. In the machine module a new I2S class has been added, with support for esp32 and stm32 ports. This provides a consistent API for transmit and receive of audio data in blocking, non-blocking and asyncio-based operation. Also, the json module has support for the "separators" argument in the dump and dumps functions, and framebuf now includes a way to blit between frame buffers of different formats using a palette. A new, portable machine.bitstream function is also added which can output a stream of bits with configurable timing, and is used as the basis for driving WS2812 LEDs in a common way across ports. There has been some restructuring of the repository directory layout, with all third-party code now in the lib/ directory. And a new top-level directory shared/ has been added with first-party code that was previously in lib/ moved there. The docs have seen further improvement with enhancements and additions to the rp2 parts, as well as a new quick reference for the zephyr port. The terms master/slave have been replaced with controller/peripheral, mainly relating to I2C and SPI usage. And u-module references have been replaced with just the module name without the u-prefix to help clear up the intended usage of modules in MicroPython. For the esp8266 and esp32 ports, hidden networks are now included in WLAN scan results. On the esp32 the RMT class is enhanced with idle_level and write_pulses modes. There is initial support for ESP32-C3 chips with GENERIC_C3 and GENERIC_C3_USB boards. The javascript port has had its Makefile and garbage collector implementation reworked so it compiles and runs with latest the Emscripten using asyncify. The mimxrt port sees the addition of hardware I2C and SPI support, as well as some additional methods to the machine module. There is also support for Hyperflash chips. The nrf port now has full VFS storage support, enables source-line on traceback, and has .mpy features consistent with other ports. For the rp2 port there is now more configurability for boards, and more boards added. The stm32 port has a new LEGO_HUB_NO6 board definition with detailed information how to get this LEGO Hub running stock MicroPython. There is also now support to change the CPU frequency on STM32WB MCUs. And USBD_xxx descriptor options have been renamed to MICROPY_HW_USB_xxx. Thanks to everyone who contributed to this release: Amir Gonnen, Andrew Scheller, Bryan Tong Minh, Chris Wilson, Damien George, Daniel Mizyrycki, David Lechner, David P, Fernando, finefoot, Frank Pilhofer, Glenn Ruben Bakke, iabdalkader, Jeff Epler, Jim Mussared, Jonathan Hogg, Josh Klar, Josh Lloyd, Julia Hathaway, Krzysztof Adamski, Matúš Olekšák, Michael Weiss, Michel Bouwmans, Mike Causer, Mike Teachman, Ned Konz, NitiKaur, oclyke, Patrick Van Oosterwijck, Peter Hinch, Peter Züger, Philipp Ebensberger, robert-hh, Roberto Colistete Jr, Sashkoiv, Seon Rozenblum, Tobias Thyrrestrup, Tom McDermott, Will Sowerbutts, Yonatan Goldschmidt. What follows is a detailed list of changes, generated from the git commit history, and organised into sections. Main components =============== all: - fix signed shifts and NULL access errors from -fsanitize=undefined - update to point to files in new shared/ directory py core: - mpstate: make exceptions thread-local - mpstate: schedule KeyboardInterrupt on main thread - mperrno: add MP_ECANCELED error code - makeqstrdefs.py: don't include .h files explicitly in preprocessing - mark unused arguments from bytecode decoding macros - objexcept: pretty print OSError also when it has 2 arguments - makeversionhdr: add --tags arg to git describe - vm: simplify handling of MP_OBJ_STOP_ITERATION in yield-from opcode - objexcept: make mp_obj_exception_get_value support subclassed excs - support single argument to optimised MP_OBJ_STOP_ITERATION - introduce and use mp_raise_type_arg helper - modsys: optimise sys.exit for code size by using exception helpers - objexcept: make mp_obj_new_exception_arg1 inline - obj: fix formatting of comment for mp_obj_is_integer - emitnative: reuse need_reg_all func in need_stack_settled - emitnative: ensure stack settling is safe mid-branch - runtime: fix bool unary op for subclasses of native types - builtinimport: fix condition for including do_execute_raw_code() - mkrules: automatically build mpy-cross if it doesn't exist - implement partial PEP-498 (f-string) support - lexer: clear fstring_args vstr on lexer free - mkrules.mk: do submodule sync in "make submodules" extmod: - btstack: add missing call to mp_bluetooth_hci_uart_deinit - btstack: check that BLE is active before performing operations - uasyncio: get addr and bind server socket before creating task - axtls-include: add axtls_os_port.h to customise axTLS - update for move of crypto-algorithms, re1.5, uzlib to lib - moduselect: conditionally compile select() - nimble: fix leak in l2cap_send if send-while-stalled - btstack/btstack.mk: use -Wno-implicit-fallthrough, not =0 - utime: always invoke mp_hal_delay_ms when >= to 0ms - modbluetooth: clamp MTU values to 32->UINT16_MAX - nimble: allow modbluetooth binding to hook "sent HCI packet" - nimble: add "memory stalling" mechanism for l2cap_send - uasyncio: in open_connection use address info in socket creation - modujson: add support for dump/dumps separators keyword-argument - modlwip: fix close and clean up of UDP and raw sockets - modbluetooth: add send_update arg to gatts_write - add machine.bitstream - modframebuf: enable blit between different formats via a palette lib: - tinyusb: update to version 0.10.1 - pico-sdk: update to version 1.2.0 - utils/stdout_helpers: make mp_hal_stdout_tx_strn_cooked efficient - axtls: switch to repo at micropython/axtls - axtls: update to latest axtls 2.1.5 wih additional commits - re1.5: move re1.5 code from extmod to lib - uzlib: move uzlib code from extmod to lib - crypto-algorithms: move crypto-algorithms code from extmod to lib - update README's based on contents of these dirs drivers: - neopixel: add common machine.bitstream-based neopixel module - neopixel: optimize fill() for speed - neopixel: reduce code size of driver - cyw43: fix cyw43_deinit so it can be called many times in a row - cyw43: make wifi join fail if interface is not active mpy-cross: - disable stack check when building with Emscripten Support components ================== docs: - library: document new esp32.RMT features and fix wait_done - library: warn that ustruct doesn't handle spaces in format strings - esp8266/tutorial: change flash mode from dio to dout - replace master/slave with controller/peripheral in I2C and SPI - rp2: enhance quickref and change image to Pico pinout - rp2: update general section to give a brief technical overview - library/utime.rst: clarify behaviour and precision of sleep ms/us - library/uasyncio.rst: document stream readexactly() method - library/machine.I2S.rst: fix use of sd pin in examples - zephyr: add quick reference for the Zephyr port - library/zephyr: add libraries specific to the Zephyr port - templates: add unix and zephyr quickref links to top-index - rename ufoo.rst to foo.rst - replace ufoo with foo in all docs - library/index.rst: clarify module naming and purpose - library/builtins.rst: add module title - library/network.rst: simplify socket import - add docs for machine.bitstream and neopixel module - library: fix usage of :term: for frozen module reference - esp8266: use monospace for software tools - reference: mention that slicing a memoryview causes allocation examples: no changes specific to this component/port tests: - extmod: make uasyncio_heaplock test more deterministic - cpydiff/modules_struct_whitespace_in_format: run black - extmod/ujson: add tests for dump/dumps separators argument - run-multitests.py: add broadcast and wait facility - multi_bluetooth/ble_subscribe.py: add test for subscription - extmod/vfs_fat_finaliser.py: ensure alloc at never-used GC blocks - basics: split f-string debug printing to separate file with .exp - pybnative: make while.py test run on boards without pyb.delay tools: - autobuild: add scripts to build release firmware - remove obsolete build-stm-latest.sh script - ci.sh: run apt-get update in ci_powerpc_setup - makemanifest.py: allow passing flags to mpy-tool.py - autobuild: add mimxrt port to build scripts for nightly builds - pyboard.py: add cmd-line option to make soft reset configurable - mpremote: swap order of PID and VID in connect-list output - ci.sh: build unix dev variant as part of macOS CI - ci.sh: build GENERIC_C3 board as part of esp32 CI - autobuild: use separate IDF version to build newer esp32 SoCs - autobuild: add FeatherS2 and TinyS2 to esp32 auto builds - mpremote: add seek whence for mounted files - mpremote: raise OSError on unsupported RemoteFile.seek - autobuild: add the MIMXRT1050_EVKB board to the daily builds - ci.sh: add mpy-cross build to nrf port - codeformat.py: include ports/nrf/modules/nrf in code formatting - gen-cpydiff.py: don't rename foo to ufoo in diff output - autobuild: add auto build for Silicognition wESP32 - mpremote: fix connect-list in case VID/PID are None - mpremote: add "devs" shortcut for "connect list" - mpremote: remove support for pyb.USB_VCP in/out specialisation - autobuild: don't use "-B" for make, it's already a fresh build - pyboard.py: move --no-exclusive/--soft-reset out of mutex group - pyboard.py: make --no-follow use same variable as --follow - pyboard.py: add --exclusive to match --no-exclusive - pyboard.py: make --no-soft-reset consistent with other args - uncrustify: force 1 newline at end of file - mpremote: bump version to 0.0.6 CI: - workflows: add workflow to build and test javascript port - workflows: switch from Coveralls to Codecov - workflows: switch from lcov to gcov - workflows: add workflow to build and test unix dev variant The ports ========= all ports: - use common mp_hal_stdout_tx_strn_cooked instead of custom one - update for move of crypto-algorithms, uzlib to lib - rename USBD_VID/PID config macros to MICROPY_HW_USB_VID/PID bare-arm port: no changes specific to this component/port cc3200 port: no changes specific to this component/port esp8266 port: - add __len__ to NeoPixel driver to support iterating - Makefile: add more libm files to build - include hidden networks in WLAN.scan results - replace esp.neopixel with machine.bitstream - remove dead code for end_ticks in machine_bitstream esp32 port: - boards/sdkconfig.base: disable MEMPROT_FEATURE to alloc from IRAM - add __len__ to NeoPixel driver to support iterating - main: allow MICROPY_DIR to be overridden - esp32_rmt: fix RMT looping in newer IDF versions - esp32_rmt: enhance RMT with idle_level and write_pulses modes - add new machine.I2S class for I2S protocol support - machine_spi: calculate actual attained baudrate - machine_hw_spi: use a 2 item SPI queue for long transfers - machine_dac: add MICROPY_PY_MACHINE_DAC option, enable by default - machine_i2s: add MICROPY_PY_MACHINE_I2S option, enable by default - fix use of mp_int_t, size_t and uintptr_t - add initial support for ESP32C3 SoCs - boards/GENERIC_C3: add generic C3-based board - modmachine: release the GIL in machine.idle() - mphalport: always yield at least once in delay_ms - machine_uart: add flow kw-arg to enable hardware flow control - boards: add Silicognition wESP32 board configuration - mpconfigport.h: enable reverse and inplace special methods - include hidden networks in WLAN.scan results - makeimg.py: get bootloader and partition offset from sdkconfig - enable MICROPY_PY_FSTRINGS by default - machine_hw_spi: release GIL during transfers - machine_pin: make check for non-output pins respect chip variant - replace esp.neopixel with machine.bitstream - remove dead code for end_ticks in machine_bitstream - boards: add GENERIC_C3_USB board with USB serial/JTAG support javascript port: - rework Makefile and GC so it works with latest Emscripten - Makefile: suppress compiler errors from array bounds - Makefile: change variable to EXPORTED_RUNTIME_METHODS mimxrt port: - move calc_weekday helper function to timeutils - machine_spi: add the SPI class to the machine module - moduos: seed the PRNG on boot using the TRNG - boards: set vfs partition start to 1 MBbyte - main: skip running main.py if boot.py failed - main: extend the information returned by help() - mimxrt_flash: remove commented-out code - modmachine: add a few minor methods to the machine module - machine_led: use mp_raise_msg_varg helper - machine_i2c: add hardware-based machine.I2C to machine module - add support for Hyperflash chips - boards: add support for the MIMXRT1050_EVKB board - machine_pin: implement ioctl for Pin minimal port: - Makefile: add support for building with user C modules nrf port: - modules: replace master/slave with controller/peripheral in SPI - boards/common.ld: calculate unused flash region - modules/nrf: add new nrf module with flash block device - drivers: add support for using flash block device with SoftDevice - mpconfigport.h: expose nrf module when MICROPY_PY_NRF is set - README: update README.md to reflect internal file systems - mpconfigport.h: tune FAT FS configuration - Makefile: add _fs_size linker script override from make - modules/uos: allow a board to configure MICROPY_VFS_FAT/LFS1/LFS2 - mpconfigport.h: enable MICROPY_PY_IO_FILEIO when an FS is enabled - qstrdefsport.h: add entries for in-built FS mount points - main: add auto mount and auto format hook for internal flash FS - boards: enable needed features for FAT/LFS1/LFS2 - facilitate use of freeze manifest - boards: set FROZEN_MANIFEST blank when SD present on nrf51 targets - modules/scripts: add file system formatting script - Makefile: set default manifest file for all targets - mphalport: add dummy function for mp_hal_time_ns() - boards: enable MICROPY_VFS_LFS2 for all target boards - modules/uos: add ilistdir to uos module - modules/nrf: add function to enable/disable DCDC - enable source line on tracebacks - set .mpy features consistent with documentation and other ports pic16bit port: no changes specific to this component/port powerpc port: no changes specific to this component/port qemu-arm port: no changes specific to this component/port rp2 port: - use 0=Monday datetime convention in RTC - machine_rtc: in RTC.datetime, compute weekday automatically - CMakeLists.txt: suppress compiler errors for pico-sdk and tinyusb - tusb_config.h: set CFG_TUD_CDC_EP_BUFSIZE to 256 - machine_uart: add hardware flow control support - machine_uart: allow overriding default machine UART pins - machine_i2c: allow boards to configure I2C pins using new macros - machine_spi: allow boards to configure SPI pins using new macros - machine_uart: fix poll ioctl to also check hardware FIFO - machine_uart: fix read when FIFO has chars but ringbuf doesn't - tusb_port: allow boards to configure USB VID and PID - boards/ADAFRUIT_FEATHER_RP2040: configure custom VID/PID - boards/ADAFRUIT_FEATHER_RP2040: configure I2C/SPI default pins - boards/SPARKFUN_PROMICRO: configure UART/I2C/SPI default pins - boards/SPARKFUN_THINGPLUS: configure I2C/SPI default pins - boards: add Adafruit ItsyBitsy RP2040 - boards: add Adafruit QT Py RP2040 - boards: add Pimoroni Pico LiPo 4MB - boards: add Pimoroni Pico LiPo 16MB - boards: add Pimoroni Tiny 2040 - CMakeLists.txt: allow a board's cmake to set the manifest path - enable MICROPY_PY_FSTRINGS by default - Makefile: add "submodules" target, to match other ports - rp2_flash: disable IRQs while calling flash_erase/program - CMakeLists.txt: add option to enable double tap reset to bootrom - mpconfigport.h: allow boards to add root pointers samd port: - add support for building with user C modules stm32 port: - softtimer: add soft_timer_reinsert() helper function - mpbthciport: change from systick to soft-timer for BT scheduling - provide a custom BTstack runloop that integrates with soft timer - usb: make irq's default trigger enable all events - boardctrl: skip running main.py if boot.py had an error - sdio: fix undefined reference to DMA stream on H7 - dma: add DMAMUX configuration for H7 to fix dma_nohal_init - main: call mp_deinit() at end of main - adc: allow using ADC12 and ADC3 for H7 - adc: define the ADC instance used for internal channels - adc: simplify and generalise how pin_adcX table is defined - add new machine.I2S class for I2S protocol support - boards/NUCLEO_F446RE: fix I2C1 pin assignment to match datasheet - replace master/slave with controller/peripheral in I2C and SPI - systick: always POLL_HOOK when delaying for milliseconds - sdram: make SDRAM test cache aware, and optional failure with msg - boards/NUCLEO_F446RE: enable CAN bus support - boards: add support for SparkFun STM32 MicroMod Processor board - uart: fix LPUART1 baudrate set/get - uart: support low baudrates on LPUART1 - boards/STM32F429DISC: set correct UART2 pins and add UART3/6 - boards/NUCLEO_F439ZI: add board definition for NUCLEO_F439ZI - boards/LEGO_HUB_NO6: add board definition for LEGO_HUB_NO6 - Makefile: update to only pull in used Bluetooth library - README.md: update supported MCUs, and submodule and mboot use - usbd_desc: rename USBD_xxx descriptor opts to MICROPY_HW_USB_xxx - usbd_cdc_interface: rename USBD_CDC_xx opts to MICROPY_HW_USB_xx - powerctrl: support changing frequency on WB MCUs - boards/NUCLEO_H743ZI2: add modified version of NUCLEO_H743ZI - mbedtls: fix compile warning about uninitialized val - enable MICROPY_PY_FSTRINGS by default - add implementation of machine.bitstream - Makefile: allow GIT_SUBMODULES and LIBS to be extended - stm32_it: support TIM17 IRQs on WB MCUs - disable computed goto on constrained boards - storage: make extended-block-device more configurable - boards/LEGO_HUB_NO6: change SPI flash storage to use hardware SPI - boards/LEGO_HUB_NO6: skip first 1MiB of SPI flash for storage - boards/LEGO_HUB_NO6: add make commands to backup/restore firmware teensy port: no changes specific to this component/port unix port: - modffi: add option to lock GC in callback, and cfun access - Makefile: add back LIB_SRC_C to list of object files - variants: enable help and help("modules") on standard and dev - Makefile: disable error compression on arm-linux-gnueabi-gcc windows port: - Makefile: add .exe extension to executables name - appveyor: update to VS 2017 and use Python 3.8 for build/test zephyr port: - machine_spi: add support for hardware SPI ======== Fri, 18 Jun 2021 16:38:06 +1000 v1.16 New mpremote tool, and the mimxrt port gets Pin, ADC, UART, RTC and VFS This release of MicroPython includes a new command-line tool called "mpremote", which is intended to be the main way to remotely control a MicroPython-based device from the command line. It features a serial terminal, filesystem access, support to mount a local directory on the remote device, and a macro language to define custom commands. This tool can be installed from PyPI via "pip3 install mpremote", and it works on Linux, Windows and Mac. As part of this, improvements were made to pyboard.py including opening serial ports in exclusive mode to more easily manage multiple devices. In the Python core, OSError exceptions now support the ".errno" attribute, and an option was added to compile MicroPython without error messages to further reduce code size where needed. The REPL was improved so that it does not tab-complete private methods (those starting with underscore, if no underscore has been typed yet), and it also now tab completes built-in module names after "import" is typed. There has been a minor breaking change to a relative import exception: what was previously a ValueError was changed to ImportError, following the same change in CPython. See commit 53519e322a5a0bb395676cdaa132f5e82de22909. In the extmod components, uctypes has a fix for the size and offset calculation for ARRAY of FLOAT32, uhashlib now raises an exception if a hash is reused after digest is called, and urandom supports passing 0 to getrandbits (following the CPython change). In uasyncio, the readinto method is added to the Stream class, and two race conditions were fixed: one with start_server and wait_closed, and the other with cancelling a task waiting on finished task; see de2e081260395f47d21bf39a97f3461df3d8b94f and 514bf1a1911ac9173a00820b7e09dfb387e6b941 respectively. The esp32 port now supports specifying FROZEN_MANIFEST with new CMake build system, has NeoPixel support on GPIO32 and GPIO33, network.LAN support in IDF v4.1 and above, and a new "reconnects" option in the WLAN STA interface to configure how many (if any) reconnection attempts are made if the WiFi goes down. Many features have been added to the mimxrt port, including: VFS filesystem support with internal flash storage, Pin, Pin.irq and ADC support, UART, SoftI2C and SoftSPI bus support, Timer and RTC classes, and floating point numbers. The rp2 port now has the machine.RTC class to configure the RTC, as well as new board definition files for SparkFun's Thing Plus RP2040 and Pro Micro boards. The stm32 port now supports static soft timers with a C-based callback, and mboot has been made more configurable, in particular the LEDs and reset mode selection can now be fully customised by a board. Two new boards have been added: VCC_GND_F407VE and VCC_GND_F407ZG. A bug fix was made to the SDIO driver to make sure DMA doesn't turn off mid-transfer; this affected WLAN operation when certain SPI buses were being used. See commit a96afae90f6e5d693173382561d06e583b0b5fa5 for details. Pin configuration of UART has been modified so pull-up is now configured only on RX and CTS, not TX and RTS; see 748339b28126e69fd2dc2778b2a182901d0a4693. The USB_VCP class has a new irq method to set a callback on USB data RX events. The Ethernet driver now supports low-power mode, and has a fix so the link status is reported correctly. On the zephyr port, scheduled callbacks are now run at idle REPL and during sleeps, and there is an initial ubluetooth module which supports BLE scanning and advertising. Configuration is provided for the nucleo_wb55rg board. What follows is a detailed list of changes, generated from the git commit history, and organised into sections. Thanks to everyone who contributed to this release! Main components =============== all: - rename mp_keyboard_interrupt to mp_sched_keyboard_interrupt - replace busses with buses py core: - objexcept: support errno attribute on OSError exceptions - add option to compile without any error messages at all - dynruntime.h: add mp_obj_get_array() function - profile: use mp_handle_pending() to raise pending exception - scheduler: add mp_sched_exception() to schedule a pending exception - scheduler: add optional port hook for when something is scheduled - runtime: remove commented-out code from mp_deinit() - scheduler: add missing MICROPY_WRAP_MP_SCHED_EXCEPTION usage - repl: filter private methods from tab completion - repl: enter four spaces when there are no matches - repl: refactor autocomplete to reduce nesting - repl: refactor autocomplete, extracting reusable parts - repl: autocomplete builtin modules - gc: make gc_lock_depth have a count per thread - mkenv.mk: don't emit info about BUILD_VERBOSE if it's set - objarray: prohibit comparison of mismatching types - objarray: implement more/less comparisons for array - objarray: use mp_obj_memoryview_init helper in mp_obj_new_memoryview - objarray: fix constructing a memoryview from a memoryview - nlraarch64: add underscore prefix to function symbols for Darwin ABI - nlrx64: correct the detection of Darwin ABI - asmx64: support use of top 8 regs in src_r64 argument - emitnative: fix x86-64 emitter to generate correct 8/16-bit stores - mkrules.cmake: add MPY_LIB_DIR and BOARD_DIR to makemanifest call - asmarm: use builtin func to flush I- and D-cache on ARM 7 archs - compile: raise an error on async with/for outside an async function - gc: access the list of root pointers in an asan-compatible way - repl: don't read past the end of import_str - builtinimport: change relative import's ValueError to ImportError - emitglue: always flush caches when assigning native ARM code - stackctrl: prevent unused-var warning when stack checking disabled - gc: only use no_sanitize_address attribute for GCC 4.8 and above extmod: - uasyncio: use .errno instead of .args[0] for OSError exceptions - remove old comments used for auto-doc generation - moductypes: remove double blank lines and debugging printf's - moductypes: replace numbers with macro constants - moductypes: fix size and offset calculation for ARRAY of FLOAT32 - moduhashlib: put hash obj in final state after digest is called - modurandom: add error message when getrandbits has bad value - modurandom: support an argument of bits=0 to getrandbits - uasyncio: fix start_server and wait_closed race condition - uasyncio: add readinto() method to Stream class - uasyncio: fix race with cancelled task waiting on finished task - nimble: remove TODO comment about notify_custom freeing om lib: - utils: remove unused PYEXEC_SWITCH_MODE from pyexec.h - utils: add ARM semihosting utility functions - lwip: switch to use GitHub mirror repo - mbedtls: switch to currently latest commit of LTS branch v2.16 drivers: - sdcard: add sleep_ms(1) delay in SDCard.readinto sync loop - cyw43/cyw43_ctrl: use new sdio enable API functions - cyw43/cywbt: add compile option for RF switch - cyw43/cywbt: remove hard-coded UART6 alternate function setting - display/ssd1306.py: add rotate method - display/ssd1306.py: add support for 72x40 displays mpy-cross: no changes specific to this component/port Support components ================== docs: - library/machine: specify initial machine.PWM class - library/machine: add machine.bootloader docs - esp8266: add note about simultaneous use of STA_IF and AP_IF - esp8266: add instructions on entering programming mode manually - esp8266: clarify limitations of SSL in esp8266 and fix typos - fix some spelling mistakes - pyboard: fix typo in pyb.Switch tutorial - esp32: add UART to quickref - esp32: add WDT to quickref - esp32: add SDCard to quickref - esp8266: add WDT to quickref - library: add initial API reference for rp2 module and its classes - library/rp2.rst: fix typo overriden->overridden - esp32: add APA106 to quickref - esp32: mention Signal in GPIO section of quickref - esp8266: mention Signal in GPIO section of quickref - esp8266: add SSD1306 to quickref and tutorial - library: clarify what type of algorithm is implemented in heapq - library: add a blank line to fix formatting for ussl docs - library/pyb.Pin.rst: update the arguments for Pin.init() - rp2: add skeleton docs for the rp2 port - library/machine.RTC.rst: document datetime method and fix ex code - esp32: document WLAN "reconnects" config option examples: no changes specific to this component/port tests: - use .errno instead of .args[0] for OSError exceptions - run-multitests.py: provide some convenient serial device shorcuts - multi_bluetooth: add performance test for gatt char writes - thread: make stress_create.py test run on esp32 - thread: make stress_aes.py test run on bare-metal ports - thread: make exc1,exit1,exit2,stacksize1,start1 tests run on rp2 - run-perfbench.py: fix native feature check - run-multitests.py: flush stdout for each line of trace output - run-tests.py: parallelize running tests by default - cpydiff: add test and workaround for function.__module__ attr - make float and framebuf tests skip or run on big-endian archs - extmod/btree_gc.py: close the database to avoid a memory leak - basics: split out literal tests that raise SyntaxWarning on CPy - run-multitests.py: allow to work without sys.stdout on target - multi_bluetooth/ble_gap_advertise.py: allow to work without set - unix: add ffi test for integer types - cpydiff: add test for array constructor with overflowing value - float: make bytes/bytearray construct tests work with obj repr C tools: - metrics.py: add rp2 port to table of ports that can be built - upip.py: use .errno instead of .args[0] for OSError exceptions - pyboard.py: support opening serial port in exclusive mode - gen-cpydiff.py: fix formatting of doc strings for new Black - makemanifest.py: show directory name if there is a FreezeError - mpy_ld.py: support R_X86_64_GOTPCREL reloc for x86-64 arch - pydfu.py: remove default VID/PID values - ci.sh: update zephyr docker image to v0.17.3 - ci.sh: use FROZEN_MANIFEST in an esp32 build to test feature - mpy-tool.py: support relocating ARMv6 arch - tinytest-codegen.py: add command-line option to exclude tests - ci.sh: build Cortex-A9 sabrelite board as part of qemu-arm CI - pyboard.py: track raw REPL state via in_raw_repl variable - pyboard.py: add "soft_reset" option to Pyboard.enter_raw_repl() - mpremote: add new CLI utility to interact with remote device - ci.sh: build mpy-cross as part of ci_mimxrt_build - mpremote: use available ports instead of auto-connect list - mpremote: use signal to capture and handle ctrl-C on Windows CI: - workflows: add CI workflow for mimxrt port - workflows: add workflow to build and run unix port on MIPS - workflows: add workflow to build and run unix port on ARM The ports ========= bare-arm port: - switch to use MICROPY_ERROR_REPORTING_NONE to reduce size cc3200 port: no changes specific to this component/port esp8266 port: - modnetwork: use mp_handle_pending() to raise pending exception - boards/GENERIC_512K: add custom manifest without FS modules - update manifest to point to new dirs in micropython-lib - boards/GENERIC_512K: add custom minimal _boot.py esp32 port: - CMakeLists.txt: require CMake version 3.12 - restore FROZEN_MANIFEST support with new CMake build system - esp32_rmt: clear config struct before filling it out - mpthreadport: don't explicitly free thread struct in TCB cleanup - mpthreadport: use binary semaphore instead of mutex - extend support for S2 series, and S3 where applicable - boards: rename TINYPICO board to UM_TINYPICO - boards: add UM_FEATHERS2 and UM_TINYS2 board definitions - boards/UM_TINYPICO: fix include of sdkconfig fragment - machine_i2c: allow boards to configure I2C pins using new macros - boards: set default I2C and SPI pins on UM_xxx boards - boards: fix spelling mistakes in comments for UM_xxx boards - update manifest to point to new dirs in micropython-lib - boards: add M5STACK_ATOM board definition - espneopixel: add support for GPIO32 and GPIO33 - Makefile: fix wrong target for partition-table.bin - makeimg.py: load sizes from partition table and verify data fits - partitions-2MiB.csv: update table so firmware fits - README: describe how to select compatible version of existing IDF - network_lan: add Ethernet support for IDF v4.1 and above - modnetwork: add "reconnects" option to WLAN STA interface - machine_hw_spi: allow None for unused pins in initializer - machine_sdcard: use deinit_p to deinit SD bus in SPI mode javascript port: no changes specific to this component/port mimxrt port: - improve ticks and sleep functions using GPT - implement machine.Pin class - enable built-in help - extend the Pin module for SoftI2C, SoftSPI support - add custom help text and enable help("modules") - enable frozen modules - add flash storage support with VFS and littlefs filesystem - boards/TEENSY40: re-create the flash FS after deploy - add the Timer class to the machine module - remove __WFE() from MICROPY_EVENT_POLL_HOOK - machine_timer: reuse any existing timer objects - machine_timer: leave the Timer clock source at IPG clock - machine_rtc: add the RTC class to the machine module - add floating point support - enable many Python and some extmod features - machine_adc: add the ADC class to the machine module - boards: add board configuration files for Teensy 4.1 - machine_rtc: change RTC.datetime() tuple to match other ports - machine_rtc: maintain microsecond offset - machine_uart: add the UART class to the machine module - machine_pin: implement pin.irq() functionality - modutime: extend the time module minimal port: no changes specific to this component/port nrf port: - boards/microbit: use mp_sched_exception() where appropriate - add machine.memXX, and allow boards to customise some features - boards: add support for evk_nina_b3 board - add more math sources to Makefile, and enable log2 implementation pic16bit port: - Makefile: make the XC compiler version user-configurable powerpc port: no changes specific to this component/port qemu-arm port: - add support for Cortex-A9 via sabrelite board rp2 port: - boards: add board definition for SparkFun Thing Plus RP2040 - boards: add board definition for SparkFun Pro Micro board - tusb_port: add the device unique-id to the USB id - move manifest.py to boards directory - mpthreadport: add mp_thread_deinit to reset core1 on soft reset - CMakeLists.txt: include tinyusb_common in PICO_SDK_COMPONENTS - machine_rtc: add initial support for RTC - machine_rtc: check return value from rtc_set_datetime samd port: no changes specific to this component/port stm32 port: - boards/pllvalues.py: support wider range of PLL values for F413 - machine_timer: improve usability of Timer constructor and init - mboot: allow unpacking dfu without secret key - correct typos in project README files - uart: fix H7 UART clock source configuration - softtimer: add support for having a C-based callback - softtimer: support static soft timer instances - boardctrl: add constants for reset mode values - boardctrl: show first reset-mode state on LEDs when selecting - mboot: allow a board to add source files to the build - adc: allow mboot to use basic ADC functions - mboot: fix mp_hal_delay_us() and add mp_hal_ticks_ms() - mboot: allow a board to customise the linker scripts - mboot: allow mboot to be placed at any location in flash - sdcard: allow configuring the SDMMC periph used for SD/MMC card - uart: enable HW flow control for UART 1/5/7/8 - sdio: add functions to re/enable SDIO/SDIOIT - boards/PYBD_SF2: enable RF switch compile option - sdio: allow configuring the SDMMC periph used for SDIO - boards: change default LSI_VALUE to 32000 for F4 MCUs - powerctrl: add MICROPY_HW_ENTER_BOOTLOADER_VIA_RESET option - boardctrl: adjust logic for running boot.py, main.py - mboot: add MBOOT_LEAVE_BOOTLOADER_VIA_RESET option - mboot: make LEDs and reset-mode selection more configurable - boards: add VCC_GND_F407VE board - boards: add VCC_GND_F407ZG board - sdio: fix case of SDIO DMA turning off mid transfer - uart: configure pull-up only on RX and CTS, not TX and RTS - mboot: leave bootloader from thread mode, not from IRQ - boards/NUCLEO_L432KC: fix FS size and enable LFS1 filesystem - boards/PYBD_SF2: disable GCC 11 warnings for array bounds - usb: add USB_VCP.irq method, to set a callback on USB data RX - boards: enable MICROPY_HW_SPIFLASH_ENABLE_CACHE on VCC_GND boards - sdram: prevent array-bounds warnings with GCC 11 - eth: add low-power mode configuration option - eth: fix eth_link_status function to use correct BSR bit teensy port: - provide own implementation of gc_collect, to not use stm32 - correct typos in project README files unix port: - modffi: use a union for passing/returning FFI values - main: increase stack limit on ARM architectures - modffi: fix conversion between Python integers and ffi types - fix build on arm64-darwin due to integer cast windows port: - mpconfigport.h: enable features also present in unix port zephyr port: - run scheduled callbacks at REPL and during mp_hal_delay_ms - modmachine: add machine.idle() - boards: add config for nucleo_wb55rg board - update disk access configuration for Zephyr v2.6.0 - disable CONFIG_NET_SOCKETS_POSIX_NAMES - update to Zephyr v2.6.0 - add initial ubluetooth module integration - boards: enable ubluetooth on nucleo_wb55rg board ======== Mon, 19 Apr 2021 00:11:51 +1000 v1.15 The esp32 port moves to CMake and has S2 support, new features for rp2 This release of MicroPython adds general support in the core for using CMake as a build system. The rp2 port is consolidated to use the new CMake files, and the esp32 and zephyr ports have switched to build as pure CMake projects. These three ports have SDKs which are built around CMake and this change should make them easier to maintain and use. As part of this work, CMake based ports now have support for user C modules. Authors of user C modules should now provide both .mk and .cmake configuration files (following the documentation and examples). A bug was fixed in the multiple precision integer library, an arithmetic overflow in the long division routine. Prior to this fix certain integer divisions would take excessive time and produce incorrect results. See commit 0a59938574502b19b3d685133084399c090d3c11 for details. There was also a fix for regular expressions, to check and report byte overflow errors when compiling expressions. See commit 172fb5230a3943eeb6fbbb4de1dc56b16e2a7637. In the uasyncio library, a new MicroPython extension has been added, ThreadSafeFlag, which can be set from outside the asyncio event loop, such as other threads, IRQs or scheduler context. It allows preemptive code like IRQs to signal asyncio tasks, which are by nature cooperative (non-preemptive). asyncio.current_task() has also been added, with the same semantics as CPython. As mentioned above, the esp32 port has switched to a full CMake-based project, and traditional make capability has been removed (although a simple helper Makefile remains to keep top-level build/deploy commands consistent with other ports). Because of the move to CMake, network.LAN support has been removed, to be added back in the future (use a prior release if LAN is needed). Basic support for Non-Volatile-Storage is added to the esp32 module. And there is also preliminary support for ESP32S2 SoCs and USB, with a GENERIC_S2 board defined. On the mimxrt and samd ports, USB CDC TX handling has been fixed so that it now works reliably. The rp2 port has had many more core Python features enabled, along with the enabling of ubinascii.crc32(), the uos.VfsFat and machine.Signal classes, and the uerrno module. uos.urandom() has been added and machine.freq() can now change the CPU clock frequency. The machine.UART class now has support for timeout/timeout_char, inverted TX/RX lines, and buffered TX/RX with configurable sized buffers. For PIO, StateMachine has added restart(), rx_fifo() and tx_fifo() helper functions, and support for FIFO joining. There is now support for user C modules (via CMake) and for building different board configurations (the default remains the PICO board). USB reliability has been improved. For the stm32 port, there is now more configuration options for boards, such as USBD VID/PID and fine-grained selection of modules. The UART class now supports LPUART on L0, L4, H7 and WB MCUs. WB MCUs have a fix for a race condition accessing the BLE ACL free buffer list, and a workaround for a low-level BLE bug. The zephyr port has been updated to use zephyr v2.5.0, and now builds MicroPython as a CMake target. What follows is a detailed list of changes, generated from the git commit history, and organised into sections. Main components =============== all: - rename BYTES_PER_WORD to MP_BYTES_PER_OBJ_WORD - add .git-blame-ignore-revs for fixing up git blame output py core: - gc: don't include mpconfig.h and misc.h in gc.h - remove BITS_PER_WORD definition - rename BITS_PER_BYTE to MP_BITS_PER_BYTE - rename WORD_MSBIT_HIGH to MP_OBJ_WORD_MSBIT_HIGH - gc: change include of stdint.h to stddef.h - mpz: fix overflow of borrow in mpn_div - add core cmake rule files - expand lists in core cmake custom commands - mkrules.cmake: rename QSTR_DEFS variables to QSTRDEFS - mkrules.cmake: add MICROPY_QSTRDEFS_PORT to qstr build process - nlr: implement NLR for AArch64 - nlrx64: fix typo in comment - vm: for tracing use mp_printf, and print state when thread enabled - rename remaining object types to be of the form mp_type_xxx - py.cmake: move qstr helper code to micropy_gather_target_properties - py.cmake: introduce MICROPY_INC_CORE as a list with core includes - profile: resolve name collision with STATIC unset - runtime: make sys.modules preallocate to a configurable size extmod: - vfs_posix_file: allow closing an already closed file - btstack: add HCI trace debugging option in btstack_hci_uart - btstack: add stub functions for passkey, l2cap bindings - btstack: enable SYNC_EVENTS, PAIRING_BONDING by default - uasyncio: add asyncio.current_task() - add core cmake rule files - nimble: ensure handle is set on read error - moduselect: fix unsigned/signed comparison for timeout!=-1 - uasyncio: add ThreadSafeFlag - nimble/hal/hal_uart: fix HCI_TRACE format specifiers - modbluetooth: allow NimBLE to use Zephyr static address - modussl: fix ussl read/recv/send/write errors when non-blocking - btstack: use MICROPY_HW_BLE_UART_BAUDRATE for first UART init - modbluetooth: separate enabling of "client" from "central" - extmod.cmake: add modonewire.c to MICROPY_SOURCE_EXTMOD list - modbluetooth: free temp arrays in gatts register services - re1.5: check and report byte overflow errors in _compilecode - extmod.cmake: add support to build btree module with CMake lib: - tinyusb: update to version 0.8.0 - mbedtls: switch to currently latest commit of LTS branch v2.16 - utils/gchelper_generic: implement AArch64 support - pico-sdk: update to latest version 1.1.0 drivers: no changes specific to this component/port mpy-cross: no changes specific to this component/port Support components ================== docs: - library/uasyncio.rst: add docs for ThreadSafeFlag - develop/cmodules.rst: document C-modules and micropython.cmake - develop: improve user C modules to properly describe how to build examples: - usercmodule: add micropython.cmake to the C and CPP examples - usercmodules: simplify user C module enabling - embedding: fix example so it compiles again tests: - extmod/vfs_posix.py: add more tests for VfsPosix class - extmod: add test for ThreadSafeFlag - multi_bluetooth: add basic performance tests - rename run-tests to run-tests.py for consistency - run-tests.py: reformat with Black - multi_bluetooth: skip tests when BLE features are unsupported - extmod/vfs_fat_fileio2.py: close test file at end of test - run-tests.py: provide more info if script run via pyboard crashes - feature_check: check for lack of pass result rather than failure - net_inet: add 'Strict-Transport-Security' to exp file tools: - add filesystem action examples to pyboard.py help - ci.sh: change esp32 CI to work with idf.py and IDF v4.0.2 - makemanifest.py: allow passing option args to include() - ci.sh: update zephyr docker image to v0.11.13 - verifygitlog.py: show required format regexp in error message - pydfu.py: support DFU files with elements of zero size - ci.sh: add CI for CMake USER_C_MODULE support - ci.sh: build user C modules for esp32 - metrics.py: fix esp32 output filename due to move to CMake - ci.sh: build esp32 using IDF v4.0.2 and v4.3 The ports ========= all ports: - remove def of MP_PLAT_PRINT_STRN if it's the same as the default - update to build with new tinyusb bare-arm port: - clean up the code, make it run on an F405, and add a README cc3200 port: no changes specific to this component/port esp8266 port: - modules: fix fs_corrupted() to use start_sec not START_SEC esp32 port: - add support to build using IDF with cmake - esp32_rmt: don't do unnecessary check for unsigned less than zero - add explicit initialisers to silence compiler warnings - remove traditional "make" capability - boards: remove old IDF v3 sdkconfig values - boards: enable BLE on all boards - README: update based on new IDF v4 cmake build process - add support to build with ESP-IDF v4.1.1 - add support to build with ESP-IDF v4.2 - remove obsolete IDF v3 code wrapped in MICROPY_ESP_IDF_4 - modsocket: remove unix socket error code translation - set MICROPY_USE_INTERNAL_ERRNO=0 to use toolchain's errno.h - boards: enable size optimisation for builds - add support to build with ESP-IDF v4.3 pre-release - add basic support for Non-Volatile-Storage in esp32 module - make machine.soft_reset() work in main.py and reset_cause() - define MICROPY_QSTRDEFS_PORT to include special qstrs - Makefile: specify port and baud on erase_flash command - machine_hw_spi: use default pins when making SPI if none given - restore USER_C_MODULE support with new CMake build system - fix multiple definition errors with mp_hal_stdout_tx functions - enable btree module - modsocket: correctly handle poll/read of unconnected TCP socket - add initial support for ESP32S2 SoCs - add support for USB with CDC ACM - boards: add GENERIC_S2 board definition - machine_pin: use rtc_gpio_deinit instead of gpio_reset_pin javascript port: no changes specific to this component/port mimxrt port: - fix USB CDC handling so it works reliably - boards: add MIMXRT1050_EVK board, based on MIMXRT1060_EVK - enable CPYTHON_COMPAT, PY_ASYNC_AWAIT, PY_ATTRTUPLE options minimal port: no changes specific to this component/port nrf port: - drivers/usb: add USBD_IRQHandler which calls tud_int_handler pic16bit port: no changes specific to this component/port powerpc port: no changes specific to this component/port qemu-arm port: no changes specific to this component/port rp2 port: - machine_adc: only initialise the ADC periph if not already enabled - micropy_rules.cmake: fix makemoduledefs vpath to work with abs path - use local tinyusb instead of the one in pico-sdk - enable MICROPY_PY_UBINASCII_CRC32 to get ubinascii.crc32() - enable VfsFat class for FAT filesystem support - machine_uart: add timeout/timeout_char to read and write - machine_uart: add support for inverted TX and RX lines - rp2_pio: allow more than 8 consecutive pins for PIO out/set/sideset - rp2_pio: fix sm.get(buf) to not wait after getting last item - modmachine: allow changing CPU clock frequency - modmachine: re-init UART for REPL on frequency change - rp2_flash: prevent MICROPY_HW_FLASH_STORAGE_BASE being set negative - enable uerrno module - enabled more core Python features - modmachine: enable machine.Signal class - use core-provided cmake fragments instead of custom ones - mpthreadport.h: cast core_state to _mp_state_thread_t - add support for USER_C_MODULES to CMake build system - don't advertise remote wakeup for USB serial - CMakeLists.txt: enable USB enumeration fix - import uarray instead of array in rp2 module - rp2_pio: validate state machine frequency in constructor - moduos: implement uos.urandom() - rp2_pio: add StateMachine restart,rx_fifo,tx_fifo helper functions - machine_uart: add buffered transfer of data with rxbuf/txbuf kwargs - add support for building different board configurations - rp2_pio: add fifo_join support for PIO samd port: - mphalport: fix USB CDC tx handling to work reliably stm32 port: - uart: add uart_set_baudrate function - mpbthciport: only init the uart once, then use uart_set_baudrate - mboot: add unpack-dfu command to mboot_pack_dfu.py tool - usb: allow a board to configure USBD_VID and all PIDs - make pyb, uos, utime, machine and onewire modules configurable - boards: disable onewire module on boards with small flash - mpbthciport: fix initial baudrate to use provided value - mpbthciport: use mp_printf instead of printf for error message - mpbtstackport: allow chipset and secondary baudrate to be set - mboot: after sig verify, only write firmware-head if latter valid - uart: add support for LPUART1 on L0, L4, H7 and WB MCUs - boards/NUCLEO_WB55: enable LPUART1 on PA2/PA3 - enable MICROPY_PY_UBINASCII_CRC32 to get ubinascii.crc32() - rfcore: allow BLE settings to be changed by a board - storage: prevent attempts to read/write invalid block addresses - make-stmconst.py: allow "[]" chars when parsing source comments - main: fix passing state.reset_mode to init_flash_fs - powerctrl: save and restore EWUP state when configuring standby - spi: fix baudrate calculation for H7 series - boardctrl: add MICROPY_BOARD_STARTUP hook - Makefile: fix C++ linker flags when toolchain has spaces in path - Makefile: allow QSTR_DEFS,QSTR_GLOBAL_DEPENDENCIES to be extended - include .ARM section in firmware for C++ exception handling - powerctrl: allow a board to configure AHB and APB clock dividers - powerctrl: support using PLLI2C on STM32F413 as USB clock source - boards/pllvalues.py: relax PLLQ constraints on STM32F413 MCUs - mpconfigport.h: add support for a board to specify root pointers - boardctrl: give boards control over execution of boot.py,main.py - boards/NUCLEO_L476RG: add 5 remaining UARTs - rfcore: fix race condition with C2 accessing free buffer list - rfcore: intercept addr-resolution HCI cmd to work around BLE bug - boards: split UARTx_RTS_DE into UARTx_RTS/UARTx_DE in pin defs - uart: use LL_USART_GetBaudRate to compute baudrate - sdram: make MICROPY_HW_FMC_BA1,MICROPY_HW_FMC_A11 optional pins teensy port: no changes specific to this component/port unix port: - mpbtstackport_common: implement mp_bluetooth_hci_active - moduselect: don't allow both posix and non-posix configurations - improve command line argument processing - main: make static variable that's potentially clobbered by longjmp windows port: no changes specific to this component/port zephyr port: - update to zephyr v2.5.0 - disable frozen source modules - remove unused build files - build MicroPython as a cmake target - boards: add support for the nucleo_h743zi board - modusocket: fix parameter in calls to net_context_get_XXX() ======== Wed, 3 Feb 2021 00:59:07 +1100 v1.14 New rp2 port, BLE pairing, bonding and l2cap APIs, and docs on internals This release of MicroPython sees the addition of a new "rp2" port for the new Raspberry Pi RP2040 microcontroller, a dual-core Cortex-M0+ MCU with programmable IO. This port is built on the pico-sdk and MicroPython sits very close to the bare metal. The programmable IO is supported via the @rp2.asm_pio decorator which allows writing inline assembler to be run on the PIO state machines. The ubluetooth module has seen significant improvements, fixes and additions. BLE events are now synchronous on unix and stm32 so that user Python callbacks are called directly from the BLE stack (from NimBLE). This helps with the new pairing and bonding API. There is also a new l2cap API for much faster raw data transfer between BLE devices. Many new sections have been added to the existing "Developing and building MicroPython" chapter to make it all about the internals of MicroPython, including details about the MicroPython compiler, and how to port to a new system. This documentation work was done as part of Google's Season of Docs 2020. The native emitter and inline assembler now fully support ARMv6M, for Cortex-M0+ CPUs. There is also support added for C++ user modules on unix, stm32 and esp32. And reproducible builds can now be achieved by setting SOURCE_DATE_EPOCH in the shell build environment. Qstr preprocessing is now done in parallel to speed up building, and there is a new tools/ci.sh script with all functionality to run the continuous integration tests. The machine.I2C and machine.SPI classes have been modified so they no longer construct both software- and hardware-based peripheral instances. Such construction is now split to explicit soft and non-soft types by the introduction of machine.SoftI2C and machine.SoftSPI classes. See below for more information. The wait_for function in uasyncio now handles cancellation correctly, VfsLfs supports mounting in read-only mode, and the urandom module will randomise its seed on import on stm32, esp8266, esp32 and rp2 ports. A new raw-paste mode is added to the REPL which includes flow control between the device and host, as well as a mechanism where the device pulls in data from the host as it parses the input. This makes pasting code faster, more reliable and use less memory. This feature is supported on all ports that have a raw REPL and still supports previous REPL behaviour. See the documentation for more detail on this raw-paste mode. The stm32 port sees improved rfcore support for WB MCUs, including flash locking for writes when BLE is active, and a script for automatic update of FUS/WS firmware. New hooks are added for boards to configure the top level behaviour of the system in stm32_main, and there is now support for Ethernet on H7 processors. Mboot now allows signed and encrypted firmware updates. Breaking changes in this release are: - The "sys" module is renamed to "usys". Ports that do not enable module weak links must replace "import sys" with "import usys as sys". See commit 40ad8f1666b265dafc7844d765f45cfae4b6299f - machine.I2C and machine.SPI constructors are changed when using software-based I2C and SPI. Code that constructed I2C/SPI peripherals in the following way will need to be changed (or else their use will emit a warning which will eventually be an error): machine.I2C(-1, ...) -> machine.SoftI2C(...) machine.I2C(scl=scl, sda=sda) -> machine.SoftI2C(scl=scl, sda=sda) machine.SPI(-1, ...) -> machine.SoftSPI(...) machine.SPI(sck=sck, mosi=mosi, miso=miso) -> machine.SoftSPI(sck=sck, mosi=mosi, miso=miso) Code which uses machine.I2C and machine.SPI classes to access hardware peripherals does not need to change. See commits 39d50d129ce428858332523548f0594503d0f45b and 98182a97c5a9229938406beb722966eacceeb823 - In ubluetooth, the BLE.irq() method now has positional only arguments. See commit 6a6a5f9e151473bdcc1d14725d680691ff665a82 - In ubluetooth, arguments passed to the BLE.irq() callback that were previously bytes objects are now memoryview objects. See commit 81f2162ca0e926c9a4a1787a3863d94d86be0b36 What follows is a detailed list of changes, generated from the git commit history, and organised into sections. Main components =============== all: - rename "sys" module to "usys" - rename absolute time-based functions to include "epoch" py core: - objfloat: fix handling of negative float to power of nan - fix handling of NaN in certain pow implementations - showbc: pass in an mp_print_t struct to all bytecode-print functions - parse: pass in an mp_print_t to mp_parse_node_print - dynruntime.h: add mp_import_* and mp_load/store_* - objstr: make bytes(bytes_obj) return bytes_obj - objarray.h: add mp_obj_memoryview_init() helper function - makeversionhdr.py: match only git tags which look like versions - parse: expose rule-name printing as MICROPY_DEBUG_PARSE_RULE_NAME - objdict: add mp_const_empty_dict_obj, use it for mp_const_empty_map - objtype: handle __dict__ attribute when type has no locals - scope: name and use id_kind_type_t - objexcept: compare mp_emergency_exception_buf_size signed - use unsigned comparison of chars - add explicit initializers for default values - vmentrytable: ignore GCC -Woverride-init - introduce and use MP_FALLTHROUGH macro - makeqstrdefs.py: fix beaviour when scanning non-C preprocessed files - makeqstrdefs.py: process C++ files as well - mkrules.mk: add target for compiling C++ files - makeqstrdefs.py: support preprocessing C++ files for QSTR generation - workaround clang error when building misc.h with C++ compiler - py.mk: support C++ code for user C modules - mpz: do sign extension in mpz_as_bytes for negative values - binary: fix sign extension setting wide integer on 32-bit archs - mpprint: prevent case fall-through when assert is disabled - mpprint: fix length calculation for strings with precision-modifier - modmath: simplify handling of positional args to reduce code size - mkrules.mk: remove stray vpath and unused -Itmp, add $(Q) for $(AR) - objfun: support fun.__globals__ attribute - asmthumb: add support for ARMv6M in native emitter - emitnative: ensure encoding to load prelude_offset doesn't change sz - emitinlinethumb: exclude code using #if when ARMV7M disabled - emitnative: support binary ops on ARMv6M without use of ite instr - qstr.h: remove QSTR_FROM_STR_STATIC macro - gc: fix debug printing of pointer - persistentcode: introduce MICROPY_PERSISTENT_CODE_SAVE_FILE option - makeversionhdr: honor SOURCE_DATE_EPOCH if present extmod: - modbluetooth: rename logging macro to be just DEBUG_printf - modbluetooth: refactor stack/hci/driver/port bindings - nimble: set struct alignment correctly on 64-bit arch - nimble: make nimble_malloc work with allocated size - nimble: implement NimBLE mutex - modbluetooth: implement configuration of address modes - modbluetooth: allow using mp_hal_get_mac as a static address - btstack: add btstack support for _IRQ_GATTS_READ_REQUEST - btstack: detect HCI UART init failure - nimble: add timeout for HCI sync on startup - modussl_axtls: reduce size of code that makes exception - modbluetooth: fix handling of optional data/uuid args - modbluetooth: make BLE.irq() method positional only - modbluetooth: print UUIDs correctly - modbluetooth: implement MTU - vfs: fix lookup of entry in root dir so it fails correctly - modbluetooth: change module-owned bytes objects to memoryview - modure: allow \\ in re.sub replacements - machine_i2c: rename type to SoftI2C and add custom print method - machine_i2c: remove "id" arg in SoftI2C constructor - machine_spi: remove "id" arg in SoftSPI constructor - utime_mphal: add generic utime.time_ns() function - add explicit initializers for default values - disable -Wmissing-field-initializers for lfs2 - introduce and use MP_FALLTHROUGH macro - vfs_lfs: support mounting LFS filesystems in read-only mode - modurandom: support urandom.seed() without an argument - btstack/btstack.mk: add -Wimplicit-fallthrough=0 - nimble/nimble.mk: add -Wno-old-style-declaration - moductypes: fix storing to (U)INT64 arrays on 32-bit archs - machine_mem: only allow integers in machine.memX subscript - modbluetooth: make UUID type accessible outside modbluetooth.c - modbluetooth: combine gattc-data-available callbacks into one - nimble: poll startup directly rather than using NimBLE sem - modbluetooth: re-instate optional no-ringbuf modbluetooth - nimble: make stm32 and unix NimBLE ports use synchronous events - machine_i2c: add init protocol method for generic I2C bindings - modbluetooth: add API for L2CAP channels - nimble/modbluetooth_nimble: fix build when l2cap unavailable - uasyncio: delay calling Loop.call_exception_handler by 1 loop - uasyncio: add Task.done() method - uasyncio: fix cancellation handling of wait_for - nimble: fail read if the characteristic is too big - modbluetooth: add _IRQ_CONNECTION_UPDATE event - modbluetooth: allow setting char/desc enc/auth options - modbluetooth: allow user-specified reason in read request IRQ - modbluetooth: add compile-config flag to enable pairing/bonding - modbluetooth: add _IRQ_ENCRYPTION_UPDATE event - modbluetooth: allow configuration of pairing/bonding parameters - modbluetooth: add gap_pair(conn_handle) func to intiate pairing - modbluetooth: add support for bonding (key persistence) - modbluetooth: simplify synchronous invoke_irq_handler signature - modbluetooth: add support for passkey authentication - nimble: generate and persist a unique IRK - modubinascii: update code, docs for hexlify now CPython has sep - vfs: raise OSError(ENODEV) if mounting bdev without a filesystem - nimble: reset NimBLE BSS in mp_bluetooth_init - nimble: don't assert on save-IRK failure - modbluetooth: add ble.hci_cmd(ogf, ocf, req, resp) function - vfs: check block 0 and 1 when auto-detecting littlefs - modframebuf: change int to unsigned int in format methods args - modonewire: use pin_od_high/pin_od_low instead of pin_write - nimble: improve the flow control for l2cap recv path lib: - libm: reduce size of static two_over_pi array - utils/mpirq: add mp_irq_init func, and clean up unused init method - utils/pyexec: add MICROPY_BOARD hooks before/after executing code - utils/pyexec: add stdin-reader on raw REPL with flow control - littlefs: update littlefs2 to v2.3.0 - littlefs: guard lfs2_mlist_isopen with LFS2_NO_ASSERT - stm32lib: update library for WB v1.10.0 - libhydrogen: add new libhydrogen submodule - timeutils: provide simple impl of extra funcs when Epoch is 1970 - pico-sdk: add new pico-sdk submodule, for the rp2 port - utils/pyexec: remove obsolete LCD initialization - pico-sdk: update to latest version v1.0.1 drivers: - memory/spiflash: add MICROPY_HW_SPIFLASH_ENABLE_CACHE option mpy-cross: - enable more warnings Support components ================== docs: - library/ubluetooth.rst: document BLE address modes - library/ubluetooth.rst: clarify position/kw arguments - library/ubluetooth.rst: clarify peripheral/central vs server/client - library/ubluetooth.rst: add docs for MTU API - develop: add notes on prerequisite tools for building native .mpy - reference/packages.rst: fix typo, remove duplicate "port" - update I2C and SPI docs to add reference to SoftI2C and SoftSPI - library/btree.rst: correct method typo: __detitem__ to __delitem__ - library/machine.rst: correct minor typo: timout to timeout - library/machine.Signal.rst: correct typo: usecases to use cases - library/machine.Timer.rst: add mention of constructor arguments - reference/glossary.rst: fix minor grammar error, An -> A - fix reference to QSTR_GEN_CFLAGS Makefile flag - develop/cmodules.rst: add link to source code for user C example - library/ubluetooth.rst: add docs for L2CAP channels - reference/repl.rst: add information about new raw-paste mode - library/ubluetooth.rst: add _IRQ_CONNECTION_UDPATE docs - library/ubluetooth.rst: update char/desc flags - library/ubluetooth.rst: update read request IRQ docs - library/ubluetooth.rst: add pairing/bonding config docs - library/ubluetooth.rst: add gap_pair() docs - library/ubluetooth.rst: add bonding docs - library/ubluetooth.rst: add passkey docs - develop: add MicroPython Internals chapter - fix minor typos in RTC docs, and->an - esp8266/quickref: add warning block about NeoPixel timing - develop/natmod: fix a small typo, con->can - update copyright year range to include 2021 examples: - bluetooth: update to use positional-only args to irq() - add example code for user C modules, both C and C++ - bluetooth: add bonding/passkey demo - rp2: add pio_uart_rx.py example tests: - multi_bluetooth: update to new config('mac') behaviour - multi_bluetooth: make ble_gap_connect robust against event timing - multi_bluetooth: update UUID format in .exp files - run-multitests.py: show test/truth diff - multi_bluetooth/ble_mtu.py: add multitest for BLE MTU - basics: enable == and != special-method tests now that they work - basics: add test for MICROPY_PY_ALL_INPLACE_SPECIAL_METHODS ops - run-tests: use -BS flags when running CPython - thread/stress_schedule.py: assign globals before running test - micropython/extreme_exc.py: unlink alloc'd lists earlier in chain - run-multitests.py: fix diff order, show changes relative to truth - multi_bluetooth: improve reliability of event waiting - run-multitests.py: add a -p flag to run permutations of instances - multi_bluetooth: change dict index-and-del to pop, to clear event - multi_bluetooth: add a test for WB55 concurrent flash access - multi_bluetooth: add L2CAP channels multi-test - extmod: add vfs_posix.py test for uos.VfsPosix class - run-tests: update skipped tests on CI for GitHub Actions - multi_bluetooth: add multitests for BLE pairing and bonding - misc/sys_settrace_features.py: ignore CPython zipimport traces - extmod: add test to try and mount a block device directly - misc/sys_settrace: make test output independent of invoked path - misc/sys_settrace_features.py: fix running with non-dflt encoding - extmod: add test for the precision of utime functions - move native for test from pybnative to micropython - extmod/utime_time_ns.py: relax bounds on time_ns measurement - run-tests: change default Python command used on Windows tools: - mpy-tool.py: fix merge of multiple mpy files to POP_TOP correctly - write msvc-compatible frozen content - upip.py: support explicit port number in host - makeqstrdefs.py: run qstr preprocessing in parallel - ci.sh: add helper script to run CI tasks - pyboard.py: add fast raw-paste mode - ci.sh: put echo of CI path in a separate function - ci.sh: use pip-install to get latest version of esptool.py - ci.sh: pip install pyhy for stm32 builds - ci.sh: for code size build, fetch history of master branch only - ci.sh: for ci_code_size_setup, update apt to install gcc-multilib - mpy-tool.py: list frozen modules in MICROPY_FROZEN_LIST_ITEM - verifygitlog.py: add script for verifying commit message format - makemanifest.py: add check that freeze path is a directory - remove obsolete upip bootstrap script CI: - install setuptools for black code formatting - update zephyr build to v2.4.0 - stop using Travis for CI - workflows: add workflows for all CI tasks, builds and tests - workflows: run unix and qemu-arm workflows when tests change - workflows: fix code-size CI workflow - workflows: add CI workflow for rp2 port - workflows: add workflow to verify commit message format - workflows/ports_unix.yml: add job for a reproducible build The ports ========= all ports: - add utime.gmtime() function - add SoftI2C and SoftSPI to machine module where appropriate - support legacy soft I2C/SPI construction via id=-1 arg - use correct in/out endpoint size in TUD_CDC_DESCRIPTOR cc3200 port: - ftp: add quotes to PWD response and allow FEAT prior to login - fix debug build esp8266 port: - remove release-specific manifest, disable osdebug by default - mpconfigport.h: seed the urandom module on import - remove "FAT" from warning message in inisetup.py - modules/neopixel.py: add timing param to NeoPixel constructor esp32 port: - pin MicroPython and NimBLE tasks to core 0 - mpconfigport.h: remove duplicate uhashlib registration - boards/sdkconfig.base: set default IDF log level to ERROR - modnetwork: re-enable PPP support for IDF-SDK >=v4 - use path relative to root for netutils/timeutils headers - mpconfigport.h: enable MICROPY_PY_DELATTR_SETATTR - mpconfigport.h: seed the urandom module on import - support building C++ code - machine_pin: reset pin if init sets mode - remove "FAT" from warning message in inisetup.py - modnetwork: synchronize WiFi AUTH_xxx constants with IDF values javascript port: no changes specific to this component/port mimxrt port: - boards: add MIMXRT1064_EVK board minimal port: no changes specific to this component/port nrf port: - main: make mp_builtin_open signature match that in py/builtin.h - remove unnecessary includes of mpconfigport.h and its header guard - README: describe Pin numbering scheme for nRF52840 - boards: update memory.ld to include bootloader offsets - Makefile: add bootloader specific section - Makefile: add support for flashing with nrfutil - boards: add linker script for nrf52840 Open Bootloader 1.2.0 - change selected boards to utilize pre-flashed bootloader - README: add use of "make submodules" in alternative build paragraph pic16bit port: no changes specific to this component/port powerpc port: no changes specific to this component/port qemu-arm port: no changes specific to this component/port rp2 port: - add new port to Raspberry Pi RP2 microcontroller - machine_pin: change N_GPIOS to NUM_BANK0_GPIOS for pico-sdk compat - memmap_mp.ld: update for latest SDK - rp2_pio: add JMP PIN support for PIO - modmachine: implement additional functions incl unique_id and idle samd port: no changes specific to this component/port stm32 port: - mpconfigport.h: enable MICROPY_PY_REVERSE_SPECIAL_METHODS - uart: allow static IRQ handler registration - modbluetooth_hci: use a static mp_irq_obj_t for BT HCI UART IRQ - mpbthciport: increase char timeout of BT HCI UART - make-stmconst.py: add support for WB55 header files - rfcore: update rfcore.c to match how ST examples work - boards/USBDONGLE_WB55: add USE_MBOOT support - powerctrlboot: acquire HSEM5 on STM32WB during SystemClock_Config - rfcore: fix length matching in HCI parser - rfcore: refactor some helper funcs, and remove some magic numbers - rfcore: enable RX IRQ on BLE IPCC channel for better performance - boards/NUCLEO_WB55: add Python helper code for rfcore - usb: don't nul pyb_hid_report_desc if MICROPY_HW_USB_HID disabled - rtc.h: include py/obj.h to make header self contained - servo: fix angle and speed methods to work again with -ve args - led: support PWM output without TIM3 - rfcore: fix FUS layout and size of ipcc_device_info_table_t - Makefile: allow boards to extend SRC_C, SRC_O and OBJ variables - sdio: don't change any DMA2 settings on H7 MCUs - sdcard: fix H7 build when using SDMMC2 - rfcore: add Python API for basic rfcore operations - boards/NUCLEO_WB55: add standalone WB55 FUS/WS firmware updater - rfcore: update to support WS=1.9.0.0.4 - boards/NUCLEO_WB55/rfcore_firmware.py: fix flash unlock - boards/NUCLEO_WB55/rfcore_firmware.py: fix bad variable name - boards/NUCLEO_WB55/rfcore_firmware.py: increase GET_STATE timeout - fix broken build when FAT FS multi-partition is disabled - usbd_cdc_interface: check and handle CDC TX wrap-overflow - machine_adc: fix ADC auto-calibration to run when ADC not enabled - mpconfigport.h: seed the urandom module on import - rng: use SysTick+RTC+unique-id to seed pRNG for MCUs without RNG - boards: factor out common data/bss/heap/stack linker sections - support C++ code and user C modules written in C++ - main: move update_reset_mode to outside the soft-reset loop - add MICROPY_BOARD calls in various places in stm32_main - boardctrl: define MICROPY_BOARD_EARLY_INIT alongside others - Makefile: make the generation of `firmware.bin` explicit - Makefile: allow boards to extend all SRC variables - rtc: validate the RTC prescaler on boot and change if incorrect - rfcore: make RX IRQ schedule the NimBLE handler - flash: implement WB55 flash locking - rfcore: don't send HCI ACL cmds while another is pending - rfcore: depend on NimBLE only when BLE enabled - modmachine: add device and revision ids to machine.info() - Makefile: disable text compression in debug builds - powerctrl: define RCC_SR_SFTRSTF flag for H747 - powerctrl: fix STOP mode voltage scaling on H7 REV V devices - powerctrl: on H7, re-enable disabled OSCs/PLLs on exit from STOP - powerctrl: disable RTC write protection before changing flags - powerctrl: set H7 RTC wakeup flags - powerctrl: ensure SysTick is disabled on STOP mode entry for H7 - i2c: factor I2C finding code to i2c_find_peripheral function - add support for a board to reserve certain peripherals - Makefile: change -O0 to -Og for DEBUG=1 builds - boards/stm32h743.ld: enable D2 RAM and add eth-buffer section - eth: add support for H7 processors - boards/NUCLEO_H743ZI: enable ethernet peripheral - mboot: enable LFS2_READONLY for mboot builds with littlefs - usb: allocate 128 bytes to CDC data out EPs on non-multi-OTG MCUs - pyb_can: add ability to calculate CAN bit timing from baudrate - system_stm32: enable DBGMCU in low-power modes for debug builds - sdram: add SDRAM enter/leave self-refresh mode functions - adc: deselect VBAT after reading to prevent battery drain - main: do extended readblocks call when auto-detecting littlefs - boards/PYBD_SF2: disable SPIFLASH_ENABLE_CACHE for mboot builds - mboot/gzstream: fix lost data decompressing final part of file - mboot: add support for signed and encrypted firmware updates - boards/NUCLEO_WB55: enable MBOOT with packing mode - Makefile: use MBOOT_PACK_KEYS_FILE as depedency of .pack.dfu - main: check block 0 and 1 when auto-detecting littlefs - mboot: don't auto-detect littlefs block size - mboot: add ELEM_TYPE_STATUS element so application can get status - mboot: introduce MBOOT_ERRNO_xxx constants and use them - mboot/fwupdate.py: refactor update_mpy with support for STATUS - main: introduce MICROPY_HW_FLASH_MOUNT_AT_BOOT config option - rfcore: fix flow control for IPCC RX IRQ - fix minor typos in RTC docs, and->an - usbd_cdc_interface: don't wait in usbd_cdc_tx_always if suspended - mboot: change debug compiler optimisation from -O0 to -Og teensy port: - fix build errors and warnings and enable -Werror unix port: - Makefile: always enable -f*-sections regardless of DEBUG setting - implement BLE H4 HCI UART for btstack/nimble - implement mp_hal_time_ns using gettimeofday - variants: enable MICROPY_DEBUG_PARSE_RULE_NAME on coverage build - mpconfigport.h: enable MICROPY_PY_DELATTR_SETATTR - enable more warnings - support building C++ code - Makefile: move coverage.c and coveragecpp.cpp to coverage variant - handle pending events/scheduler in MICROPY_EVENT_POLL_HOOK - make mp_hal_delay_ms run MICROPY_EVENT_POLL_HOOK - modtime: fix time() precision on unix ports with non-double floats windows port: - msvc: support freezing modules - Makefile: support freezing modules - show test failures in the Appveyor builds - update build instructions in README - implement mp_hal_time_ns using gettimeofday - msvc: use same default python command as core zephyr port: - replace zephyr integer types with C99 types - const-ify struct device instance pointers - update build instructions to v2.4.0 - replace broken shell_net_iface() with more general shell_exec() - guard I2C code with appropriate ifdef config - add basic UART functionality to machine module - machine_uart: fix arg of machine_uart_ioctl to make it uintptr_t ======== Wed, 2 Sep 2020 12:01:26 +1000 v1.13 New uasyncio module, code formatting, BTstack bindings with unix support This release of MicroPython includes a new implementation of the uasyncio module which aims to be more compatible with CPython's asyncio module. The main change is to use a Task object for each coroutine, allowing more flexibility to queue tasks in various places, eg the main run loop, tasks waiting on events, locks or other tasks. It no longer requires pre-allocating a fixed queue size for the main run loop. A pairing heap is used to queue Tasks, and the core is optionally implemented in C. Most code in this repository is now auto-formatted using uncrustify for C code and Black for Python code. The tools/codeformat.py script is used to apply this formatting. Options for uncrustify were chosen to match as closely as possible the existing C style, but there were nevertheless quite a few changes to make the code style consistent. BlueKitchen BTstack bindings have been added for the ubluetooth module, as an optional alternative to the NimBLE stack. The unix port can now be built with BLE support using these bindings, which works with USB Bluetooth adaptors (this feature is enabled by default on the dev and coverage variants). Other Bluetooth additions include: new events for service/characteristic/ descriptor discovery complete; new events for read done and indicate acknowledgement; and support for active scanning in BLE.gap_scan(). See also below for breaking changes to the ubluetooth BLE API. PEP 526 has been implemented which adds new syntax for variable annotations, such as "x:int = 1". PEP 572 has also been implemented, which adds the ":=" operator for assignment expressions, such as "if x := 1:...". The whole code base now supports compressing error messages (those strings used as arguments to exception instances) using a "common word" scheme, which can be used to reduce code size. Other new features include: support for non-boolean results for equality and inequality tests; the addition of the micropython.heap_locked() function to test the state of the heap; binary operations for viper uint operands in the native emitter; and mtime support on littlefs v2 filesystems (which can be disabled if needed). There has been an important bug fix when importing ARM machine code from an .mpy file: the system now correctly tracks the executable memory allocated to the machine code so this memory is not reclaimed by the garbage collector. For testing, a multi-instance test runner has been added (see tests/run-multitests.py) which allows running a synchronised test across two or more MicroPython targets. This is currently used for network and BLE tests that require communication between multiple devices. In the unix port different builds are now organised into build variants, analogous to boards on bare-metal. And PEP 475 has been implemented which retries syscalls failing with EINTR. The stm32 port sees improved support for STM32WB MCUs, with ADC, SPI and DMA support, along with support in mboot for these MCUs. Mboot also adds optional littlefs support. The esp8266 port now includes three generic board definitions: GENERIC_512K, GENERIC_1M and GENERIC, with the latter for modules with 2M or more of flash. This port also changed the default filesystem to littlefs, and no longer supports hard pin IRQs. See breaking changes below for more details. The esp32 port now enables Bluetooth support (via NimBLE) on both IDF v3 and v4 builds. It also changes the default filesystem from FAT to littlefs v2 (but existing devices with FAT filesystems will continue to work without change). There is also a new mimxrt port which targets NXP i.MX RT series CPUs. Breaking changes in this release are: - async-for no longer await's on the result of __aiter__. The __aiter__ method should return an async-iterable object but is not itself awaitable. See commit 37e1b5c891f9964bb6c95228bc2d718511507a69 - In ubluetooth, the IRQ event constants have all changed value (from a bitfield to a sequential integer) and Python code should be updated accordingly by replacing the const definitions with the new ones, which can be found at https://docs.micropython.org/en/latest/library/ubluetooth.html#ubluetooth.BLE.irq See also commit e6881f08292d03f089185718c131f543d095089b - In ubluetooth, the IRQ data for the _IRQ_SCAN_RESULT event has had the "connectable" entry changed to "adv_type". The existing connectable value was a boolean and True now becomes 0x00, False becomes 0x02. See commit dd0bc26e65734b8a4fafa3769008e92e2ec6645d - For esp8266, the default filesystem has changed from FAT to littlefs v2. And the flash layout of the firmware and filesystem has changed to give more space to the firmware and frozen bytecode. When upgrading an existing esp8266 device the filesystem will be reformatted so files should be backed up first. See commit e0905e85a7ad2961aa9192f6130565860e531ad3 - For esp8266, machine.Pin no longer supports configuring a pin IRQ with "hard=True" (because the interrupt handling code is moved to iRAM). Existing code using pin IRQs should remove any "hard=True" argument. See commit 0bd58a56137bd9124756ed0f57b4213daccfc7d5 - For the unix port, binaries are renamed to micropython-variant (no longer micropython_variant). See commit 977b532c8fcd1a9e12844dd4f9cc2d70341013d7 What follows is a detailed list of changes, generated from the git commit history, and organised into sections. Main components =============== all: - reformat C and Python source code with tools/codeformat.py - convert exceptions to use mp_raise_XXX helpers in remaining places - remove spaces between nested paren and inside function arg paren - remove spaces inside and around parenthesis - fix implicit casts of float/double, and signed comparison - use MP_ERROR_TEXT for all error messages - clean up error strings to use lowercase and change cannot to can't - fix implicit floating point promotion - fix implicit conversion from double to float - fix implicit floating point to integer conversions - enable extra conversion warnings where applicable - remove commented-out include statements - format code to add space after C++-style comment start - factor gchelper code to one place and use it for unix & ARM ports - fix auto-enable of MICROPY_GCREGS_SETJMP to select GC behaviour - update Python code to conform to latest black formatting py core: - remove commented-out debug printf's from emitbc and objlist - obj.h: remove comments about additional mp_buffer_info_t entries - objobject: add object.__setattr__ function - objobject: add object.__delattr__ function - nlrx86: silence possible warnings about unused nlr argument - asmx86: fix stack to be 16-byte aligned for entry and sub-call - asmx86: remove unused 5th argument facility - runtime: don't allocate iter buf for user-defined types - objsingleton: use mp_generic_unary_op for singleton objects - introduce MP_ROM_NONE macro for ROM to refer to None object - introduce MP_ROM_FALSE/MP_ROM_TRUE for ROM to refer to bool objects - objstr: don't use inline GET_STR_DATA_LEN for object-repr D - obj.h: use 32-bit shift in MP_OBJ_NEW_QSTR calc for obj-repr D - clean up commented-out code and comments about exception hierarchy - objslice: add support for indices() method on slice objects - objslice: inline fetching of slice paramters in str_subscr() - make mp_obj_get_type() return a const ptr to mp_obj_type_t - mkenv.mk: move usage of 32-bit flags to py.mk - unicode: add unichar_isalnum() - runtime: move MICROPY_PORT_INIT_FUNC near the end of mp_init() - nativeglue: use mp_const_X instead of &mp_const_X_obj - obj.h: redefine qstr object encoding to add immediate obj encoding - obj: add MICROPY_OBJ_IMMEDIATE_OBJS option to reduce code size - obj: optimise mp_obj_get_type for immediate objs with repr A and C - mpconfig.h: define BITS_PER_BYTE only if not already defined - objint: add mp_obj_int_get_uint_checked() helper - pairheap: add generic implementation of pairing heap data structure - gc: don't include or init gc_mutex when GIL is enabled - qstr: don't include or init qstr_mutex when GIL is enabled - objgenerator: use mp_obj_new_exception_arg1 to make StopIteration - objexcept: optimise mp_obj_new_exception[_arg1/_args] functions - obj.h: add and use mp_obj_is_bool() helper - release GIL during syscalls in reader and writer code - emitnative: use NULL for pending exception (not None) - emitnative: stop after finding an unwind target - mpthread.h: use strong type for mp_thread_set_state() argument - objtype: make mp_obj_type_t.flags constants public, moved to obj.h - support non-boolean results for equality and inequality tests - compile: allow 'return' outside function in minimal builds - scheduler: add "raise_exc" argument to mp_handle_pending - scheduler: move mp_keyboard_interrupt from lib/utils to py core - scheduler: allow a port to specify attrs for mp_keyboard_interrupt - scheduler: move clearing of kbd traceback to mp_keyboard_interrupt - expand type equality flags to 3 separate ones, fix bool/namedtuple - add mp_raise_type helper macro and use it where appropriate - add mp_raise_msg_varg helper and use it where appropriate - factor out definition of mp_float_union_t to one location - objexcept: rename mp_obj_new_exception_msg_varg2 to ..._vlist - objtuple: remove code that handles tuple-subclass equality test - objtype: allow mp_instance_cast_to_native_base to take native obj - dynruntime.h: add implementation of mp_obj_cast_to_native_base - objarray: turn on MP_TYPE_FLAG_EQ_CHECKS_OTHER_TYPE for memoryview - removing dangling "else" to improve code format consistency - bc0.h: shift comment to start of line to improve format consistency - builtinimport: adjust if-block order in find_file to clean up #if's - malloc: put { on separate line for funcs that have selective sigs - un-nest configuration #if/#endif's for selection of complex code - parse: add parenthesis around calculated bit-width in struct - builtinevex: support passing in a bytearray/buffer to eval/exec - objstr: remove duplicate % in error string - objstringio: expose tell() on StringIO and BytesIO objects - modmicropython: add heap_locked function to test state of heap - stream.h: include sys/types.h to get size_t and off_t for POSIX API - mpconfig.h: enable MICROPY_MODULE_GETATTR by default - pairheap: properly unlink node on pop and delete - pairheap: add helper function to initialise a new node - use preprocessor to detect error reporting level (terse/detailed) - dynruntime.mk: set MICROPY_ENABLE_DYNRUNTIME instead of per module - implement "common word" compression scheme for error messages - objexcept: allow compression of exception message text - parse: remove unnecessary check in const folding for ** operator - objexcept: remove optional TimeoutError exception - scheduler: fix race in checking scheduler pending state - scheduler: add assert that scheduler is locked when unlocking - makecompresseddata.py: don't prefix str with mark if not compressed - scope: add assert to check that low numbered qstrs do fit in uint8_t - always give noop defines when MICROPY_ROM_TEXT_COMPRESSION disabled - objarray: fix sign mismatch in comparison - objint: do not use fpclassify - makecompresseddata.py: make compression deterministic - objdict: fix popitem for ordered dicts - stream: remove mp_stream_errno and use system errno instead - modio: allow uio.IOBase streams to return errno for read/write error - scheduler: add option to wrap mp_sched_schedule in arbitrary attr - parse: support constant folding of power operator for integers - scheduler: convert mp_sched_full and mp_sched_num_pending to macros - parse: make mp_parse_node_extract_list return size_t instead of int - nativeglue.h: rename "setjmp" entry to "setjmp_" to avoid any clash - py.mk: use additional CFLAGS to compile string0.c - modmath: work around msvc float bugs in atan2, fmod and modf - ringbuf: fix compilation with msvc - modsys: use consistent naming pattern for module-level const objects - modbuiltins: fix getattr to work with class raising AttributeError - dynruntime.h: make mp_obj_str_get_str raise if arg not a str/bytes - objtype: add __dict__ attribute for class objects - objtype: use mp_obj_dict_copy() for creating obj.__dict__ attribute - obj.h: clarify comments about mp_map_t is_fixed and is_ordered - compile: convert scope test to SCOPE_IS_COMP_LIKE macro - compile: implement PEP 572, assignment expressions with := operator - grammar.h: consolidate duplicate sub-rules for :test and =test - compile: implement PEP 526, syntax for variable annotations - misc.h: add missing semi-colon in mp_float_union_t for big-endian - obj.h: add public mp_obj_is_dict_or_ordereddict() helper macro - objtype: support passing in an OrderedDict to type() as the locals - asm: add funcs/macros to emit machine code for logical-shift-right - asm: add condition codes for signed comparisons - emitnative: implement binary operations for viper uint operands - objcomplex: add mp_obj_get_complex_maybe for use in complex bin-op - obj.h: make existing MP_TYPE_FLAG_xxx macros sequential - rework mp_convert_member_lookup to properly handle built-ins - obj.h: fix mp_seq_replace_slice_no_grow to use memmove not memcpy - compile: don't await __aiter__ special method in async-for - persistentcode: maintain root ptr list of imported native .mpy code - runtime: fix builtin compile() in "single" mode so it prints exprs - mphal.h: introduce mp_hal_time_ns and implement on various ports extmod: - uzlib: explicitly cast ptr-diff-expr to unsigned - fix modbluetooth and modwebrepl to build in nanbox mode - modbluetooth: fix func prototype, empty args should be (void) - vfs_posix: release GIL during system calls - modbluetooth: implement config getter for BLE rxbuf size - modbluetooth.h: fix typo in comment about registering services - modbluetooth_nimble: fix wrong offset used for descriptor flags - modframebuf: allow blit source to be a subclass of FrameBuffer - modbluetooth_nimble: move nimble specific code, factor nimble.mk - modbluetooth: extract out gatts_db functionality from nimble - btstack: add empty modbluetooth implementation - btstack: implement advertising - btstack: implement service registration - btstack: implement gatts_db for btstack - btstack: implement scan and gatt client, connect and disconnect - btstack: implement notifications/indications for GATT clients - nimble: clarify active state and check for active in all methods - modbluetooth: unify error handling in remaining places - modbluetooth: change scan result's "connectable" to "adv_type" - nimble: when getting BLE MAC try public address if random fails - vfs: factor out vfs mount-and-chdir helper from stm32 - modlwip: fix polling of UDP socket so it doesn't return HUP - modlwip: properly handle non-blocking and timeout on UDP recv - vfs_posix_file: lock GIL when writing and allow stdio flush - vfs_posix_file: include unistd.h to get STD{IN,OUT,ERR}_FILENO - uasyncio: add new implementation of uasyncio module - uasyncio: add optional implementation of core uasyncio in C - uasyncio: add manifest.py for freezing uasyncio Py files - uasyncio: don't create a Loop instance in get_event_loop() - uasyncio: implement Loop.stop() to stop the event loop - uasyncio: add error message to Lock.release's RuntimeError - uasyncio: add StreamReader/StreamWriter as aliases of Stream cls - uasyncio: add global exception handling methods - modubinascii: make code private and module self-contained - btstack: pass through SCAN_RSP events - modbluetooth: provide FLAG_WRITE_NO_RESPONSE for characteristics - uasyncio: add Loop.new_event_loop method - uasyncio: change cannot to can't in error message, and test exp - nimble: update to work with NimBLE 1.3 - modbluetooth: don't hold atomic section during mp_sched_schedule - btstack: implement more robust init/deinit sequencing - modbluetooth: fix sign compare and unused variable warnings - modbtree: retain reference to underlying stream so it's not GC'd - vfs_lfsx: fix path handling in uos.stat() to consider cur dir - vfs_lfsx: normalize path name in chdir - vfs_lfsx: fix rename to respect cur dir for new path - modbluetooth: add support for changing the GAP device name - nimble: make error code mapping default to MP_EIO - vfs_lfsx: fix import_stat so it takes into account current dir - vfs: retain previous working directory if chdir fails - modbluetooth: make modbluetooth event not a bitfield - modbluetooth: add discover complete events for svc/char/desc - modbluetooth: allow discovery of svc/char by uuid - modbluetooth: implement read done event - modbluetooth: ensure status=0 always on success - modbluetooth: support bigger characteristic values - ure: use single function for match/search/sub - uasyncio: add asyncio.wait_for_ms function - modbluetooth: register default GATT service and fix esp32 init - moductypes: use mp_obj_is_dict_or_ordereddict to simplify code - vfs_lfs: fix littlefs bindings to build in nan-box mode - nimble: fix attr NULL ptr dereference in ble_gatt_attr_read_cb - btstack: schedule notify/indicate/write ops for bg completion - modbluetooth: ignore unused self_in in ble_gatts_indicate - modbluetooth: fix so it builds in peripheral-only mode - modbluetooth: add event for "indicate acknowledgement" - modussl: improve exception error messages - modussl_mbedtls: integrate shorter error strings - uasyncio: add StreamReader.readexactly(n) method - vfs_reader: fix mp_reader_new_file to open file in "rb" mode - uasyncio: truncate negative sleeps to 0 - vfs_lfs: add mtime support to littlefs files - btstack: implement GAP scan duration_ms parameter - modbluetooth: fix race between READ_REQUEST and other IRQs - bluetooth: support active scanning in BLE.gap_scan() - machine_i2c: fix buffer overrun if 'addrsize' is bigger than 32 - modlwip: fix error return for TCP recv when not connected - vfs: support larger integer range in VFS stat time fields - vfs: add option to use 1970 as Epoch lib: - utils/pyexec: introduce MICROPY_REPL_INFO, wrap debug prints in it - mp-readline: add an assert() to catch buffer overflows - mp-readline: add word-based move/delete EMACS key sequences - utils: change default value of pyexec_mode_kind to 0 to put in bss - utils/pyexec: handle pending exceptions after disabling kbd intrs - add BlueKitchen BTstack submodule - tinyusb: update to a6b916ba for i.MX support - btstack: update to latest master btstack commit - littlefs: update littlefs2 to v2.2.0 - mynewt-nimble: update submodule to NimBLE release 1.3.0 - btstack: update to c8b9823 for USB HCI reset timeout fix - nrfx: upgrade to nrfx v2.0.0 - utils: lock the scheduler when executing hard callback functions - utils/pyexec: add missing MP_ERROR_TEXT when compiler disabled - utils: protect all of mpirq.c with MICROPY_ENABLE_SCHEDULER - libc: add implementation of strncpy - mbedtls_errors: add code to patch mbedtls for shortened error strs - stm32lib: update library for H7 v1.6.0 and WB v1.6.0 - libm_dbl: add round.c source code - libc: fix string0's implementation of strncpy - timeutils: add helper functions to deal with nanosecs since 1970 drivers: - cyw43: fix to build in nanbox mode - cyw43: include stdio.h in files that use printf - cyw43: return early from cyw43_wifi_set_up if wifi_on fails - nrf24l01: change pipe addrs in test to match Arduino addrs - onewire: fix undefined variable errors - display/ssd1306.py: change the SET_COM_PIN_CFG setting - support SPI/QSPI flash chips over 16MB mpy-cross: - main: fix stderr_print_strn parameter type - main: print uncaught nlr jump to stderr Support components ================== docs: - more consistent capitalization and use of articles in headings - library/machine.I2C.rst: use positional-only arguments syntax - library/machine.UART.rst: detail timeout behaviour of read methods - README: add short paragraph about using readthedocs - library/machine: document machine.soft_reset() function - library: add / to indicate positional-only args in library docs - library/uos.rst: improve block devices section, and ioctl ret vals - esp8266: in TCP tutorial, add HTTP response code and content-type - unix: add a new new quickref page for the UNIX port - library: fix framebuf monochrome 1-bit modes, swapping HLSB/HMSB - develop: detail how to add symbols to mp_fun_table for native mods - library: add initial docs for uasyncio module - add docs and test for uasyncio custom exc handler methods - library: note that uasyncio.wait_for() can raise exception - library: document that char_data/notify_data are also references - library: note that machine.Pin.irq's hard arg may not be supported - library: fix docs for machine.WDT to specify millisecond timeout - develop: fix module/source name in Makefile of native example - reference: add note about multiple exceptions when heap is locked - library: update ubluetooth for new events and discover by uuid - fix Sphinx 3.x warnings, and enable warnings-as-errors on build - esp8266: add quickref documentation for UART on esp8266 - library: clarify that the arg to esp.deepsleep is in microseconds - esp32: add info about PWM duty cycle range to esp32 quickref - library: add gatts_indicate() doc to ubluetooth.rst - library: for ubluetooth, add docs for _IRQ_GATTS_INDICATE_DONE - library: update documentation of esp32's RMT - library: update pyb.SPI init method to add descr about "ti" arg - library: update pyb.Timer to add missing args and defaults to init - library: update pyb.UART to correct pyboard UART availability - esp32: fix machine.Timer quickref to specify HW timers - change `\*` to `*` in argument lists examples: - accellog.py: shift long comments to their own line - bluetooth/ble_temperature_central.py: shorten comment - natmod: add .gitignore to ignore generated example .mpy files - bluetooth: replace "connectable" parameter with "adv_type" - bluetooth: fix incorrect value of BR/EDR flag in advertising - bluetooth: fix event code in ble_temperature_central.py - bluetooth: in ble_advertising.py, skip appearance if not set - bluetooth: add simple UART demo with central and peripheral tests: - run-tests: add "--mpy-cross-flags" arg to specify mpy-cross flags - extmod: split out VfsFat finaliser tests to separate test file - micropython: add test for yield-from while heap is locked - run-tests: handle 'CRASH' return by float.py feature test - cpydiff: add CPy diff-test for using dict.keys() as a set - unix: make unix time test pass on more platforms - unix: add coverage test for new mp_obj_int_get_uint_checked func - make run-tests help and README be more descriptive of behaviour - extmod: add basic machine.Timer test - unix: add coverage tests for pairheap data structure - unix: add coverage test for mp_obj_new_exception_args - unix: add coverage tests for mp_obj_is_type() and variants - add boolean-as-integer formatting tests for fixed regression - add tests for generator throw and yield-from with exc handlers - basics: expand test cases for equality of subclasses - cmdline/repl_inspect: add new test for -i option - cmdline: add test for MICROPYINSPECT environment variable - cpydiff: add os module environ differences - move CPy diff test to real test now that subclass equality works - basics: move test for "return" outside function to own file - unix: add coverage tests for kbd-intr and scheduler - run-tests: auto-skip extmod/ticks_diff, extmod/time_ms_us tests - basics: add tests for equality between bool and int/float/complex - basics: add test for equality between tuple and namedtuple - basics: add test for tuple compare with class derived from tuple - basics/array1.py: add equality testing for array - run-multitests.py: add new test runner for multiple Py instances - multi_net: add initial set of multi-instance tests for network - multi_bluetooth: add initial tests for bluetooth BLE - run-tests: consider all tests as native when emit=native is used - run-multitests.py: print test summary and do exit(1) on failure - extmod: add uasyncio tests - run-tests: skip uasyncio if no async, and skip one test on native - make default MICROPYPATH include extmod to find uasyncio - multi_net: add uasyncio test for TCP server and client - net_inet: add uasyncio internet tests - basics/dict_pop.py: remove extra comma in call and fix grammar - micropython/heapalloc_fail_set.py: remove extra trailing comma - format all Python code with black, except tests in basics subdir - float: add new lexer test to test parsing of float without prefix - run-tests: add commands to print and clean *.exp,out files - extmod: update littlefs test output to match new library version - run-tests: make diff tool user configurable - float: fix cmath_fun_special for MICROPY_FLOAT_IMPL_FLOAT - extmod: add btree test for errors raised by btree DB library - run-multitests.py: allow filtering out lines from stdout - multi_bluetooth/ble_gap_advertise: fix bytes/str compare warning - run-multitests.py: add shortcuts for local Python instances - cpydiff: add cpydiff test for __all__ used in imported package - thread/thread_stacksize1.py: increase stack size for CPython - multi_bluetooth: fix typo printing wrong IRQ type - run-multitests.py: add TRACE banner and move TEST output to end - run-tests: skip REPL feature checks when running via pyboard.py - multi_bluetooth: update to work with new BLE events - run-multitests.py: allow passing unique env vars to each instance - basics: add tests for assignment operator := - cpydiff: add CPy diff test for assignment expression behaviour - basics: add tests for variable annotations - basics: split out memoryview slice-assign tests to separate file - move .mpy import tests from import/ to micropython/ dir - micropython: improve .mpy import tests to run on more targets - extmod: add test for uasyncio.sleep of a negative time - extmod: make uasyncio_fair test more reliable by adjusting sleeps - run-tests: use absolute paths where possible - run-tests: make test output directory configurable - split out complex reverse-op tests to separate test file - extmod: add tests for verifying FAT and littlefs mtime values tools: - gen-cpydiff.py: adjust subsections to sentence case - add metrics.py script to build and compute port sizes/metrics - pydfu.py: clean up syntax, update comments and docstrings - pyboard.py: add option --no-follow to detach after sending script - pyboard.py: use slice del instead of list.clear() for Py2 compat - pyboard.py: change shebang to use python3 - makemanifest.py: support freezing with empty list of mpy files - codeformat.py: add formatter using uncrustify for C, black for Py - makemanifest.py: fix build on Windows by adding .exe to mpy-cross - metrics.py: use check_call instead of run to error out on error - codeformat.py: eliminate need for sizeof fixup - pydfu.py: add args for VID/PID & exit with cleaner error handling - pydfu.py: display any error strings from device/mboot - codeformat.py: include all msvc C code in auto-format - pyboard.py: support setting device/baudrate from shell env vars - pyboard.py: add -d as an alias for --device - metrics.py: add option to diff to error if delta above threshold - metrics.py: don't build mpy-cross if not needed by any ports - metrics.py: use OrderedDict when reading build log - check_code_size.sh: remove unused script - codeformat.py: use -q option on uncrustify to make output quiet - codeformat.py: add verbose option to pass to uncrustify and black - uncrustify.cfg: remove deprecated sp_word_brace option - codeformat.py: remove sizeof fixup - uncrustify: update config for v0.71.0 - codeformat.py: include extmod/{btstack,nimble} in code formatting - uncrustify: enable more opts to remove space between func and '(' - makemanifest.py: support freezing a subdirectory recursively - pydfu.py: respect longer timeouts requested by DFU device/mboot - makemanifest.py: use errno.EEXIST instead of number 17 - makemanifest.py: print nicely formatted errors from mpy-cross - pyboard.py: replace eval() of received data with alternative - mpy-tool.py: fix offset of line number info - makemanifest.py: use os.makedirs to make path for generated files CI: - add new job to build and test unix coverage in 32-bit mode - add stm32 build in nanbox mode - update travis to specify which unix variant to build - add OSX build to CI - add CI job to check code formatting - build stm32 PYBD_SF6 with BTstack as bluetooth stack - run multi_net tests as part of coverage job - for unix tests use Makefile target instead of explicit commands - print errors out for OSX job - exclude some uasyncio tests on OSX - use custom PPA to get pre-built uncrustify - use grep with --text on qemu-arm output - build NUCLEO_L073RZ instead of B_L072Z_LRWAN1 for stm32 job - build full unix coverage build on osx job - build GENERIC_1M board as part of esp8266 job - make OSX build work again by not installing pkgconfig - split esp32 ESP-IDF v3 and v4 builds to separate jobs - decrease build duration by starting OSX build early - finish jobs early after test failure - use tools/metrics.py to compute size diff of minimal ports - make sure upstream/master exists when computing size-diff check - build more boards as part of nrf job - run apt commands once, to slightly speed up the CI - set build name so it appears in the web interfaces - for powerpc job, build both UART variants - change nrf pca10056 board to build with soft-device enabled - build qemu-arm with MP_ENDIANNESS_BIG=1 to test bigendian build - in stm32 job, build mboot for NUCLEO_WB55 - build mboot for PYBV10 with LFS2 enabled in stm32 job - install newer toolchain for nrf job - add pca10090 build to nrf job - change nrf pca10056 board to build with s140 SoftDevice - add zephyr build to CI - add GitHub action to build docs The ports ========= all ports: - allow overriding CROSS_COMPILE in a custom makefile - modify mp_hal_pin_write macro so it can be used as a function - add lib/libm/roundf.c to bare-metal Makefile's - enable error text compression for various ports, but not all - disable MICROPY_PY_ASSIGN_EXPR in bare-arm and minimal ports cc3200 port: no changes specific to this port esp8266 port: - modules: fix AttributeError in _boot.py if flash not formatted - modules/ntptime.py: add comment about configuring NTP host - put mp_keyboard_interrupt in IRAM - machine_pin: disable ets_loop_iter during hard IRQ handler - modmachine: implement machine.soft_reset() - README.md: add docker build instructions - modnetwork: add support for wlan.ifconfig('dhcp') - enable and freeze uasyncio - change from FAT to littlefs v2 as default filesystem - makeimg.py: print out info about RAM segments when building fw - machine_pin: move pin_intr_handler to iRAM, de-support hard IRQ - mpconfigport.h: add definitions for BEGIN/END_ATOMIC_SECTION - clean up Pin intr handler by moving all code to machine_pin.c - boards: move py/pairheap.c code from iRAM to iROM - esp_mphal: move most functions in esp_mphal.c from iRAM to iROM - uart: move a few functions from iRAM to iROM - boards: allow configuring btree/FAT/LFS2 support when building - esppwm: fix PWM glitch when setting duty on different channel esp32 port: - Makefile: assign result of $call to dummy var for older make - modmachine: add implementation of machine.soft_reset() - enable NimBLE support on all builds (IDF 3.3 and 4.0) - modnetwork: add max_clients kw-arg to WLAN.config for AP setting - Makefile: reorder includes to build with latest toolchain - uart: use core-provided mp_keyboard_interrupt, placed in IRAM - modsocket: convert EADDRINUSE error code from lwip return value - move to IDF 4.0 release version - deinitialize Bluetooth on soft reset - README.md: update build instructions for newer toolchain - modsocket: handle poll of a closed socket - enable and freeze uasyncio - README.md: fix typo in venv instructions - change from FAT to littlefs v2 as default filesystem - espneopixel: use integer arithmetic to compute timing values - update to ESP IDF v3.3.2 - modesp32: add idf_heap_info(capabilities) to esp32 module - consolidate check_esp_err functions and add IDF error string - improve support for OTA updates - partitions: update comments in files regarding offset - modsocket: fix getaddrinfo to raise on error - machine_sdcard: add "freq" keyword arg to SDCard constructor - modmachine: fix machine.reset_cause to use IDF's esp_reset_reason - mpthreadport: fix calculation of thread stack size - update IDF v4.0 supported hash to v4.0.1 - esp32_rmt: extend RMT to support carrier feature - esp32_rmt: call rmt_driver_install before rmt_config - esp32_rmt: properly fix looping behaviour of RMT - network_lan: add support for IP101 PHY - mphalport: fix mp_hal_time_ns offset javascript port: no changes specific to this port mimxrt port: - add new, minimal port to NXP i.MX RT series CPUs - add MIMXRT1010 board - add MIMXRT1060_EVK board - add initial impl of machine.LED class, and basic pin support - tusb_config.h: preliminary fix for TinyUSB HS endpoint overflow - boards: enable LED class for MIMXRT1060_EVK board - boards: integrate support for MIMXRT1020_EVK board - boards: set __heap_size__ to 0 in MIMXRT1011.ld minimal port: - make build more flexible and work as 64-bit build nrf port: - main: remove unnecessary repl_info(0) call - boards/common.ld: add ENTRY(Reset_Handler) in linker script - drivers: use mp_raise_msg where appropriate, and shorten exc msgs - drivers/bluetooth: fix variable initialisation error with older gcc - remove custom "random" module and use extmod version instead - use MICROPY_HW_ENABLE_RNG instead of MICROPY_PY_RANDOM_HW_RNG - Makefile: don't use -fno-builtin for Cortex-M0 builds - mphalport: remove need for "syntax unified" in mp_hal_delay_us - update to work with nrfx v2.0.0, to match TinyUSB - add openocd as a supported flasher - bluetooth: use MP_ERROR_TEXT for all error messages - bluetooth/ble_uart: fix implicit declaration of function - bluetooth: handle data length update request - bluetooth/ble_uart: add mp_hal_stdio_poll function - bluetooth/ble_uart: fix random advertisement name - bluetooth/ble_uart: swap end character on cooked strings - Makefile: disable ROM text compression when compiling for debug - add support for time.ticks_xxx functions using RTC1 - enable nrf tick support on all boards by default - boards: add initial support for Actinius Icarus - nrfx_config: disable RTC2 for nRF9160 targets - boards: enable RTCounter machine module for nrf9160 boards - add board definition for nRF52840-MDK-USB-Dongle - split mpconfigport.h into multiple files - enable more features for all targets - Makefile: improve user C modules support pic16bit port: no changes specific to this port powerpc port: - fix Makefile rule when linking - set better default compiler - uart: choose which UART to use at build time, not runtime qemu-arm port: - set default board as mps2-an385 to get more flash for tests - README: update link to toolchain - support building in debug mode with DEBUG=1 - Makefile: add CFLAGS_EXTRA to CFLAGS samd port: - fix to build with latest tinyusb stm32 port: - mbedtls: resize mbedtls output buffer from 16 down to 4 kiB - fix to build in nanbox mode - add configuration to build in nanbox mode - boards/PYBD: change RTC asynch prediv from 1 to 4 - softtimer: change linear linked list to a pairing heap - powerctrl: for F7, allow PLLM!=HSE when setting PLLSAI to 48MHz - Makefile: allow a board's .mk file to add things to CFLAGS - boards/STM32F769DISC: add config to use external SPI as filesys - powerctrl: disable HSI if not needed to save a bit of power - powerctrl: enable overdrive on F7 when waking from stop mode - boards/stm32f746_af.csv: add ADC alt functions to correct pins - sdio: add support for H7 MCUs - stm32_it: don't call __HAL_USB_HS_EXTI_CLEAR_FLAG on H7 MCUs - powerctrl: improve support for changing system freq on H7 MCUs - powerctrl: reenable PLL3 on H7 MCUs when waking from stop mode - sdram: expose the result of sdram startup test in stm32_main - usbd_conf: allow boards to configure USB HS ULPI NXT/DIR pins - usbd_cdc_interface: remove "interrupt_char != -1" check - sdram: fix compile issue from unused sdram startup test flag - mpconfigport.h: add option to have custom help text - modnetwork: remove redundant call to nimble_poll in lwip poll - refactor bluetooth stack/hci/driver bindings - add bindings for BTstack implementation - boards/PYBD: allow building with BTstack (via make command line) - refactor Bluetooth HCI RX to be independent of transport layer - main: fix bug mounting 3rd SD partition - mboot: allow overriding led_init and led_state in board folder - mboot: update dfu state/status flags to better match standard - mboot: protect against invalid address flash writes - mboot: update LED0 state from systick handler - mboot: remove unnecessary test for led being 1 in led_state - softtimer: initialise pairing-heap node before pushing to heap - enable and freeze uasyncio - mpconfigport.h: remove unused root pointer for BTstack bindings - mpconfigport.h: make most extended modules configurable by board - boards: disable pend_throw, uheapq, utimeq on small-flash boards - Makefile: add missing ordering dependency on generated headers - storage: fix start address of second, internal block device - mboot/README: clarify that mboot can access FAT formatted FS only - mboot: expose custom DFU USB VID/PID values at makefile level - Makefile: rename SRC_LIB to LIB_SRC_C to match other ports - main: peform a clean shutdown of btstack on soft reset - boards/PYBD_SF2: put BTstack library in external QSPI XIP flash - README: reorg DFU flashing instructions with addition for PYBD - add support for F412 MCUs - boards: add board config for Nucleo-F412ZG development board - machine_uart: retain attached-to-repl setting when init'ing UART - machine_uart: allow re-init'ing a static UART object - modmachine: allow changing AHB and APB bus frequencies on STM32WB - adc: add support to pyb.ADC for STM32WB MCUs - machine_adc: make setting of ADC1_COMMON->CCR clearer on STM32WB - dma: add support for DMA on STM32WB, with SPI settings provided - boards/xxx_WB55: enable pyb.ADC and hardware SPI on WB55 boards - Makefile: quote libgcc path so spaces are not an issue - boards/STM32F769DISC: use macro instead of const for flash size - factoryreset: provide empty create-FS function when FAT disabled - usb: add support for 2xVCP on L0, L432 and WB MCUs - rfcore: leave txpower level as default when initialising rfcore - boards/NUCLEO_WB55: add more CPU pins and aliases to SW1/2/3 - irq: clean up irq.h so it does not depend on core uPy defines - powerctrlboot: include irq.h to get definitions of IRQ priorities - flash: make flash C-API reusable, and funcs return an error code - i2cslave: add support for WB MCUs - flash: add flash_is_valid_addr, and extend sectors for 2MB F7 - mboot: use flash routines from main stm32 code rather than custom - mboot: use CMSIS system source code for SystemInit function - mboot: add support for using mboot with WB MCUs - boards: add build-time option for NUCLEO_WB55 to use mboot - mboot: set VTOR on start up to ensure it has the correct value - mboot: use additional CFLAGS to compile string0.c - mpconfigport.h: enable PY_IO_FILEIO when any VFS is enabled - timer: support TIM1 on WB MCUs - boards: enable LFS2 on PYBD_SF3 and PYBD_SF6 - mboot: don't search for firmware on FS, just attempt to open it - mboot: decouple stream, filesystem and top-level loading code - mboot: add support for littlefs - mboot: update README to describe WB and littlefs support - i2cslave: pass I2C instance to callbacks to support multi I2Cs - usbd_cdc_interface: remove full==size-1 limitation on tx ringbuf - timer: properly initialise timer deadtime/brk on WB MCUs - mboot: implement DFU mass erase - flash: update flash_get_sector_info to return -1 on invalid addr - mboot: add DFU logic to respond to DFU_GETSTATE request - mboot: remove the use of timeout in DFU_GETSTATUS - mboot: disable polling mode by default and use IRQ mode instead - fdcan: use the right FIFO to calc element address in can_receive - fdcan: use FDCAN_RXFxS_FxFL instead of hard-coded value - fdcan: support maximum timeout of HAL_MAX_DELAY in can_receive - pyb_can: handle timeout arg for FDCAN in pyb_can_send - usbdev: fix calculation of SCSI LUN size with multiple LUNs - pin_defs_stm32: fix pin printing to show IN mode correctly - powerctrl.h: include stdbool.h to get definition of bool teensy port: no changes specific to this port unix port: - modtime: add utime.mktime function, to complement utime.localtime - modos: add uos.rename and uos.rmdir - add build variants, analogous to boards on bare-metal - add placeholder DEV variant with settrace enabled - rename unix binaries to micropython-variant (not _variant) - Makefile: reserve CFLAGS_EXTRA/LDFLAGS_EXTRA for external use - release GIL during all system calls - unix_mphal: add compile check for incompatible GIL+ASYNC_KBD_INTR - main: print usage and NLR errors to stderr instead of stdout - main: add support for MICROPYINSPECT environment variable - main: add #if guard around -v option usage and document -i/-m opts - main: add command-line -h option for printing help text - modos: implement putenv and unsetenv to complement getenv - main: use OS-dependent path separator when searching path - Makefile: remove old variant targets that are no longer needed - variants/standard: fix role of PREFIX when used to install - Makefile: allow to install all variants of the executable - mpthreadport: use SIGRTMIN+5 instead of SIGUSR1 for thread-GC - mpthreadport: fix Mac build by using SIGUSR1 if SIGRTMIN not avail - mphalport.h: fix build when MICROPY_USE_READLINE=0 - unix_mphal: adjust #if in mp_hal_stdin_rx_chr to improve format - file: don't raise OSError(EINVAL) on sys.stdin/out/err.flush() - Makefile: detect and pass thru mpy-cross flags when running tests - remove custom file implementation to use extmod's VFS POSIX one - remove custom definition of MP_PLAT_PRINT_STRN - coverage: init all pairheap test nodes before using them - enable uasyncio C helper module on coverage build - mpthreadport: fix crash when thread stack size <= 8k - implement PEP 475 to retry syscalls failing with EINTR - mpthreadport: ensure enough thread stack to detect overflow - fix behaviour of COPT/NDEBUG for unix variants - implement MICROPY_BEGIN/END_ATOMIC_SECTION protection macros - Makefile: fix regression using install on non-GNU systems - modmachine: add machine.idle(), implemented using sched_yield - add support for modbluetooth and BLE using btstack - enable modbluetooth on the "dev" and "coverage" variants - add btstack to the unix submodules list - main: enter REPL when inspect active, even with stdin redirected - btstack_usb: allow choosing adaptor via environment variable - make manifest selection match other ports - enable uasyncio on dev variant - variants: enable VFS and all supported filesystems on dev variant - make the MICROPY_xxx_ATOMIC_SECTION mutex recursive - fatfs_port: implement get_fattime - variants: fix fast and freedos variants so they build again - modos: support larger integer range in uos.stat fields windows port: - support word-based move/delete key sequences for REPL - windows_mphal: release GIL during system calls - improve default search path - msvc: fix warnings regarding function declarations - remove custom definition of MP_PLAT_PRINT_STRN - windows_mphal: fix missing semicolon - update genhdr.targets to match makeqstrdefs.py args - make appveyor.yml self-contained zephyr port: - update include paths for Zephyr v2.0 - replace deprecated time conversion macro - remove reference to syscall_macros_h_target - implement block device protocol via zephyr disk access api - enable virtual file system and uos module - enable fatfs - implement block device protocol via zephyr flash map api - enable littlefs - mount a file system during init - enable usb mass storage class on mimxrt1050_evk - execute main.py file if it exists - update machine.Pin class to use new zephyr gpio api - use zephyr build system to merge configurations - fix and rename stacks_analyze function in zephyr module - fix floating point configuration - update for refactored zephyr device structures - update to new zephyr timeout API - convert DT_FLASH_AREA usages to new dts macros - increase minimum required cmake version to 3.13.1 - use cmake find_package to locate zephyr - implement machine.Pin.irq() for setting callbacks on pin change - make-minimal: disable FAT and LFS2 options to make it build - include storage/flash_map.h unconditionally - README: update required Zephyr version and mention new features ======== Fri, 20 Dec 2019 16:58:17 +1100 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. 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 - 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 - 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 - 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 ======== Wed, 29 May 2019 16:38:10 +1000 v1.11 Improved mpy format with support for native code, and new JavaScript port In this release the mpy file format has been moved to version 4 and has some significant improvements: mpy file size is reduced on average by about 35%, loading time of mpy files is reduced by about 40%, and they now have support to save native, viper and inline assembler code (or machine code generated from any other source). Size reduction of mpy files was achieved by adding a qstr window to reuse past qstrs when encoding them, by packing qstrs directly in the bytecode, and by defining a static qstr set. Some VM opcodes were also changed to fix a bug when doing a break/continue out of a finally block, and to make some simplifications. In particular POP_BLOCK and POP_EXCEPT opcodes were replaced with POP_EXCEPT_JUMP. Most uppercase macros have been converted to lowercase to make a more consistent C API, including all MP_OBJ_IS_xxx and MP_xxx_SLOT_IS_FILLED macros. The default PYTHON makefile variable is now changed from "python" to "python3", but Python 2 is still supported via "make PYTHON=python2". The mpy-cross compiler supports the new mpy version 4 and has new command line options: "-march=" to select the native emitter, and "--version" to print the MicroPython version and the mpy version. Also mpy-tool.py has support for freezing native code. A module system for external, user C modules has been implemented and documentation for this is available in the new "docs/develop" section. A new "javascript" port has been added which targets JavaScript as the machine via Emscripten. This allows to run MicroPython as an application within node.js, and to run it within a browser (among other things). All bare-metal ports have the following improvements: machine.sleep() is now machine.lightsleep(), and both lightsleep() and deepsleep() now take an optional argument which is the maximum time to sleep in milliseconds. These ports also now allow freezing of boot.py and main.py using the usual methods. And a new I2C method i2c.writevto(addr, vect) is added which can be used to write a tuple/list of buffers all at once to an I2C device. The stm32 port now has a fully integrated Ethernet MAC driver (see the network.LAN class) using lwIP for the TCP/IP stack, and sockets were made significantly more robust. Support for F413 MCUs was added. There are also some minor user-facing changes to this port: - machine.UART (and pyb.UART) now defaults to timeout=0 (was 1000ms) which gives UARTs a non-blocking behaviour. - The USB REPL is now configurable using uos.dupterm, and by default pyb.USB_VCP(0) is put on dupterm slot 1 before boot.py is executed. To disable the default REPL use: uos.dupterm(None, 1). - pyb.DAC(id) will now only reset the DAC the first time it is called; to get the old behaviour pass the bits parameter like: pyb.DAC(id, bits). - pyb.DAC.noise() and pyb.DAC.triangle() now output at full scale. - The system will not recreate boot.py if it's missing (it will only create it if the filesystem is corrupt, or when doing a factory reset). For the esp32 port, the build process has been updated to align better with the ESP IDF and now uses sdkconfig to configure features. Dual core mode is now enabled by default, SPIRAM is in memory-mapped mode so all of it can be used for the MicroPython heap, there is support to change the CPU frequency, and the WDT now panics and resets the device if it times out. A detailed list of changes follows. py core: - remove calls to file reader functions when these are disabled - add optional support for 2-argument version of built-in next() - compile: swap order of pop_block/pop_except in "except as" handler - warning: support categories for warnings - builtinhelp: only print help re FS modules if external import enabled - downcase all MP_OBJ_IS_xxx macros to make a more consistent C API - downcase MP_xxx_SLOT_IS_FILLED inline functions - mkenv.mk: change default PYTHON variable from "python" to "python3" - qstr: evaluate find_qstr only once then pass to Q_GET_HASH macro - obj.h: remove obsolete mp_obj_new_fun_viper() declaration - objfun: make fun_data arg of mp_obj_new_fun_asm() a const pointer - eliminate warnings about unused arguments when debugging disabled - compile: fix handling of unwinding BaseException in async with - compile: add optimisation to compile OrderedDict inplace - objexcept: fix hash of exc str created in mp_obj_new_exception_msg - py.mk: update lwip build config to work with latest lwip version - fix VM crash with unwinding jump out of a finally block - vm: remove currently_in_except_block variable - replace POP_BLOCK and POP_EXCEPT opcodes with POP_EXCEPT_JUMP - persistentcode: add a qstr window to save mpy files more efficiently - persistentcode: pack qstrs directly in bytecode to reduce mpy size - persistentcode: define static qstr set to reduce size of mpy files - add independent config for debugging sentinel object values - emitnative: consolidate where HASCONSTS is set to load-const-obj fun - emitnative: provide concentrated points of qstr emit - emitnative: adjust accounting of size of const_table - emitglue: remove union in mp_raw_code_t to combine bytecode & native - add support to save native, viper and asm code to .mpy files - persistentcode: bump .mpy version to 4 - allow registration of modules at their definition - implement a module system for external, user C modules - update and rework build system for including external C modules - move mp_native_type_from_qstr() from emitnative.c to nativeglue.c - nativeglue: rename native convert funs to match other native helpers - compile: add support to select the native emitter at runtime - compile: support multiple inline asm emitters - compile: check that arch is set when compiling native, viper or asm - runtime: remove long-obsolete MICROPY_FSUSERMOUNT init code - scheduler: convert micropythyon.schedule() to a circular buffer - nlrthumb: add support for iOS where the C func is _nlr_push_tail - makedefs: use io.open with utf-8 encoding when processing source - runtime: optimise to not create temp float for int to power negative - runtime: fix mp_unpack_ex so seq can't be reclaimed by GC during use - mpprint: support printing %ld and %lu formats on 64-bit archs - asmthumb: support asm_thumb code running on normal ARM processors - native: improve support for bool type in viper functions - remove "if (0)" and "if (false)" branches - objgenerator: fix handling of None passed as 2nd arg to throw() - objgenerator: remove unneeded forward decl and clean up white space - misc.h: rename _MP_STRINGIFY to not use leading underscore in ident - persistentcode: change "len" type to size_t for mp_obj_str_get_data - objarray: add support for memoryview.itemsize attribute - objarray: add decode method to bytearray - update makefiles to use $(CAT) variable instead of hard coded "cat" - update makefiles to use $(TOUCH) instead of hard coded "touch" extmod: - moduzlib: update to uzlib 2.9.2 - modlwip: add support for polling UDP sockets for writability - moduhashlib: include implementation of sha256 only when required - convert legacy uppercase macro names to lowercase - moduwebsocket: refactor `websocket` to `uwebsocket` - modlwip: change #ifdef to #if for check of MICROPY_PY_LWIP - modlwip: fix bug when polling listening socket with backlog=1 - modlwip: add concurrency protection macros - modwebrepl: fix logic to handle a put of file of size 0 - vfs_fat: update for new oofatfs version - modlwip: fix case where concurrency lock isn't released on error - moduselect: adjust select_select and poll_register to use size_t - vfs_fat: fallback to FAT32 if standard FAT16/SFD format fails - modlwip: handle case of connection closing while on accept queue - modlwip: handle case of accept callback called with null PCB - modlwip: protect socket.accept with lwIP concurrency lock - modlwip: free any stored incoming bufs/connections on TCP error - modlwip: use correct listening socket object in accept callback - modlwip: abort TCP conns that didn't close cleanly in a while - modurandom: add init method to seed the Yasmarang generator - machine_signal: fix fault when no args are passed to Signal() - modussl_mbedtls: support non-blocking handshake - modussl_axtls: add non-blocking mode support - moducryptolib: add optional AES-CTR support - modujson: handle parsing of floats with + in the exponent - machine_i2c: change C-level API to allow split I2C transactions - machine_i2c: remove need for temporary memory in writemem() call - machine_i2c: add i2c.writevto() that can write a vector of bufs - modlwip: free any incoming bufs/connections before closing PCB - modlwip: register TCP close-timeout callback before closing PCB lib: - utils/pyexec: implement paste mode with event driven REPL - utils/printf: exclude __GI_vsnprintf alias for gcc 9 and above - utils/gchelper_m3: add license header and clean up code - utils/gchelper_m3: add gc_helper_get_sp() function - utils/gchelper: add gchelper.h header file for assembler functions - netutils: add function to print tracing info for Ethernet frames - oofatfs: update oofatfs library to R0.13c working branch - oofatfs: update ffconf.h config for new oofatfs version - oofatfs: update oofatfs library to fix issue with logic not - stm32lib: update library to fix F7 MMC capacity calculation - utils/pyexec: add pyexec_file_if_exists() helper function - utils: make pyexec_file_if_exists run frozen scripts if they exist - utils/interrupt_char: invalidate interrupt char at start up - stm32lib: update library to fix UART9/10 baudrate on F4 MCUs - nrfx: upgrade nrfx to v1.7.1 plus a UART bug fix drivers: - memory/spiflash: rework wait_sr to fix uninit'd variable 'sr' - display/ssd1306.py: change to use new i2c.writevto() method tools: - mpy-tool.py: add support for freezing native code - upip.py: use "raise arg" instead of no-arg raise form, for native - pyboard.py: add missing line from example usage comments - mpy-tool.py: adjust use of super() to make it work with Python 2 - mpy-tool.py: fix init of QStrWindow, and remove unused variable - pyboard.py: don't accumulate output data if data_consumer used - upip.py: add support for multiple index URLs with custom default tests: - basics: add tests for try-except-else and try-except-else-finally - run-tests: support running native tests via mpy - import: add test for importing x64 native code - extmod: add test for FAT filesystem on a very large block device - run-tests: ignore exception in process kill when ending repl test - micropython: add some tests for failed heap allocation - skip tests needing machine module if (u)machine doesn't exist - ussl_basic: disable setblocking() calls - basics/sys1.py: add test for calling sys.exit() without any args - pyb: update UART expected output now that default timeout is 0 - basics: add coverage tests for memoryview attributes mpy-cross: - enable building of x64 native .mpy files - add "-march=" option to select native emitter - support compiling with MICROPY_PY___FILE__ enabled - automatically select ARMV6 arch when running on such a host - add --version command line option to print version info all ports: - change PYB message prefix to MPY - convert legacy uppercase macro names to lowercase - update to work with new oofatfs version - {stm32,esp8266}: set mpy-cross native arch for frozen native code - convert to use pyexec_file_if_exists() to execute boot/main.py unix port: - mpthreadport: add thread deinit code to stop threads on exit - mpthreadport: cleanup used memory on thread exit - mpthreadport: remove busy wait loop in thread garbage collection - modmachine: handle repeated /dev/mem open errors - modffi: eliminate unused-argument warning when debugging disabled - Makefile: update coverage tests to match those in Travis - mpthreadport: use named semaphores on Mac OS X - gcollect: make sure stack/regs get captured properly for GC - coverage: add test for printing literal % character - modusocket: fix use of setsockopt in usocket.settimeout impl - modusocket: raise ETIMEDOUT when connect or accept has timeout windows port: - fix line wrapping behaviour on the REPL qemu-arm port: - rework to run bare-metal on boards with Cortex-M CPUs - use gchelper code to get registers for GC scanning stm32 port: - implement machine.lightsleep() - rtc: check RTCEN=1 when testing if RTC is already running on boot - usbdev: add USB config option for board being self powered - usbdev: add USB config option for max power drawn by the board - main: make board-defined UART REPL use a static object and buffer - boards/stm32f429_af.csv: fix typos in UART defs Tx->TX and Rx->RX - mboot: add option to autodetect the USB port that DFU uses - sdcard: don't use SD clock bypass on F7 MCUs - usb: add flow control option for USB VCP data received from host - boards/make-pins.py: add basic support for STM32H7 ADC periphs - boards/stm32h743_af.csv: add ADC entries to pin capability table - adc: add basic support for ADC on a pin on STM32H7 MCUs - mboot: use USB HS as main USB device regardless of USB_HS_IN_FS - mboot: add support for STM32F769 MCUs - mboot: add support for GPIO ports G, H, I and J - mboot: allow deploying via deploy-stlink - usb: use USB HS as main USB device regardless of USB_HS_IN_FS - usbd_conf: fully support USB HS with external PHY - modmachine: make bootloader() enter custom loader if it's enabled - boards/STM32F769DISC: support the use of USB HS with external PHY - boards/STM32F769DISC: configure for use with mboot by default - systick: rename sys_tick_XXX functions to systick_XXX - systick: make periodic systick callbacks use a cyclic func table - pendsv: clean up pendsv IRQ handler and eliminate duplicate code - pendsv: add ability to schedule callbacks at pendsv IRQ level - systick: provide better compile-time configurability of slots - modnetwork: change lwIP polling to be based on background systick - move gchelper assembler code to lib/utils for use by other ports - gccollect: use gchelper.h header instead of explicit declaration - pendsv: fix inline asm constant and prefix with # character - mboot/Makefile: support specifying BOARD_DIR for custom board - boards/NUCLEO_L476RG: add support for RNG, DAC and CAN1 - boards/make-pins.py: add cmdline options to support use by mboot - mboot/Makefile: generate all pin header files from board pins.csv - mboot/mphalport.h: include genhdr/pins.h for access to pin names - qspi: use static af functions for pin configuration - mboot: add support for loading gzip'd firmware from a filesystem - mboot: move some BSS vars to new section that isn't zeroed out - mboot: add support script which can program mboot and application - modmachine: add ability to pass through user data to mboot - mboot: add hook to run board-specific code early on startup - boards/stm32f429.ld: increase uPy heap size by 64k for F429 MCU - extint: fix ExtInt to work with non-GPIO pins - extint: fix RTC Alarm/FS USB EXTI constants for L4 - make-stmconst.py: improve regex to parse more constants - extint: add non-GPIO EXTI IRQ sources for F0 - extint: remove unused (and incorrect) EXTI defines - stm32_it: fix RTC IRQ handler to handle all EXTI IRQs on F0 MCUs - sdram: increase GPIO speed for SDRAM interface to "very high" - boards/NUCLEO_F767ZI: fix up comments about HCLK computation - mphalport: add mp_hal_get_mac() helper function - eth: add low-level Ethernet MAC driver - network_lan: add high-level network.LAN interface to ETH driver - mpconfigport.h: enable lwIP concurrency protection mechanism - modnetwork: don't call NIC callback if it's NULL - boards/NUCLEO_F767ZI: enable lwIP and Ethernet peripheral - boards/STM32F7DISC: enable lwIP and Ethernet peripheral - boards/STM32F769DISC: enable lwIP and Ethernet peripheral - boards/NUCLEO_F429ZI: enable lwIP and Ethernet peripheral - qspi: enable sample shift and disable timeout counter - Makefile: allow a board to specify its linker sections for FW - boards/STM32F769DISC: use external QSPI flash to store some code - use global lwip build config and support building without lwip - boards: update to use new build config for lwip component - add compile-time option to use HSI as clock source - mboot: update to match latest oofatfs version - allow to build with threading with the GIL disabled - qspi: set pin speed to very-high and allow to config some options - usb: allow to override USB strings & VID/PID in app and mboot - stm32_it: guard UART7_IRQHandler with check for UART7 define - mboot: set USE_MBOOT=1 by default in the Makefile - system_stm32: provide default value for HSI calibration - mpconfigport.h: remove malloc/free/realloc helper macros - boards/STM32L476DISC: enable servo support on STM32L476DISC board - Makefile: allow to override CROSS_COMPILE with included Makefile - make default USB_VCP stream go through uos.dupterm for main REPL - timer: expose the PWM BRK capability of Timer 1 and 8 - uart: handle correctly the char overrun case of RXNE=0 and ORE=1 - rename MICROPY_HW_HAS_SDCARD to MICROPY_HW_ENABLE_SDCARD - add support for MMC driver, exposed via pyb.MMCard class - moduos: allow to compile again without USB enabled - network_wiznet5k: add ability to trace Ethernet TX and RX frames - network_wiznet5k: add ability to set the MAC address - network_wiznet5k: automatically set MAC if device doesn't have one - i2cslave: add support for H7 MCUs - usbd_conf: add support for USB HS peripheral on H7 MCUs - mboot: add support for H7 MCUs, with H743 flash layout - boards/NUCLEO_H743ZI: add config options to support mboot - boards/NUCLEO_L432KC: disable complex nos and default frozen mods - rtc: add auto-LSE-bypass detection with fallback to LSE then LSI - rtc: remove unused LSE detection code - rtc: remove non-ASCII mu-character from source code comment - timer: correctly initialise extended break settings on F7/H7/L4 - system_stm32f0: enable PWR clock on startup - system_stm32f0: add support for using HSE and PLL as SYSCLK - powerctrl: enable EIWUP to ensure RTC wakes device from standby - dac: rework DAC driver to use direct register access - usbdev: make USB device descriptors at runtime rather than static - usb: add USB device mode for VCP+VCP without MSC - powerctrl: deselect PLLSAI as 48MHz src before turning off PLLSAI - usb: remove mp_hal_set_interrupt_char now that it's reset at boot - main: increase default UART REPL rx buffer from 64 to 260 bytes - powerctrl: support changing frequency when HSI is clock source - flash: fix bug computing page number for L432 page erase - add support for F413 MCUs - boards: add NUCLEO_F413ZH board configuration - machine_uart: change default UART timeout to 0, for non blocking - move factory reset files and code to separate source file - usbd_cdc_interface: don't retransmit chars if USB is reconnected - rtc: allow overriding startup timeouts from mpconfigboard - dma: initialise all members of DMA structs for H7 MCUs - dma: always reset and configure the H7 DMA peripheral - spi: enable SPI IRQs and add IRQHandlers for H7 MCUs - irq: fix IRQ_ENABLE_STATS stats config to work on all MCUs - boards/NUCLEO_H743ZI: enable SPI3 on this board - modmachine: create dedicated asm function to branch to bootloader - adc: fix VBAT_DIV to be 4 for STM32F411 - machine_i2c: update to support new C-level I2C API - i2c: make timeout for hardware I2C configurable - machine_i2c: simplify ROM initialisation of static HW I2C objects - i2c: support setting the I2C TIMINGR value via keyword arg - sdcard: add switch break to ensure only correct SD/MMC IRQ is run - sdram: update MPU settings to block invalid region, change attrs - mboot/README: fix some typos, describe bootloader and fwupdate.py - modmachine: in bootloader() disable caches before reset of periphs cc3200 port: - mods/modussl: fix ca_certs arg validation in mod_ssl_wrap_socket - modmachine: rename machine.sleep to machine.lightsleep - use common gchelper_m3.s code from lib/utils - mpconfigport.h: disable compiler optimisation of OrderedDict esp8266 port: - modmachine: implement optional time_ms arg to machine.deepsleep - modmachine: rename machine.sleep to machine.lightsleep - modmachine: implement simple machine.lightsleep function - modmachine: in lightsleep, only waiti if wifi is turned off - modmachine: call ets_event_poll after waiti in machine.idle - modmachine: handle overflow of timer to get longer periods - fix ticks_ms to correctly handle wraparound of system counter esp32 port: - don't put py/scheduler.o in iRAM, it's no longer needed - Makefile: put all IDF compenents in .a libs to use IDF ld script - update to latest ESP IDF using sdkconfig and new ldgen procedure - machine_timer: deinit all active timers on soft reset - Makefile: make sure that directory exists for sdkconfig.h - boards: use auto xtal freq config instead of default 40MHz - modsocket: fix crashes when connect/bind can't resolve given addr - modmachine: rename machine.sleep to machine.lightsleep - use SPIRAM in mem-map mode so all of it can be used for uPy heap - modmachine: add support for changing the CPU frequency - modsocket: fix usocket.send to accept anything with buffer proto - modsocket: change socket.socket to be socket type rather than fun - network_lan: add arg to constructor to set clock mode for ETH PHY - modnetwork: catch and report Ethernet events - network_lan: make power arg to constructor optional - modnetwork: fix wifi.isconnected to return False after disconnect - modnetwork: implement RSSI for WiFi STA via WLAN.status('rssi') - modnetwork: remove redundant esp_log include - Makefile: add some missing IDF source files to bootloader and app - mphalport: use ets_delay_us for mp_hal_delay_us_fast - machine_pin: make it so None as pull value disables pull up/down - machine_pin: add new PULL_HOLD pin pull mode - machine_pin: rework pull mode config to fix GPIO hold feature - mpthreadport: exit vPortCleanUpTCB early if threading not init'd - boards: enable dual core support by default - boards/sdkconfig: disable WDT check of idle task on CPU1 - README: add info about pyparsing and the correct Python version - machine_wdt: add timeout arg to select interval, make WDT panic - modnetwork: change type to size_t for uses of mp_obj_str_get_data - machine_uart: implement UART.deinit() method - network_ppp: add a timeout for closing PPP connection - machine_touchpad: use HW timer for FSM to enable wake-on-touch - modsocket: raise EAGAIN when accept fails in non-blocking mode javascript port: - add new port targeting JavaScript via Emscripten - fix Emscripten async load, and to compile with modern clang - library: use Buffer.alloc() since new Buffer() is deprecated - pass (error) exit value out from script to process caller - Makefile: fix unrepresentable float error by using clamp - library: print data as raw bytes to stdout so unicode works nrf port: - modmachine: rename machine.sleep to machine.lightsleep - uart: use formula instead of switch for baudrate calculation - uart: remove unused machine.UART() parameters - shrink " does not exist" error messages - pin: cleanup Pin.__str__ to print relevant information - pin: print pull information in Pin.__str__ - ticker: remove duplicate NRFX_IRQ_PRIORITY_SET - timer: fix disabling Timer 1 when using soft PWM - readme: update link to nrfjprog download - bluetooth: improve advertisment behavior for nrf52 targets - bluetooth: resolve compilation warning in ble_drv.c - readme: update make flash command when defining board - pwm: remove superfluous NULL in machine_hard_pwm_instances - bluetooth: add support for SoftDevice s132 version 6.1.1 - board: migrate all nrf52832 targets to new BLE stack - bluetooth: deprecate use of SoftDevice s132 v6.0.0 - bluetooth: add support for SoftDevice s140 version 6.1.1 - board: migrate nrf52840 target to new BLE stack - bluetooth: deprecate use of SoftDevice s140 v6.0.0 - readme: add section about LTO - Makefile: update to match latest oofatfs version - boards: add support for BLYST Nano module based boards - change types to size_t for all uses of mp_obj_str_get_data - machine/i2c: update to support new C-level I2C API - nrfx_glue: adapt to nrfx v.1.7.1 - uart: change UART driver to be non-blocking and use IRQs - mpconfigport.h: enable MICROPY_KBD_EXCEPTION by default - uart: make UART print output something, and add write method - mphalport: use wfi to save power while waiting at the UART REPL zephyr port: - modzephyr: revamp stacks_analyze() call - modzsensor: rename "TEMP" sensor channel to "DIE_TEMP" - prj_minimal.conf: switch to CONFIG_STDOUT_CONSOLE - Makefile: proxy ram_report, rom_report targets from Zephyr - prj_frdm_k64f.conf: add fxos8700 sensor - prj_frdm_kw41z.conf: add new board configuration - i2c: add support for hardware i2c - CMakeLists.txt: set AR to point to the Zephyr toolchain exe - machine_i2c: update to support new C-level I2C API - switch back to enabling I2C in board-specific configs docs: - machine: change sleep to lightsleep and add timeout arguments - convert all cases of machine.sleep to machine.lightsleep - ure: fix match.group signature to indicate index param is required - uos: document extra requirements on stream objs passed to dupterm - pyboard: add link to pyboard v1.1 schematic and layout PDF - pyboard: make pyboard v1.1 pinout the default shown in quickref - develop: fix typos in C-module example for example_add_ints - library/machine.Pin: add PULL_HOLD constant to possible pin pulls - esp32: add a note to quickref about use of Pin.PULL_HOLD - esp32: add example for pin isolation in combination with deepsleep - develop: remove paragraph that was copied in error from other doc - cmodules: fix example to globally define MODULE_EXAMPLE_ENABLED - cmodules: note the various ways MODULE_EXAMPLE_ENABLED can be set - esp8266: add tutorial for APA102 LEDs - esp32: correct quickref for ESP32 hardware SPI with non-default IO - machine.I2C: add writevto method to write a vector of byte bufs - pyboard/quickref: refer to new machine.I2C instead of old pyb.I2C travis: - update to use Ubuntu 16.04 Xenial for CI builds - enable test for running native code via mpy ======== Sat, 26 Jan 2019 00:56:48 +1100 v1.10 Vast improvements to native emitter, new nrf port, unified documentation In this release there are a wide range of improvements and additions to both the core and the ports. In the core the main improvement was to the native emitter to have much more comprehensive support for general Python features, such as generators and complex exception handling, and the generated machine code is smaller and retains its efficiency. Elsewhere, fuzzy testing was used to find and eliminate some corner-case bugs, user classes were optimised when they don't use special accessors, underscores in numeric literals are now supported (PEP515), and the uio.IOBase class was added to allow user defined streams. For the extended modules there is now a VfsPosix filesystem component, a new ucryptolib module with AES support, addition of ure.sub() and of uhashlib.md5, and the lwIP socket implementation now has working TCP listen/accept backlog. Compared to the last release the minimal baseline core code size is reduced by about 2.2%, down by roughly 1500 bytes for bare-arm port and 3500 bytes for minimal x86 port. Most other ports have increased in size due to the addition of new features (eg ucryptolib, ure.sub). The stm32 port sees the introduction of a new bootloader -- mboot -- which supports DFU upload via USB FS, USB HS, as well as a custom I2C protocol, and also support to program external SPI flash. There is significant refactoring of the USB device driver, improved VCP throughput, and support for 2x VCP interfaces on the one USB device. lwIP has been integrated, and support added for SDRAM. Cortex-M0 CPUs are now supported along with STM32F0 MCUs. For the esp8266 port the heap is increased by 2kbytes, the radio is automatically put to sleep if no WLAN interfaces are active, and the UART can now be disconnected from the REPL and its RX buffer length configured. Upon soft-reset sockets are now cleaned up. The esp32 port has added support for external SPI RAM, PPPoS functionality, improved performance and stability when using threads, and other general bug fixes. There is a new nrf port for Nordic MCUs, currently supporting nRF51x and nRF52x chips. The docs have now been unified so there is just one set of documentation covering all ports. And initial documentation for the esp32 port is added. There are two changes at the Python API level that are not backwards with previous versions: - uos.dupterm now requires that a stream passed to it is derived from uio.IOBase (or is a native stream object). - The esp32 neopixel driver has had its default timing changed from 400kHz to 800kHz; existing code that didn't explicitly specify the "timing" parameter in the NeoPixel constructor may need to be updated to specify this as "timing=0" to get 400kHz timing. A detailed list of changes follows. py core: - mpconfig.h: be stricter when autodetecting machine endianness - mpstate.h: adjust start of root pointer section to exclude non-ptrs - nlrx86: use naked attribute on nlr_push for gcc 8.0 and higher - vm: adjust #if logic for gil_divisor so braces are balanced - objfun: fix variable name in DECODE_CODESTATE_SIZE() macro - vm: use enum names instead of magic numbers in multi-opcode dispatch - vm: improve performance of opcode dispatch when using switch stmt - repl: fix handling of unmatched brackets and unfinished quotes - misc.h: add MP_STATIC_ASSERT macro to do static assertions - compile: change comment about ITER_BUF_NSLOTS to a static assertion - emitbc: avoid undefined behavior calling memset() with NULL 1st arg - parsenum: use int instead of mp_int_t for parsing float exponent - parsenum: avoid undefined behavior parsing floats with large exponents - objfloat: fix undefined shifting behavior in high-quality float hash - mpz: avoid undefined behavior at integer overflow in mpz_hash - objfloat: fix undefined integer behavior hashing negative zero - gc: when GC threshold is hit don't unnecessarily collect twice - parsenum: adjust braces so they are balanced - modbuiltins: add support for rounding integers - objgenerator: save state in old_globals instead of local variable - objgenerator: protect against reentering a generator - emit: combine fast and deref into one function for load/store/delete - emit: combine yield value and yield-from emit funcs into one - emit: combine build tuple/list/map emit funcs into one - emit: combine name and global into one func for load/store/delete - emit: combine load/store/delete subscr into one emit function - emit: combine load/store/delete attr into one emit function - emit: combine break_loop and continue_loop into one emit function - emit: combine import from/name/star into one emit function - emit: merge build set/slice into existing build emit function - emit: combine setup with/except/finally into one emit function - objtype: fix assertion failures in mp_obj_new_type by checking types - objtype: fix assertion failures in super_attr by checking type - stream: move definition of mp_stream_p_t from obj.h to stream.h - reader: allow MICROPY_VFS_POSIX to work with MICROPY_READER_POSIX - mpconfig.h: add default MICROPY_VFS_FAT config value - obj.h: introduce a "flags" entry in mp_obj_type_t - objtype: don't expose mp_obj_instance_attr() - objtype: optimise instance get/set/del by skipping special accessors - gc: add gc_sweep_all() function to run all remaining finalisers - lexer: add support for underscores in numeric literals - modio: add uio.IOBase class to allow to define user streams - mkrules.mk: regenerate all qstrs when config files change - stream: introduce and use efficient mp_get_stream to access stream_p - objarray: replace 0x80 with new MP_OBJ_ARRAY_TYPECODE_FLAG_RW macro - add checks for stream objects in print() and sys.print_exception() - compile: combine break and continue compile functions - compile: combine subscript_2 and subscript_3 into one function - compile: combine global and nonlocal statement compile functions - compile: combine or_test and and_test compile functions - compile: combine expr, xor_expr and and_expr into one function - compile: handle return/break/continue correctly in async with - objgenerator: eliminate need for mp_obj_gen_wrap wrapper instances - obj.h: fix broken build for object repr C when float disabled - simplify some cases of accessing the map of module and type dict - objdict: make mp_obj_dict_get_map an inline function - objmodule: make mp_obj_module_get_globals an inline function - obj.h: give compile error if using obj repr D with single-prec float - malloc: give a compile warning if using finaliser without GC - objgenerator: implement __name__ with normal fun attr accessor code - emitnative: optimise for iteration asm code for non-debug build - runtime: use mp_obj_new_int_from_ll when return int is not small - stream: introduce MP_STREAM_GET_FILENO ioctl request - objstr: in format error message, use common string with %s for type - asmthumb: optimise native code calling runtime glue functions - mpconfig.h: introduce MICROPY_DEBUG_PRINTER for debugging output - fix compiling with debug enabled and make more use of DEBUG_printf - emitnative: factor common code for native jump helper - emitnative: fix x86 native zero checks by comparing full word - asmx86: use generic emit function to simplify cmp emit function - emitnative: fix native locals stack to start at correct location - emitnative: simplify handling of exception objects from nlr_buf_t - emitnative: allocate space for local stack info as it's needed - compile: for dynamic compiler, widen literal 1 to get correct shift - py.mk: don't hardcode path to libaxtls.a - gc: in gc_alloc, reset n_free var right before search for free mem - objarray: allow to build again when bytearray is disabled - stream: adjust mp_stream_posix_XXX to take void*, not mp_obj_t - emitnative: use small tables to simplify handling of local regs - asmxtensa: handle function entry/exit when stack use larger than 127 - asm*: support assembling code to jump to a register, and get PC+off - emitnative: optimise and improve exception handling in native code - asmxtensa: fix bug with order of regs in addi encoding - asmxtensa: optimise loading local addr and support larger offsets - emitnative: fix bug with store of 16 and 32 values in viper ARM mode - asmxtensa: use narrow version of add instr to reduce native code size - emitnx86: fix number of args passed to mp_setup_code_state, 4 not 5 - vm: fix handling of finally-return with complex nested finallys - emitnative: cancel caught exception once handled to prevent reraise - emitnative: add support for return/break/continue in try and with - compile: factor code that compiles start/end of exception handler - py.mk: build axtls library directly from its source files - runtime: fix incorrect test for MICROPY_PORT_DEINIT_FUNC - objarray: bytearray: allow 2nd/3rd arg to constructor - emitnative: fix try-finally in outer scope, so finally is cancelled - fix native functions so they run with their correct globals context - optimise call to mp_arg_check_num by compressing fun signature - asmx64: fix bug in assembler when creating disp with r13 and 0 offset - {asmx86,asmx64}: extend test_r8_with_r8 to accept all 8 lower regs - emit: move MP_EMIT_OPT_xxx enums from compile.h to emitglue.h - emit: remove need to call set_native_type to set native/viper mode - emit: remove need to call set_native_type to set viper return type - emit: completely remove set_native_type, arg type is set in compiler - compile: merge viper annotation and normal param compilation stages - compile: factor code that compiles viper type annotations - emitnative: reuse mp_native_type_from_qstr when searching for a cast - make viper functions have the same entry signature as native - emitnative: support arbitrary number of arguments to viper functions - emitnative: use macros instead of raw offsetof for slot locations - emitnative: make viper funcs run with their correct globals context - asmxtensa: make indirect calls using func table, not raw pointers - asmthumb: detect presence of I-cache using CMSIS macro - objtype: clarify comment about configuring inplace op methods - shorten error messages by using contractions and some rewording - objstr: make % (__mod__) formatting operator configurable - modbuiltins: make oct/hex work when !MICROPY_PY_BUILTINS_STR_OP_MODULO - objgenerator: implement PEP479, StopIteration convs to RuntimeError - parsenum: avoid rounding errors with negative powers-of-10 - modmath: add math.factorial, optimised and non-opt implementations - objstr: format: return bytes result for bytes format string - fix msvc C++ compiler warnings with MP_OBJ_FUN_MAKE_SIG macro - vm: make small optimisation of BUILD_SLICE opcode - objfloat: fix abs(-0.0) so it returns 0.0 - emitnative: place const objs for native code in separate const table - asm*: remove ASM_MOV_REG_ALIGNED_IMM emit macro, it's no longer used - emitnative: change type of const_table from uintptr_t to mp_uint_t - vm: fix case of throwing GeneratorExit type into yield-from - runtime: remove nlr protection when calling __next__ in mp_resume - objtype: support full object model for get/set/delitem special meths - vm: when VM raises exception put exc obj at beginning of func state - asmthumb: add wide ldr to handle larger offsets - asmthumb: clean up asm_thumb_bl_ind to use new optimised ldr helper - asmthumb: extend asm entry/exit to handle stack larger than 508 bytes - asmx86: comment out unused asm_x86_nop to prevent compiler warnings - asmx64: extend asm_x64_mov_reg_pcrel to accept high registers - asmxtensa: use proper calculation for const table offset - emitnative: reorder native state on C stack so nlr_buf_t is first - emitnative: implement yield and yield-from in native emitter - runtime: use mp_import_name to implement tail of mp_import_from - runtime: remove comment in mp_import_name about level being 0 - obj.h: use uint64_t instead of mp_int_t in repr-D MP_OBJ_IS_x macros - emitnative: clean up unused macro and forward function declarations - asmx64: change stack management to reference locals by rsp not rbp - asmx64: change indirect calls to load fun ptr from the native table - asmx86: change stack management to reference locals by esp not ebp - asmx86: change indirect calls to load fun ptr from the native table - emitnative: load native fun table ptr from const table for all archs - asmarm: simplify asm_arm_bl_ind to only load via index, not literal - asmthumb: remove unused fun_ptr arg from asm_thumb_bl_ind function - emitnative: remove unused ptr argument from ASM_CALL_IND macro - emitnative: consolidate use of stacked immediate values to one func - emitnative: simplify viper mode handling in emit_native_import_name - emitnative: push internal None rather than const obj where possible - emitnative: put None/False/True in global native const table - objtype: remove comment about catching exc from user __getattr__ - objstr: make str.count() method configurable - objmodule: implement PEP 562's __getattr__ for modules - py.mk: when building axtls use -Wno-all to prevent all warnings - compile: fix case of eager implicit conversion of local to nonlocal - compile: remove unneeded variable from global/nonlocal stmt helpers - scope: optimise scope_find_or_add_id to not need "added" arg - runtime: fix qstr assumptions when handling "import *" - unicode: fix check for valid utf8 being stricter about contn chars - py.mk: fix broken Gmane URL - add option to reduce GC stack integer size to save RAM - objboundmeth: support loading generic attrs from the method - obj: add support for __int__ special method - objexcept: use macros to make offsets in emergency exc buf clearer - objexcept: make sure mp_obj_new_exception_msg doesn't copy/format msg - objdict: make .fromkeys() method configurable - bc: fix calculation of opcode size for opcodes with map caching - qstr: put a lower bound on new qstr pool allocation - objarray: introduce "memview_offset" alias for "free" field of object - gc: adjust gc_alloc() signature to be able to accept multiple flags - mpconfig: move MICROPY_VERSION macros to static ones in mpconfig.h - runtime: unlock the GIL in mp_deinit function - get optional VM stack overflow check compiling and working again - fix location of VM returned exception in invalid opcode and comments - modio: make iobase_singleton object const so it goes in ROM - obj.h: explicitly cast args to uint32_t in MP_OBJ_FUN_MAKE_SIG extmod: - modlwip: update to work with lwIP v2.0 - modlwip: set POLLHUP flag for sockets that are new - modlwip: allow to compile with MICROPY_PY_LWIP disabled - modussl_mbedtls: populate sock member right away in wrap_socket - modussl_mbedtls: use mbedtls_entropy_func for CTR-DRBG entropy - vfs: use u_rom_obj properly in argument structures - vfs_fat: rename FileIO/TextIO types to mp_type_vfs_fat_XXX - add VfsPosix filesystem component - vfs: add fast path for stating VfsPosix filesystem - vfs: introduce a C-level VFS protocol, with fast import_stat - moduhashlib: prefix all Python methods and objects with uhashlib - moduhashlib: reorder funcs so that they are grouped by hash type - moduhashlib: allow to disable the sha256 class - moduhashlib: allow using the sha256 implementation of mbedTLS - moduhashlib: make function objects STATIC - uos_dupterm: use native C stream methods on dupterm object - modussl_axtls: fix __del__ to point to mp_stream_close_obj - vfs_fat_diskio: factor disk ioctl code to reduce code size - update to use new mp_get_stream helper - moducryptolib: add ucryptolib module with crypto functions - moducryptolib: optionally export MODE_* constants to Python - moducryptolib: refactor functions for clean interface with axTLS - moducryptolib: add an mbedTLS implementation for this module - moducryptolib: prefix all Python methods/objects with ucryptolib - moducryptolib: shorten exception messages to reduce code size - moducryptolib: don't include arpa/inet.h, it's not needed - modure: add match.groups() method, and tests - modure: add match.span(), start() and end() methods, and tests - modure: add ure.sub() function and method, and tests - vfs: support opening a file descriptor (int) with VfsPosix - fix to support compiling with object representation D - vfs_posix: support ilistdir with no (or empty) argument - vfs_posix: use DTTOIF if available to convert type in ilistdir - modlwip: deregister all lwIP callbacks when closing a socket - modussl: support polling in ussl objects by passing through ioctl - modbtree: update to work with new mp_stream_posix_XXX signatures - modussl_axtls: use MP_ROM_PTR for objects in allowed args array - moduhashlib: add md5 implementation, using axTLS - moduhashlib: use newer message digest API for mbedtls >=2.7.0 - moduhashlib: add md5 implementation using mbedtls - moductypes: remove BITFIELD from aggregate types enum - moductypes: accept OrderedDict as a structure description - modonewire: fix reset timings to match 1-wire specs - moductypes: make sizeof() accept "layout" parameter - modlwip: implement TCP listen/accept backlog - modlwip: fix read-polling of listening socket with a backlog - moductypes: implement __int__ for PTR - moductypes: add aliases for native C types lib: - lwip: update lwIP to v2.0.3, tag STABLE-2_0_3_RELEASE - stm32lib: update library to include support for STM32F0 MCUs - utils/printf: make DEBUG_printf implementation more accessible - utils: fix to support compiling with object representation D - utils: expose pyb_set_repl_info function public - libm_dbl/tanh: make tanh more efficient and handle large numbers - libm/math: make tanhf more efficient and handle large numbers - libm/wf_tgamma: fix tgammaf handling of -inf, should return nan - libm_dbl: add implementation of copysign() for DEBUG builds - stm32lib: update library to fix issue with filling USB TX FIFO - libm/math: fix int type in float union, uint64_t should be uint32_t - libm/math: add implementation of __signbitf, if needed by a port - utils/pyexec: forcefully unlock the heap if locked and REPL active - utils: add generic MicroPython IRQ helper functions - stm32lib: update library to get F413 BOR defs and fix gcc 8 warning drivers: - wiznet5k: fix bug with MACRAW socket calculating packet size - memory/spiflash: move cache buffer to user-provided config - memory/spiflash: rename functions to indicate they use cache - memory/spiflash: add functions for direct erase/read/write - sdcard: change driver to use new block-device protocol - sdcard: fix bug in computing number of sectors on SD Card - sdcard: do not release CS during the middle of read operations - cc3000: use cc3000_time_t instead of time_t for custom typedef - display/lcd160cr.py: in fast_spi, send command before flushing - sdcard: in test use os.umount and machine module instead of pyb - sdcard: remove debugging print statement in ioctl method - dht: allow open-drain-high call to be DHT specific if needed tools: - pydfu.py: increase download packet size to full 2048 bytes - pydfu.py: add support for multiple memory segments - pydfu.py: use getfullargspec instead of getargspec for newer pyusb - pydfu.py: workaround stdio flush error on Windows with Python 3.6 - pydfu.py: improve DFU reset, and auto-detect USB transfer size - mpy-tool.py: support freezing of floats in obj representation D - mpy-tool.py: put frozen bignum digit data in ROM, not in RAM - mpy-tool.py: set sane initial dynamic qstr pool size with frozen mods - mpy-tool.py: fix calc of opcode size for opcodes with map caching - mpy-tool.py: fix build error when no qstrs present in frozen mpy - dfu.py: pad image data to 8 byte alignment to support L476 - pyboard.py: run exec: command as a string - pyboard.py: change base class of PyboardError to Exception - pyboard.py: in TelnetToSerial.close replace try/except with if tests: - basics/special_methods2: enable some additional tests that work - add some tests for bigint hash, float hash and float parsing - extmod: add test for importing a script from a user VFS - extmod: remove conditional import of uos_vfs, it no longer exists - pyb: make i2c and pyb1 pyboard tests run again - io: add simple IOBase test - extmod: add test for VFS and user-defined filesystem and files - unix/extra_coverage: don't test stream objs with NULL write fun - extmod/ujson_dump.py: add test for dump to non-stream object - extmod: add test for ujson.dump writing to a user IOBase object - import: add test for importing invalid .mpy file - add tests using "file" argument in print and sys.print_exception - extmod/ucryptolib*: add tests for ucryptolib module - extmod/ucryptolib*: add into and inplace tests for ucryptolib - basics/namedtuple*: import ucollections first - move non-filesystem io tests to basics dir with io_ prefix - improve feature detection for VFS - run-tests: add nrf target - run-tests: improve crash reporting when running on remote targets - extmod/ujson_dump_iobase.py: return number of bytes written - make tests work on targets without float support - micropython/viper_cond: add test for large int as bool - run-tests: enable bool1.py test with native emitter - micropython: add tests for try and with blocks under native/viper - basics/set_pop.py: sort set before printing for consistent output - basics/int_big_error.py: use bytearray to test for int overflow - modify tests that print repr of an exception with 1 arg - basics: provide .exp files for generator tests that fail PEP479 - run-tests: enable native tests for unwinding jumps - basics: add more tests for return within try-finally - basics: add test cases for context manager raising in enter/exit - float/cmath_fun.py: fix truncation of small real part of complex - float: test -inf and some larger values for special math funcs - remove pyboard.py symlink and instead import from ../tools - extmod/uhashlib_md5: add coverage tests for MD5 algorithm - float/float_parse.py: add tests for accuracy of small decimals - cpydiff: add case for difference in behaviour of bytes.format() - micropython: test loading const objs in native and viper funcs - basics: split out gen throw tests from yield-from-throw tests - run-tests: enabled native tests that pass now that yield works - unix/ffi_float: skip if strtof() is not available - uselect_poll_basic: add basic test for uselect.poll invariants - uctypes_sizeof_od: test for using OrderedDict as struct descriptor - basics/class_getattr: remove invalid test for __getattribute__ - make bytes/str.count() tests skippable - extmod/uctypes_sizeof_layout: test for sizeof of different layout - import: add .exp file for module_getattr.py to not require Py 3.7 - cmdline/cmd_showbc.py: fix test to explicitly declare nonlocal - extmod: skip uselect test when CPython doesn't have poll() - import_long_dyn: test for "import *" of a long dynamic name - io: update tests to use uos.remove() instead of uos.unlink() - basics/special_methods: add testcases for __int__ - extmod/uctypes_ptr_le: test int() operation on a pointer field - extmod/uctypes_error: add test for unsupported unary op - run-tests: make .exp and .out file names unique by prefixing with dir mpy-cross: - make build independent of extmod directory - Makefile: also undefine MICROPY_FORCE_32BIT and CROSS_COMPILE minimal port: - main: allow to compile without GC enabled unix port: - support MICROPY_VFS_POSIX and enable it in coverage build - moduos_vfs: add missing uos functions from traditional uos module - mpconfigport.h: enable MICROPY_PY_UCRYPTOLIB - mpconfigport_coverage: enable ure groups, span, start, end and sub - modos: convert dir-type to stat-type for file type in ilistdir - use MP_STREAM_GET_FILENO to allow uselect to poll general objects - Makefile: coverage: Explicitly build "axtls" too - Makefile: enable ussl module with nanbox build - Makefile: remove building of libaxtls.a which is no longer needed - Makefile: build libffi inside $BUILD - mpconfigport_coverage.h: enable uhashlib.md5 - modos: include extmod/vfs.h for MP_S_IFDIR, etc - modjni: update .getiter signature to include mp_obj_iter_buf_t* - modjni: get building under coverage and nanbox builds - mpconfigport.h: enable MICROPY_PY_UHASHLIB_MD5 for uhashlib.md5 - moduselect: raise OSError(ENOENT) if obj to modify is not in poller - modusocket: initial implementation of socket.settimeout() - modusocket: finish socket.settimeout() implementation - modffi: add support for "q"/"Q" specs (int64_t/uint64_t) - Makefile: allow to override/omit pthread lib name - modos: rename unlink to remove to be consistent with other ports - enable MICROPY_PY_BUILTINS_ROUND_INT - enable uio.IOBase - call gc_sweep_all() when doing a soft reset windows port: - make printing of debugging info work out of the box - msvc: support custom compiler for header generation - msvc: implement file/directory type query - remove remaining traces of old GNU readline support stm32 port: - usbd_conf.h: remove unused macros and clean up header file - usbd_conf: changes files to unix line endings and apply styling - usbdev: convert files to unix line endings - usbdev: remove unused RxState variable, and unused struct - usbdev: be honest about data not being written to HID endpoint - usbd_hid_interface: address possible race condition vs. interrupt - i2c: add new hardware I2C driver for F4 MCUs - machine_i2c: use new F4 hardware I2C driver for machine.I2C class - accel: switch pyb.Accel to use new C-level I2C API - modpyb: introduce MICROPY_PY_PYB_LEGACY config option for pyb mod - pyb_i2c: put pyb.I2C under MICROPY_PY_PYB_LEGACY setting - modpyb: remove unused includes and clean up comments - usb: use usbd_cdc_itf_t pointer directly in USB_VCP class - usb: combine CDC lower-layer and interface state into one struct - usb: combine HID lower-layer and interface state into one struct - usb: make CDC endpoint definitions private to core usbdev driver - usb: change CDC tx/rx funcs to take CDC state, not usbdev state - usb: change HID report funcs to take HID state, not usbdev state - usb: add ability to have 2x VCP interfaces on the one USB device - usb: initialise cdc variable to prevent compiler warnings - enable UART7/8 on F4 series that have these peripherals - add support for STM32L496 MCU - boards: add board ld and af.csv files for STM32L496 MCU - boards: add config files for new board, STM32L496GDISC - rtc: don't try to set SubSeconds value on RTC - integrate lwIP as implementation of usocket module - rng: use Yasmarang for rng_get() if MCU doesn't have HW RNG - remove unneeded HTML release notes from usbdev and usbhost dirs - add low-level hardware I2C slave driver - add new component, the mboot bootloader - allow to have no storage support if there are no block devices - add support for Cortex-M0 CPUs - timer: make timer_get_source_freq more efficient by using regs - allow a board to disable MICROPY_VFS_FAT - boards: add startup_stm32f0.s for STM32F0 MCUs - add support for STM32F0 MCUs - boards: add alt-func CSV list and linker script for STM32F091 - boards: add NUCLEO_F091RC board configuration files - README: update to include STM32F0 in list of supported MCUs - boards: split combined alt-func labels and fix some other errors - boards: ensure USB OTG power is off for NUCLEO_F767ZI - flash: increase H7 flash size to full 2MiB - modnetwork: don't take netif's down when network is deinited - modnetwork: change base entry of NIC object from type to base - modnetwork: provide generic implementation of ifconfig method - add network driver for Wiznet5k using MACRAW mode and lwIP - modnetwork: fix arg indexing in generic ifconfig method - mpconfigport.h: enable DELATTR_SETATTR and BUILTINS_NOTIMPLEMENTED - mboot: increase USB rx_buf and DFU buf sizes to full 2048 bytes - Makefile: rebuild all qstrs when any board configuration changes - boards/STM32L476DISC: update SPI flash config for cache change - timer: support TIM1 on F0 MCUs - i2c: fix num_acks calculation in i2c_write for F0 and F7 MCU's - i2cslave: fix ordering of event callbacks in slave IRQ handler - mboot: adjust user-reset-mode timeout so it ends with mode=1 - boards/stm32f091_af.csv: split labels that are multiple funcs - boards/NUCLEO_F091RC: add Arduino-named pins and rename CPU pins - can: use MP_OBJ_ARRAY_TYPECODE_FLAG_RW where appropriate - spi: fix SPI driver so it can send/recv more than 65535 bytes - mboot: define constants for reset mode cycling and timeout - boards/NUCLEO_F091RC: fix TICK_INT_PRIORITY so it is highest prio - qspi: don't require data reads and writes to be a multiple of 4 - mboot: add support for erase/read/write of external SPI flash - boards: add .ld and af.csv files for STM32F722 - modnetwork: fix query of DNS IP address in ifconfig() - mboot: fix bug with invalid memory access of USB state - mboot: only compile in code for the USB periph that is being used - mboot: always use a flash latency of 1WS to match 48MHz HCLK - access dict map directly instead of using helper function - support compiling with object representation D - fatfs_port: fix bug when MICROPY_HW_ENABLE_RTC not enabled - timer: use enum for indexing keyword arg in pyb_timer_init_helper - timer: add tick_hz arg to Timer constructor and init method - mphalport: make mp_hal_stdin_rx_chr/stdout_tx_strn weakly linked - flashbdev: fix bug with L4 block cache, dereferencing block size - add method for statically configuring pin alternate function - sdcard: use mp_hal_pin_config_alt_static to configure SD card pins - sdram: add SDRAM driver from OpenMV project - sdram: integrate SDRAM driver into rest of code - sdram: on F7 MCUs enable MPU on external SDRAM - boards/STM32F429DISC: enable onboard SDRAM - sdcard: get SDMMC alt func macro names working with F4,F7,H7 MCUs - Makefile: use -Wno-attributes for ll_usb.c HAL source file - rtc: get rtc.wakeup working on F0 MCUs - modmachine: get machine.sleep working on F0 MCUs - extint.h: use correct EXTI lines for RTC interrupts - modmachine: get machine.sleep working on L4 MCUs - adc: disable VBAT in read channel helper function - adc: fix ADC reading on F0 MCUs to only sample a single channel - spi: round up prescaler calc to never exceed requested baudrate - sdram: allow additional config by a board, and tune MPU settings - boards/STM32F429DISC: add burst len and autorefresh to SDRAM cfg - boards/STM32F7DISC: enable onboard SDRAM - spi: split out pyb.SPI and machine.SPI bindings to their own files - spi: add implementation of low-level SPI protocol - mboot/main: use correct formula for DFU download address - Makefile: allow external BOARD_DIR directory to be specified - boards/STM32L476DISC: enable external RTC xtal to get RTC working - for MCUs that have PLLSAI allow to set SYSCLK at 2MHz increments - dma: pass DMA direction as parameter to dma_init not in cfg struct - dma: reinitialise the DMA if the direction changed on the channel - sdcard: use only a single DMA stream for both SDIO TX/RX - sdcard: move temporary DMA state from BSS to stack - spi: be sure to set all SPI config values in SPI proto init - change flash IRQ priority from 2 to 6 to prevent preemption - flashbdev: protect flash writes from cache flushing and USB MSC - sdcard: fully reset SDMMC periph before calling HAL DMA functions - dma: get DMA working on F0 MCUs - sdram: add support for 32-bit wide data bus and 256MB in MPU cfg - boards/STM32F769DISC: add optional support for external SDRAM - add support for STM32F765xx MCUs - Makefile: include copysign.c in double precision float builds - adc: fix ADC calibration scale for L4 MCUs, they use 3.0V - adc: increase sample time for internal sensors on L4 MCUs - dcmi: add F4/F7/H7 hal files and dma definitions for DCMI periph - uart: add support for USART3-8 on F0 MCUs - boards/NUCLEO_F091RC: enable USART3-8 with default pins - modmachine: re-enable PLLSAI[1] after waking from stop mode - powerctrl: move function to set SYSCLK into new powerctrl file - powerctrl: fix configuring APB1/APB2 frequency when AHB also set - powerctrl: factor code to set RCC PLL and use it in startup - powerctrl: factor code that configures PLLSAI on F7 MCUs - powerctrl: optimise passing of default values to set_sysclk - powerctrl: don't configure clocks if already at desired frequency - usbd_conf: allocate enough space in USB HS TX FIFO for CDC packet - mpconfigport.h: enable math.factorial, optimised version - main: add configuration macros for board to set heap start/end - usbd_cdc_interface: handle disconnect IRQ to set VCP disconnected - usbd_cdc_interface: refactor USB CDC tx code to not use SOF IRQ - spi: fix calculation of SPI clock source on H7 MCUs - boards/stm32h743.ld: fix total flash size, should be 2048k - system_stm32: introduce configuration defines for PLL3 settings - adc: add ADC auto-calibration for L4 MCUs - flashbdev: add missing include for irq.h - servo: only initialise TIM5 if it is needed, to save power - usb: fully deinitialise USB periph when it is deactivated - powerctrl: move (deep)sleep funcs from modmachine.c to powerctrl.c - powerctrl: disable IRQs during stop mode to allow reconfig on wake - boards/STM32F429DISC: enable UART as secondary REPL - uart: always show the flow setting when printing a UART object - mboot: provide led_state_all function to reduce code size - mboot: add support for 4th board LED - boards: add configuration for putting mboot on PYBv1.x - mboot: add documentation for using mboot on PYBv1.x - powerctrl: add support for standby mode on L4 MCUs - uart: add rxbuf keyword arg to UART constructor and init method - boards: add STM32L432KC chip configuration files - add peripheral support for STM32L432 - boards: add NUCLEO_L432KC board configuration files - split out UART Python bindings from uart.c to machine_uart.c - uart: factor out code from machine_uart.c that computes baudrate - uart: rework uart_get_baudrate so it doesn't need a UART handle - uart: factor out code to set RX buffer to function uart_set_rxbuf - uart: remove HAL's UART_HandleTypeDef from UART object struct - uart: simplify deinit of UART, no need to call HAL - uart: for UART init, pass in params directly, not via HAL struct - uart: move config of char_width/char_mask to uart.c - uart: add ability to have a static built-in UART object - extint: use correct EXTI channels on H7 MCUs for RTC events - adc: fix calibrated volt/temp readings on H7 by using 16bit scale - adc: increase ADC sampling time for internal sources on H7 MCUs - adc: support 16-bit ADC configuration on H7 MCUs - boards: allow OpenOCD stm_flash procedure to accept single FW img - boards/NUCLEO_L432KC: specify L4 OpenOCD config file for this MCU - main: add board config option to enable/disable mounting SD card - implement UART.irq() method with initial support for RX idle IRQ - uart: fix uart_rx_any in case of no buffer to return 0 or 1 - uart: always enable global UART IRQ handler on init - uart: clear overrun error flag after reading RX data register - uart: make sure user IRQs are handled even with a keyboard intr - modmachine: fix reset_cause to correctly give DEEPSLEEP on L4 MCU - sdcard: properly reset SD periph when SDMMC2 is used on H7 MCUs - wdt: make singleton WDT object const so it goes in ROM - main: make thread and FS state static and exclude when not needed - use MICROPY_GC_STACK_ENTRY_TYPE to save some RAM - .gitattributes: remove special text handling of stm32 usbdev files - enable MICROPY_PY_BUILTINS_ROUND_INT - enable descriptors - enable uio.IOBase - enable ure.sub() - call gc_sweep_all() when doing a soft reset cc3200 port: - mods: include stream.h to get definition of mp_stream_p_t - mods: access dict map directly instead of using helper func - use MICROPY_GC_STACK_ENTRY_TYPE to save some RAM esp8266 port: - mpconfigport.h: add some weak links to common Python modules - modnetwork: return empty str for hostname if STA is inactive - modnetwork: raise ValueError when getting invalid WLAN id - modmachine: allow I2C and SPI to be configured out of the build - change UART(0) to attach to REPL via uos.dupterm interface - modules/ntptime.py: remove print of newly-set time - mpconfigport.h: enable ucryptolib module for standard build - esp8266_common.ld: put mp_keyboard_interrupt in iRAM - modesp: run ets_loop_iter before/after doing flash erase/write - let machine.WDT trigger the software WDT if obj is not fed - Makefile: remove build of libaxtls.a and add back tuned config - main: increase heap by 2kb, now that axtls rodata is in ROM - remove scanning of GC pointers in native code block - ets_alt_task: process idle callback if no other events occurred - modnetwork: automatically do radio sleep if no interface active - modnetwork: wait for iface to go down before forcing power mgmt - machine_uart: add rxbuf keyword arg to UART constructor/init - main: activate UART(0) on dupterm for REPL before boot.py runs - esp_mphal: provide mp_hal_pin_od_high_dht so DHT works reliably - implement high-res timers using new tick_hz argument - use MICROPY_GC_STACK_ENTRY_TYPE to save some RAM - enable MICROPY_PY_BUILTINS_ROUND_INT - enable descriptors - enable uio.IOBase - enable ure.sub() - call gc_sweep_all() when doing a soft reset, cleans up sockets esp32 port: - update to latest ESP IDF version - modnetwork: fix STA/AP activate/deactivate for new IDF API - Makefile: update to latest ESP IDF version - esp32.custom_common.ld: put soc code in iram0 - silence ESP-IDF log messages when in raw REPL mode - Makefile: extract common C & C++ flags for consistent compilation - add support for building with external SPI RAM - modnetwork: fix isconnected() when using static IP config - remove port-specific uhashlib implementation and use common one - fatfs_port: implement get_fattime so FAT files have a timestamp - update to latest ESP IDF - modules: include umqtt library in frozen modules - mpconfigport.h: enable ucryptolib module - allow to build with uPy floats disabled - reduce latency for handling of scheduled Python callbacks - modnetwork: add support for bssid parameter in WLAN.connect() - implement WLAN.status() return codes - modesp32: add raw temperature reading to esp32 module - modesp32: use MP_ROM_QSTR and MP_ROM_PTR in const locals dict - modnetwork: add network.(W)LAN.ifconfig('dhcp') support - update to latest ESP IDF - fix int overflow in machine.sleep/deepsleep functions - machine_rtc: fix locals dict entry, init qstr points to init meth - modesp32: add hall_sensor() function - network_ppp: add PPPoS functionality - mpthreadport: prevent deadlocks when deleting all threads - allocate task TCB and stack from system heap not uPy heap - machine_uart: add txbuf/rxbuf keyword args to UART construct/init - machine_uart: implement UART.sendbreak() method - machine_pwm: support higher PWM freq by auto-scaling timer res - machine_pwm: on deinit stop routing PWM signal to the pin - modmachine: enable machine.sleep() now that the IDF supports it - mphalport: when tx'ing to REPL only release GIL if many chars sent - modsocket: for socket read only release GIL if socket would block - machine_pin: add Pin.off() and Pin.on() methods - Makefile: use system provided math library rather than uPy one - modules/neopixel.py: change NeoPixel to different default timings - machine_hw_spi: use separate DMA channels for HSPI and VSPI - machine_hw_spi: make HW SPI objects statically allocated - implement high-res timers using new tick_hz argument - enable MICROPY_PY_BUILTINS_ROUND_INT - enable descriptors - enable uio.IOBase - enable ure.sub() - call gc_sweep_all() when doing a soft reset nrf port: - add new port to Nordic nRF5x MCUs - align help.c builtin help text to use correct type - add WT51822-S4AT board - use --gc-sections to reduce code size - add compile switch to disable VFS - enable Link-time optimizations (LTO) - boards/arduino_primo: add missing hal_rng config used by random mod - implement NVMC HAL - disable FAT/VFS by default - hal/nvmc: remove pre-compiler error thrown in nvmc.h, if on nrf52 - hal/hal_nvmc: fix non-SD code - boards: update linker scripts - add micro:bit filesystem - drivers/bluetooth/ble_drv: don't handle non-events - modules/uos/microbitfs: make OSError numeric - main: run boot.py and main.py on startup - use micropython libm to save flash - main: add ampy support - drivers/bluetooth: start advertising after disconnect - update usage of mp_obj_new_str by removing last parameter - remove default FROZEN_MPY_DIR - option to enable Ctrl-C in NUS console - boards/microbit: add copy of microbit display and image files - boards/microbit: add copy of microbit font type from microbit-dal - boards/microbit: rename display/image files from .cpp to .c ext - boards/microbit: update board modules from C++ to C-code - boards/microbit: add framework updates to build micro:bit modules - boards/microbit: attempt to get working display/images without FP - boards/microbit: add modmicrobit.h to expose module init function - boards/microbit: include modmicrobit.h in board_modules.h - drivers/softpwm: rename init function to softpwm_init0 - drivers/ticker: rework ticker functions for microbit display/music - boards/microbit: update to work with new ticker code - modules/music: remove init of softpwm/ticker upon music module load - update main.c to init relevant board drivers, if enabled - boards/microbit: move microbit target to custom linker script - boards/microbit/modules: fix tabbing in modmicrobit.c - boards/microbit: add temperature back to microbit module - boards/microbit: update docs on top level tick low pri callback - change board module header from board_modules.h to boardmodules.h - add if-def around inclusion of nrf_sdm.h in main - boards/microbit: enable music, display, image, microbit module - drivers/bluetooth: reset evt_len to size of static buffer each iter - add support for s132 v5.0.0 bluetooth stack (#139) - change PYB prefix to MPY - only search for frozen files if FROZEN_MPY_DIR is set - mpconfigport: reduce GC stack size for nrf51 - modules/machine/pin: disable pin debug by default - boards/common.ld: avoid overflowing the .text region - drivers/ble_drv: fixing sd_ble_enable bug for SD s132 v.2.0.1 - make machine.UART optional - fix stack size in ld script and enable MICROPY_STACK_CHECK - improve include of boardmodules.mk - make LTO configurable via Makefile flag - boards/microbit/modules: initialize variable in microbit_sleep - replace custom-HAL with nrfx-HAL - fix NUS console when using boot.py or main.py - Makefile: fix .PHONY target - enable -g flag by default - make linker scripts more modular - remove port member from Pin object - modules/machine/pin: add support for IRQ on Pin's - modules/machine/spi: sPIM (EasyDMA) backend for nrf52x - drivers/bluetooth/ble_drv: increase max transfers in progress - gccollect: use the SP register instead of MSP - boards: remove unused defines from board config headers - boards/wt51822_s4at: fixes after nrfx and Pin IRQ introduction - modules/random: rename port config for RNG - modules: align method to resolve pin object - adc: allow for external use of new and value read function - spi: allow for external use of new and transfer function - return immediatly from mp_hal_delay_us if 0us is given - modules/machine/adc: fix to make adc.c compile for nrf51 targets - bluetooth: fixes for s132 v5 BLE stack - Makefile: use "standard" GCC -fshort-enums instead of --short-enums - Makefile: remove -fstack-usage - Makefile: use C11 instead of Gnu99 - Makefile: refine dead-code elimination parameters - modules/machine/adc: don't compare -1 to an unsigned number - modules/uos/microbitfs: fix errno defines - modules/uos/microbitfs: remove unused uos_mbfs_mount - enable micro:bit FS by default - boards/feather52: move phony targets to main Makefile - modules/machine/spi: move enable-guard to prevent wrong includes - nrfx_config: move back nrf52832 to use non-EasyDMA SPI - move pyb module to boards module - add support for reading output pin state - generalize feather52 target - bluetooth: add support for s132/s140 v6, remove s132 v2/3/5 - boards: check for stack/heap size using an assert - quick-fix on const objects with open array dimension in objtuples - bluetooth: replace BLE REPL (WebBluetooth) URL - add explicit make flag for oofatfs - compile nlr objects with -fno-lto flag - upgrade to nrfx 1.1.0 - drivers: add license text to ticker.h and softpwm.h - use mp_raise_ValueError instead of nlr_raise(...) - include $(SRC_MOD) in the build - Makefile: make sure dependencies for pins_gen.c are correct - properly use (void) instead of () for function definitions - boards/microbit: use MICROPY_PY_BUILTINS_FLOAT to detect FP support - update nrfjprog links to allow to download any version - drivers/flash: fix incorrect page alignment check - uos: add mbfs __enter__ and __exit__ handlers - enable all PWM, RTC and Timer instances for nrf52840 - correct index checking of ADC/PWM/RTCounter instances - use separate config for each PWM instance - uart: remove unused UART.char_width field - uart: fix UART.writechar() to write just 1 byte - bluetooth: set GAP_ADV_MAX_SIZE to 31 (s132/s140) - bluetooth: update BLE stack download script pic16bit port: - update to compile with latest xc16 v1.35 compiler teensy port: - add own uart.h to not rely on stm32's version of the file zephyr port: - README: hint about existence of qemu_x86_nommu - main: after builtin testsuite, drop to REPL - mpconfigport.h: enable uhashlib and ubinascii modules - modzsensor: zephyr sensor subsystem bindings - prj_base.conf: enable DHCP and group static IPs together - add prj_disco_l475_iot1.conf with sensor drivers - Makefile: add kobj_types_h_target to Z_EXPORTS - prj_base.conf: remove outdated CONFIG_NET_NBUF_RX_COUNT option - prj_qemu_x86.conf: remove outdated CONFIG_RAM_SIZE - rename CONFIG_CONSOLE_PULL to CONFIG_CONSOLE_SUBSYS - prj_base.conf: update for net_config subsys refactor - CMakeLists: update for latest Zephyr CMake usage refactorings docs: - library: add documentation for ucollections.deque - ucryptolib: add docs for new ucryptolib module - usocket: getaddrinfo: describe af/type/proto optional params - usocket: minor fixes to grammar of getaddrinfo - uos: make it clear that block device block_num param is an index - ure: document sub(), groups(), span(), start() and end() - ure: document some more supported regex operators - pyboard: for latex build, use smaller quickref jpg, and no gifs - library: remove "only" directive from all pyb module docs - library/machine.UART: remove conditional docs for wipy port - library/machine: remove conditional docs for wake_reason function - library/machine: remove conditional docs for rng function - library/index: remove all conditionals from library index - library/index: add hint about using help('modules') for discovery - reference/index: remove conditional for inline asm docs - library/machine: remove conditionals in machine class index - move WiPy specific Timer class to separate doc file - library/machine.I2C.rst: clarify availability of primitive I2C ops - library/machine.UART.rst: specify optional txbuf and rxbuf args - library/pyb: add deprecation warning for mount and old block proto - pyboard: fix to use Sphinx style for internal/external links - library/machine.SPI: add note about baudrate imprecision - library/network: move specific network classes to their own file - library/network: make AbstractNIC methods layout correctly - unify all the ports into one set of documentation - remove sphinx_selective_exclude, it's no longer used - wipy: fix links to network.Server, and markup for boot.py - uselect: describe more aspects of poll.register/modify behavior - machine.Pin: add note regarding irq handler argument - machine.Pin: document "hard" argument of Pin.irq method - uio: document StringIO/BytesIO(alloc_size) constructors - library/uctypes: add examples and make general updates - conf.py: use https for intersphinx link to docs.python.org - ure: fully describe supported syntax subset, add example - differences: clarify the differences are against Python 3.4 - add initial docs for esp32 port, including quick-ref and general - library: add documentation for esp32 module travis: - install explicit version of urllib3 for coveralls - use build stages and parallel jobs under Travis CI - add nrf port to Travis CI build examples: - embedding: add code markup and fix typo in README.md - embedding: fix reference to freed memory, lexer src name - embedding: fix hard-coded MP_QSTR_ value - unix/ffi_example: clean up and update the ffi example README: - update list of ports to include esp32 and nrf - remove references to "make axtls", it's no longer needed - remove text about selecting different ports in the docs ======== Fri, 11 May 2018 16:39:59 +1000 v1.9.4 Parser size reduced, new Python stack, stm32 improvements, new esp32 port This release brings some significant size reductions to the parser, as well as removal of unused code and additional tests to improve coverage of the core. A new optional, internal Python stack is introduced for scoped allocation and can be used instead of alloca to provide more efficient and flexible temporary memory; see MICROPY_ENABLE_PYSTACK. There have been many improvements and internal code refactors of the stm32 port, and the port to the Espressif ESP32 SoC has been merged from its development repository. Compared to the last release the change in code size is (in bytes, using gcc 7.3): bare-arm: -1832 minimal x86: -2608 unix x64: -5129 unix nanbox: +1024 stm32: +2120 cc3200: -928 esp8266: +336 The decrease is mainly due to the reduced size of the parser, where the table of rule pointers was compressed to a table of offsets. The increase in the stm32 and esp8266 ports is due to additional features, such as more colour formats in the framebuf module and the addition of ujson.dump(). Code coverage (measured by gcov) has improved since the last version (v1.9.3 on the left, v1.9.4 on the right): py: 15202/15447 = 98.4% -> 15391/15513 = 99.2% extmod: 2227/ 2363 = 94.2% -> 2291/ 2430 = 94.3% Changes and additions seen by the Python user include: improvement of dir() and tab-completion to list all available attributes of an object; addition of efficient ucollections.deque type with fixed size; better handling and polling support of sockets that get into an error state; implementation of key and cert keyword arguments in ussl.wrap_socket (for axtls); uos.ilistdir now return 4-tuples with the file size in the fourth position. Changes at the C level include: removal of "make_qstr_if_not_already" argument from mp_obj_new_str; rename of mp_exc_recursion_depth to mp_raise_recursion_depth; removal of mp_const_MemoryError_obj; switching of stream close operation from method to ioctl; refactoring of how native emitter code is compiled with a file per architecture. The stm32 port has seen a lot of improvements and additions, as well as some significant internal refactoring to better support configuring custom boards. STM32F7 support is improved, USB HS is supported for F723 and F733, the CAN class has improvements to handle bus errors, ctrl-C can now interrupt running code when the REPL is over UART, and the ADC class added the read_timed_multi static method. Board configuration has seen some internal changes, in particular with setting LD_FILES, TEXT0_ADDR, and TEXT1_ADDR in mpconfigboard.mk (previously LD_FILE, FLASH_ADDR, TEXT_ADDR). The pin_X and pyb_pin_X identifiers have been changed to be pointers to objects rather than objects, and main is renamed to stm32_main. A detailed list of changes follows. py core: - compile: use alloca instead of qstr_build when compiling import name - mpconfig: introduce reusable MP_HTOBE32(), etc. macros - objtype: mp_obj_new_type: name base types related vars more clearly - objnamedtuple: add _asdict function if OrderedDict is supported - emitnative: clean up asm macro names so they have dest as first arg - mkenv.mk: use $(PYTHON) consistently when calling Python tools - objstr: remove "make_qstr_if_not_already" arg from mp_obj_new_str - objstr: make mp_obj_new_str_of_type check for existing interned qstr - objstr: when constructing str from bytes, check for existing qstr - add config option to disable multiple inheritance - objnamedtuple: allow to reuse namedtuple basic functionality - objfloat: allow float() to parse anything with the buffer protocol - modbuiltins: slightly simplify code in builtin round() - runtime: simplify handling of containment binary operator - opmethods: include the correct header for binary op enums - runtime: add MP_BINARY_OP_CONTAINS as reverse of MP_BINARY_OP_IN - parsenum: improve parsing of floating point numbers - objdict: reuse dict-view key iterator for standard dict iterator - annotate func defs with NORETURN when their corresp decls have it - qstr: rewrite find_qstr to make manifest that it returns a valid ptr - gc: in gc_realloc, convert pointer sanity checks to assertions - objgenerator: remove unreachable code for STOP_ITERATION case - misc.h: add m_new_obj_var_with_finaliser() - mp_call_function_*_protected(): pass-thru return value if possible - modbuiltins: use standard arg-parsing helper func for builtin print - mpprint: make "%p" format work properly on 64-bit systems - mpprint: support "%lx" format on 64-bit systems - malloc: allow to use debug logging if !MICROPY_MALLOC_USES_ALLOCATED_SIZE - gc: add CLEAR_ON_SWEEP option to debug mis-traced objects - emitbc, asmbase: only clear emit labels to -1 when in debug mode - asmbase: revert removal of clearing of label offsets for native emit - objint_longlong: check for zero division/modulo - runtime: when tracing unary/binary ops, output op (method) name - gc: factor out a macro to trace GC mark operations - gc: in sweep debug output, print pointer as a pointer - objfun: factor out macro for decoding codestate size - objfun, vm: add comments on codestate allocation in stackless mode - objfun: factor out macro for initializing codestate - mkrules.mk: add "clean-frozen" target to clean frozen script/modules dir - runtime: move mp_exc_recursion_depth to runtime and rename to raise - introduce a Python stack for scoped allocation - convert all uses of alloca() to use new scoped allocation API - runtime: use the Python stack when building *arg and **kwarg state - objexcept: use INT_FMT when printing errno value - extend nan-boxing config to have 47-bit small integers - objtype: implement better support for overriding native's __init__ - objtype: refactor object's handling of __new__ to not create 2 objs - builtinimport: call __init__ for modules imported via a weak link - objgenerator: allow to pend an exception for next execution - map: don't include ordered-dict mutating code when not needed - mpz: fix pow3 function so it handles the case when 3rd arg is 1 - modio: use correct config macro to enable resource_stream function - malloc: remove unneeded code checking m_malloc return value - nlrthumb: fix use of naked funcs, must only contain basic asm code - nlr: clean up selection and config of NLR implementation - nlr: factor out common NLR code to macro and generic funcs in nlr.c - parse: split out rule name from rule struct into separate array - parse: break rule data into separate act and arg arrays - parse: pass rule_id to push_result_rule, instead of passing rule_t* - parse: pass rule_id to push_result_token, instead of passing rule_t* - parse: remove rule_t struct because it's no longer needed - parse: compress rule pointer table to table of offsets - parse: update debugging code to compile on 64-bit arch - parse: fix macro evaluation by avoiding empty __VA_ARGS__ - mpz: simplify handling of borrow and quo adjustment in mpn_div - mpz: in mpz_as_str_inpl, convert always-false checks to assertions - nlr: fix nlr functions for 64bit ports built with gcc on Windows - compile: combine compiler-opt of 2 and 3 tuple-to-tuple assignment - objtype: check and prevent delete/store on a fixed locals map - modbuiltins: for builtin_chr, use uint8_t instead of char for array - vm: simplify stack sentinel values for unwind return and jump - parsenum: fix parsing of floats that are close to subnormal - objfloat: fix case of raising 0 to -infinity - unicode: clean up utf8 funcs and provide non-utf8 inline versions - modbuiltins: simplify casts from char to byte ptr in builtin ord - objrange: implement (in)equality comparison between range objects - objexcept: remove long-obsolete mp_const_MemoryError_obj - nlrthumb: do not mark nlr_push as not returning anything - pystack: use "pystack exhausted" as error msg for out of pystack mem - objdict: disallow possible modifications to fixed dicts - gc: reduce code size by specialising VERIFY_MARK_AND_PUSH macro - gc: rename gc_drain_stack to gc_mark_subtree and pass it first block - gc: make GC stack pointer a local variable - qstr: add QSTR_TOTAL() macro to get number of qstrs - modbuiltins: simplify and generalise dir() by probing qstrs - repl: generalise REPL autocomplete to use qstr probing - objstr: protect against creating bytes(n) with n negative - objmodule: factor common code for calling __init__ on builtin module - builtinimport: add compile-time option to disable external imports - modmicropython: allow to have stack_use() func without mem_info() - objstr: remove unnecessary check for positive splits variable - objint: use MP_OBJ_IS_STR_OR_BYTES macro instead of 2 separate ones - objdeque: implement ucollections.deque type with fixed size - objdeque: protect against negative maxlen in deque constructor - objdeque: use m_new0 when allocating items to avoid need to clear - py.mk: split list of uPy sources into core and extmod files - py.mk: remove .. path component from list of extmod files - use "GEN" consistently for describing files generated in the build - compile: adjust c_assign_atom_expr() to use return instead of goto - asm*.c: remove unnecessary check for num_locals<0 in asm entry func - mpz: in mpz_clone, remove unused check for NULL dig - mpstate.h: add repl_line state for MICROPY_REPL_EVENT_DRIVEN - vm: fix case of handling raised StopIteration within yield from - vm: simplify handling of special-case STOP_ITERATION in yield from - formatfloat: fix rounding of %f format with edge-case FP values - formatfloat: fix case where floats could render with a ":" character - formatfloat: fix case where floats could render with negative digits - objint: remove unreachable code checking for int type in format func - misc.h: remove unused count_lead_ones() inline function - obj.h: clean up by removing commented-out inline versions of macros - obj.h: move declaration of mp_obj_list_init to objlist.h - makeqstrdefs.py: optimise by using compiled re's so it runs faster - objexcept: make MP_DEFINE_EXCEPTION public so ports can define excs - runtime: check that keys in dicts passed as ** args are strings - runtime: be sure that non-intercepted thrown object is an exception - vm: don't do unnecessary updates of ip and sp variables - vm: optimise handling of stackless mode when pystack is enabled - modsys: don't compile getsizeof function if feature is disabled - don't include mp_optimise_value or opt_level() if compiler disabled - objint: simplify LHS arg type checking in int binary op functions - objstr: in find/rfind, don't crash when end < start - stream: switch stream close operation from method to ioctl - objgenerator: check stack before resuming a generator - refactor how native emitter code is compiled with a file per arch - nlrthumb: fix Clang support wrt use of "return 0" - mperrno: define MP_EWOULDBLOCK as EWOULDBLOCK, not EAGAIN - stream: use uPy errno instead of system's for non-blocking check - obj.h: fix math.e constant for nan-boxing builds - modbuiltins, repl: start qstr probing from after empty qstr - runtime: add mp_load_method_protected helper which catches exceptions - modbuiltins: make built-in hasattr work properly for user types - repl: use mp_load_method_protected to prevent leaking of exceptions - modbuiltins: in built-in dir make use of mp_load_method_protected - modbuiltins: make built-in dir support the __dir__ special method - objdeque: fix sign extension bug when computing len of deque object extmod: - modussl_axtls: socket_read: Handle EAGAIN - moduhashlib: enable SHA1 hashing when using "mbedtls" library - vfs_fat: mount FatFS on creation so VFS methods can be used - modussl_axtls: implement key and cert kw args to wrap_socket - modlwip: commit TCP out data to lower layers if buffer gets full - machine_signal: change VLA to use new scoped allocation API - modure: convert alloca() to use new scoped allocation API - modussl_mbedtls: clean up mbedtls state when error during setup - modframebuf: add 2-bit color format (GS2_HMSB) - modframebuf: add 8-bit greyscale format (GS8) - vfs_fat_file: implement SEEK_CUR for non-zero offset - modujson: implement ujson.dump() function - vfs_fat: move ilistdir implementation from misc to main file - vfs_fat: merge remaining vfs_fat_misc.c code into vfs_fat.c - vfs_fat: make fat_vfs_open_obj wrapper public, not its function - vfs_fat: remove declaration of mp_builtin_open_obj - vfs_fat_diskio: use a C-stack-allocated bytearray for block buf - machine_spi: make SPI protocol structure public - vfs_fat: add file size as 4th element of uos.ilistdir tuple - re1.5: fix compilecode.c compile problem on IAR tool chain - modlwip: check if getaddrinfo() constraints are supported or not - vfs: delegate import_stat to vfs.stat to allow generic FS import - uzlib: fix C-language sequencing error with uzlib_get_byte calls - modlwip: in ioctl handle case when socket is in an error state lib: - tinytest: move from tools/tinytest - upytesthelper: add MicroPython test helper layer on top of tinytest - tinytest: clean up test reporting in the presence of stdout output - utils/pyexec.h: include py/obj.h because its decls are needed - utils/pyexec: update to work with new MICROPY_HW_ENABLE_USB option - stm32lib: update library to include support for STM32H7 MCUs - stm32lib: update library for fix to H7 SPI strict aliasing error - axtls: update, exposes AES functions to implement ECB cipher mode drivers: - nrf24l01: make driver and test run on pyboard, ESP8266, ESP32 - display/ssd1306: make SSD1306 class inherit from FrameBuffer - sdcard: support old SD cards (<=2GB) - sdcard: avoid allocation on the heap - sdcard: update doc for ESP8266 to use correct SPI number - cc3200: update to work with new stm32 SPI API - sdcard: update SD mounting example code for ESP8266 - bus: add QSPI abstract type with software QSPI implementation - memory/spiflash: add support for QSPI interface - bus: pull out software SPI implementation to dedicated driver - memory/spiflash: change to use low-level SPI object not uPy one tools: - mpy-tool.py: implement freezing of Ellipsis const object - gen-cpydiff.py: update executable paths to point to new ports dir - tinytest-codegen.py: generate code for upytesthelper - tinytest-codegen: wrap lines of exclude_tests - tinytest-codegen: more excludes after enabling expected output match - tinytest-codegen: take --target= option for test set selection - pydfu.py: call set_configuration() on fresh USB device object - tinytest-codegen: add --stdin switch instead of recently added --target - tinytest-codegen: ignore system locale, write output in UTF-8 - upip: upgrade upip to 1.2.4 tests: - net_hosted: add test for socket connect() and poll() behaviour - basics: add test for containment of a subclass of a native type - basics/builtin_range: add test for corner case of range slicing - basics/builtin_locals: add test for using locals() in class body - cpydiff: add difference-test for second arg of builtin next() - cpydiff: fix markup where "`" (xref) was used instead of "``" (code) - heapalloc_*: refactor some tests to work in strict stackless mode - heapalloc, heapalloc_super: skip in strict stackless mode - basics: add test for overriding a native base-class's init method - extmod: add test which subclasses framebuf.FrameBuffer - cpydiff: update subclassing Exception case and give work-around - fix few test for proper "skipped" detection with qemu-arm's tinytest - run-tests: add --list-tests switch - add tests to improve coverage of py/objtype.c - run-tests: fix handling of --list-tests wrt skipped tests - run-tests: add composable --include and --exclude options - run-tests: don't test for --target=unix with "pyb is None" - run-tests: skip running feature checks for --list-tests/--write-exp - basics: add more set tests to improve coverage of py/objset.c - extmod/uhashlib_sha256: add test for hashing 56 bytes of data - float/builtin_float_hash: add test to improve objfloat.c coverage - unix: add test for printf with %lx format - basics/generator_pend_throw: add test for just-started generator - basics/builtin_pow3: add tests for edge cases of pow3 - add some more tests to improve coverage of py/parse.c - extmod: add some uctypes tests to improve coverage of that module - basics/memoryerror: add test for out-of-memory using realloc - basics: rename remaining tests that are for built-in functions - unix: add coverage test for calling mp_obj_new_bytearray - automatically skip tests that require eval, exec or frozenset - rewrite some tests so they can run without needing eval/exec - run-tests: capture any output from a crashed uPy execution - basics/deque*: tests for ucollections.deque - basics: add tests to improve coverage of py/objdeque.c - basics: add test for calling a subclass of a native class - stress: add test to create a dict beyond "maximum" rehash size - unix: add coverage tests for mpz_set_from_float, mpz_mul_inpl - extmod/vfs_fat_fileio1: add test for failing alloc with finaliser - extmod/uzlib_decompress: add uzlib tests to improve coverage - float: adjust float-parsing tests to pass with only a small error - unix: add coverage test for VM executing invalid bytecode - basics/gc1: add test which triggers GC threshold - extmod/vfs_fat_fileio1: add test for calling file obj finaliser - unix: add coverage tests for various GC calls - move heap-realloc-while-locked test from C to Python - unix: add coverage test for uio.resource_stream from frozen str - extmod/time_ms_us: add test for calling ticks_cpu() - extmod/time_ms_us: fix ticks tests, ticks_diff args are reversed - basics/builtin_enumerate: add test for many pos args to enumerate - cpydiff: indent workaround code snippet so it formats correctly - pyb: update CAN test to expect that auto_restart is printed - pyb/can: update to test pyb.CAN restart, state, info, inplace recv - basics/iter1.py: add more tests for walking a user-defined iter - basics: add test for use of return within try-except - basics/int_big1.py: add test converting str with non-print chars - basics: modify int-big tests to prevent constant folding - stress: add test to verify the GC can trace nested objects - basics/int_big1.py: add test for big int in mp_obj_get_int_maybe - basics: add test for subclassing an iterable native type - basics: add tests for edge cases of nan-box's 47-bit small int - basics/class_super.py: add tests for store/delete of super attr - basics/string_compare.py: add test with string that hashes to 0 - micropython: add set of tests for extreme cases of raising exc's - stress/recursive_gen: add test for recursive gen with iter - move recursive tests to the tests/stress/ subdir - pyb/adc.py: fix test so that it really does test ADC values - pyb: add test for pyb.ADCAll class - io/bytesio_ext2: remove dependency on specific EINVAL value - run-tests: support esp32 as a target for running the test suite - cpydiff: remove core_function_unpacking now that it succeeds - cpydiff: remove types_str_decodeerror now that it succeeds - cpydiff: remove working cases from types_float_rounding - cpydiff: remove types_int_tobytesfloat now that it doesn't fail - float/float_parse: allow test to run on 32-bit archs minimal port: - README: update text to better describe what "make run" does - Makefile: explicitly include lib/utils/printf.c in build - Makefile: only build with core source files unix port: - moduselect: add .dump() method for debugging - mpconfigport: disable uio.resource_stream() - add support for using the Python stack - Makefile: coverage: allow user to pass CFLAGS_EXTRA - mpconfigport.h: allow to override stackless options from commandline - mpconfigport_coverage.h: enable MICROPY_PY_IO_RESOURCE_STREAM - mpconfigport_coverage: enable range (in)equality comparison - coverage: allow coverage tests to pass with debugging disabled windows port: - mpconfigport: provide off_t definition for MSVC port - mpconfigport: enable some features, including the Python stack - add Appveyor CI builds for windows mingw port qemu-arm port: - rework "test" target using upytesthelper - test_main: clean up invocation of tinytest_main() - test_main: include setjmp.h because it's used by gc_collect stm32 port: - boards/NUCLEO_F429ZI: incr CPU freq to 168MHz to get USB working - boards: add support for NUCLEO-F746ZG evaluation board - boards/stm32f767_af.csv: update AF table based on datasheet - boards/*_af.csv: make consistent use of JTMS, JTCK, SWDIO, SWCLK - add support for using the Python stack - usbdev: pass thru correct val for SCSI PreventAllowMediumRemoval - use corrected capitalization of HAL_SD_CardStateTypedef - allow to build a board without any hardware I2C ports defined - uart: add support for 7-bit modes: 7N1 and 7N2 - uart: support board configs with CTS/RTS on UART6 - i2c: fix bug with I2C4 initialisation - i2c: support more I2C baudrates for F746, and more F7 MCUs - spi: if MICROPY_HW_SPIn_MISO undefined, do not claim pin on init - modmachine: handle case of no MICROPY_PY_MACHINE_I2C - add support for DHT11/DHT22 sensors - spi: make SPI DMA wait routine more power efficient by using WFI - sdcard: make SD wait routine more power efficient by using WFI - usbdev: reduce dependency on py header files - usbdev: combine all str descriptor accessor funcs into one func - can: support MCUs without a CAN2 peripheral - improve support for STM32F722, F723, F732, F733 MCUs - modmachine: in freq(), select flash latency value based on freq - sdcard: only define IRQ handler if using SDMMC1 peripheral - sdcard: use maximum speed SDMMC clock on F7 MCUs - usbdev: add support for MSC-only USB device class - usb: allow board to select which USBD is used as the main one - usbdev: add support for high-speed USB device mode - i2c: use macros instead of magic numbers for I2C speed grades - spi: add support for a board naming SPI peripherals 4, 5 and 6 - rng: simplify RNG implementation by accessing raw peripheral regs - spi: allow SPI peripheral state to persist across a soft reset - i2c: allow I2C peripheral state to persist across a soft reset - spi: provide better separation between SPI driver and uPy objs - update LCD and network drivers to work with new SPI API - spi: accept machine.SPI object in spi_from_mp_obj() function - rtc: fix rtc_info flags when LSE fails and falls back to LSI - rtc: fix RTC init to use LSI if LSI is already selected on boot - rtc: add compile-time option to set RTC source as LSE bypass - main: reorder some init calls to put them before soft-reset loop - main: remove need for first_soft_reset variable - add mpconfigboard_common.h with common/default board settings - boards: remove all config options that are set to defaults - usbdev: fix USBD setup request handler to use correct recipient - update HAL macro and constant names to use newer versions - timer: support MCUs that don't have TIM4 and/or TIM5 - introduce MICROPY_HW_ENABLE_USB and clean up USB config - boards: update all boards to work with new USB configuration - factor out flash and SPI block-device code to separate files - change header include guards from STMHAL to STM32 to match dir - add board config option to enable/disable the ADC - use "GEN" for describing files generated in the build - flash: use FLASH_TYPEPROGRAM_WORD to support newer HALs - move MCU-specific cfg from mphalport.h to mpconfigboard_common.h - spibdev: update to work with new spiflash driver - spibdev: add option to configure SPI block dev to use QSPI flash - storage: add option for bdev to supply readblock/writeblocks - spibdev: convert to use multiple block read/write interface - qspi: add hardware QSPI driver, with memory-map capability - i2c: on F4 MCUs report the actual I2C SCL frequency - boards/stm32f767_af.csv: add ADC column to pin capability list - boards/NUCLEO_F767ZI: update pins list to include 3 extra pins - boards: add stm32h743_af.csv file describing H7 GPIO alt funcs - boards: add stm32h743.ld linker script - boards: add new NUCLEO_H743ZI board configuration files - Makefile: add settings to support H7 MCUs - flash: add flash support for H7 MCUs - system_stm32: add H7 MCU system initialisation - mphalport: use GPIO BSRRL/BSRRH registers for H7 MCUs - wdt: add WDT support for H7 MCUs - uart: add UART support for H7 MCUs - timer: add Timer support for H7 MCUs - modmachine: support basic H7 MCU features - usbd_conf: add USB support for H7 MCUs - stm32_it: add support for H7 MCUs - dma: add DMA support for H7 MCUs - rtc: add RTC support for H7 MCUs - extint: add EXTI support for H7 MCUs - mpconfigboard_common: add STM32H7 common configuration - main: enable D2 SRAM1/2/3 clocks on H7 MCUs - boards: add startup_stm32h7.s for H7 series specific startup - boards: add startup_stm32f7.s for F7 series specific startup - boards: add startup_stm32f4.s for F4 series specific startup - boards: add startup_stm32l4.s for L4 series specific startup - Makefile: use separate startup file for each MCU series - remove startup_stm32.S, now provided in boards/ for each MCU - usbd_conf.h: add include of stdint.h to fix compilation issues - system_stm32: fix CONFIG_RCC_CR_2ND value to use bitwise or - storage: merge all misc block-dev funcs into a single ioctl func - storage: make spi_bdev interface take a data pointer as first arg - storage: remove all SPI-flash bdev cfg, to be provided per board - storage: introduce MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE cfg - boards/STM32L476DISC: provide SPI-flash bdev config - storage: provide support for a second block device - qspi: do an explicit read instead of using memory-mapped mode - boards/STM32L476DISC: enable CAN peripheral - can: improve can.recv() so it checks for events, eg ctrl-C - can: use enums to index keyword arguments, for clarity - can: add "auto_restart" option to constructor and init() method - can: add CAN.restart() method so controller can leave bus-off - can: add CAN.state() method to get the state of the controller - can: add CAN.info() method to retrieve error and tx/rx buf info - use STM32xx macros instead of MCU_SERIES_xx to select MCU type - can: add "list" param to CAN.recv() to receive data inplace - dma: enable H7 DMA descriptors - i2c: add H7 I2C timing configurations - boards/NUCLEO_H743ZI: enable hardware I2C support - boards/NUCLEO_H743ZI: disable uSD transceiver - Makefile: re-enable strict aliasing optimisation for ST HAL files - consolidate include of genhdr/pins.h to single location in pin.h - qspi: don't take the address of pin configuration identifiers - *bdev.c: eliminate dependency on sys_tick_has_passed - boards: allow boards to have finer control over the linker script - Makefile: rename FLASH_ADDR/TEXT_ADDR to TEXT0_ADDR/TEXT1_ADDR - Makefile: allow a board to config either 1 or 2 firmware sections - boards: add common_basic.ld for a board to have a single section - boards: add common_bl.ld for boards that need a bootloader - system_stm32: set VTOR pointer from TEXT0_ADDR - boards/stm32f767.ld: add definition of FLASH_APP - boards/stm32h743.ld: remove include of common.ld - boards/NUCLEO_H743ZI: update to build with new linker management - dma: remove H7 SDMMC DMA descriptors - sdcard: add H7 SD card support - boards/NUCLEO_H743ZI: enable SD card support - change pin_X and pyb_pin_X identifiers to be pointers to objects - boards/STM32L476DISC: update to not take the address of pin objs - add custom, optimised Reset_Handler code - main: rename main to stm32_main and pass through first argument - main: only update reset_mode if board doesn't use a bootloader - mphalport: use MCU regs to detect if cycle counter is started - dac: add support for H7 MCUs - boards/NUCLEO_H743ZI: enable DAC peripheral - i2c: update HAL macros to use new __HAL_RCC prefix - i2c: fully support peripheral I2C4 - main: guard usb_mode lines in default boot.py by relevant #if - adc: fix verification of ADC channel 16 for F411 MCUs - adc: add read_timed_multi() static method, with docs and tests - adc: optimise read_timed_multi() by caching buffer pointers - dac: add buffering argument to constructor and init() method - adc: factor code to optimise adc_read_channel and adc_read - adc: fix config of EOC selection and Ext-Trig for ADC periph - adc: factor common ADC init code into adcx_init_periph() - pin: in pin AF object, remove union of periph ptr types - can: allow CAN pins to be configured per board - stm32_it: add IRQ handler for I2C4 - allow a board to configure the HSE in bypass mode - main: allow a board to configure the label of the flash FS - sdcard: implement BP_IOCTL_SEC_COUNT to get size of SD card - rng: set RNG clock source for STM32H7 - boards/NUCLEO_H743ZI: enable RNG for this board - uart: allow ctrl-C to issue keyboard intr when REPL is over UART - uart: allow ctrl-C to work with UARTs put on REPL via os.dupterm - introduce MICROPY_PY_STM config to include or not the stm module - dac: support MCUs that don't have TIM4/5 and use new HAL macro - rename i2c.c to pyb_i2c.c - rename legacy pyb.I2C helper functions to start with pyb_i2c_ - i2c: add low-level I2C driver for F7 MCUs - machine_i2c: provide hardware I2C for machine.I2C on F7 MCUs - system_stm32: reconfigure SysTick IRQ priority for L4 MCUs - boards/NUCLEO_H743ZI: use priority 0 for SysTick IRQ - adc: add support for H7 MCU series - boards/NUCLEO_H743ZI: enable ADC peripheral - mphalport: add mp_hal_pin_config_speed() to select GPIO speed - usbd_conf: use mp_hal_pin_config() instead of HAL_GPIO_Init - dac: use mp_hal_pin_config() instead of HAL_GPIO_Init() - boards: update pins.csv to include USB pins where needed - mphalport: support ADC mode on a pin for L4 MCUs - adc: use mp_hal_pin_config() instead of HAL_GPIO_Init() - dac: make deinit disable the output buffer on H7 and L4 MCUs - dac: implement printing of a DAC object - mphalport: optimise the way that GPIO clocks are enabled - flash: remove unused src parameter from flash_erase() - dma: always deinit/reinit DMA channels on L4 MCUs - irq: define IRQ priorities directly as encoded hardware values - main: clean up and optimise initial start-up code of the MCU - dma: fix duplicate typedef of struct, it's typedef'd in dma.h - don't use %lu or %lx for formatting, use just %u or %x - Makefile: use -O2 to optimise compilation of lib/libc/string0.c - i2c: make sure stop condition is sent after receiving addr nack - usb: fix broken pyb.have_cdc() so it works again - usb: use correct type for USB HID object - README: update to reflect current MCU support teensy port: - update GPIO speed consts to align with changes in stm32 port esp8266 port: - etshal.h: make function prototypes compatible with ESP SDK 2.1.0+ - README: emphasize the need to change default WiFi password - README: add section on using upip - esp8266_common.ld: put .text of more libs into .irom0.text - modules/webrepl_setup: fix first-time enable of WebREPL - modnetwork: make sure to intern string passed to .config("param") - machine_hspi: after an SPI write wait for last byte to transfer - modules: move dht.py driver to drivers/dht directory - esppwm: clip negative duty numbers to 0 - README.md: update build instruction to reflect new ports dir - uart: allow to compile with event-driven REPL - modnetwork: implement WLAN.status('rssi') for STA interface - esppwm: always start timer to avoid glitch from full to nonfull - esp_mphal.h: fix I2C glitching by using input mode for od_high - modnetwork: allow to get ESSID of AP that STA is connected to - disable DEBUG_PRINTERS for 512k build esp32: - add new port to Espressif ESP32 SoC - modnetwork: give better error msgs for AP timeout and not-found - modsocket: implement setsockopt(IP_ADD_MEMBERSHIP) - mpconfigport.h: add missing uhashlib - mphalport.h: make mp_hal_pin_ select gpio on the pad - call initialization function on sha1 and sha256 - implement machine.WDT() class - README: update general description of port to add avail features - modutime.c: add localtime and mktime functions - machine_pwm: always set the channel in the PWM object - update to latest ESP IDF - modules: symlink in ntptime.py from esp8266/modules - modnetwork.c: fix for setting DNS with network.WLAN.ifconfig() - mpconfigport.h: enable ussl finaliser - implement wired Ethernet via network.LAN() - mpconfigport.h: enable websocket module - modesp: add osdebug() function to disable or change IDF logging - Makefile: support using IDF_PATH as the env var to the IDF source - add custom partitions.csv file with uPy specific size - machine_hw_spi: fix large HW SPI transfers by splitting them up - README: update toolchain setup - machine_uart: fix check of UART id so it only allows valid UARTs - machine_rtc: add RTC class to machine module with sleep impl - modesp32: add new module "esp32" to support extra wake features - machine_rtc: move export declaration from .c to common .h file - modnetwork: implement dhcp_hostname for WLAN.config() - update to the latest ESP IDF - main: allocate the uPy heap via malloc instead of on the bss - modsocket: allow getaddrinfo() to take up to 6 args - modnetwork: implement status('stations') to list STAs in AP mode - machine_uart: return None from UART read if no data is available - machine_uart: remove UART event queue object - README.md: fix typo readme - mphalport: use esp_timer_get_time instead of gettimeofday - mphalport: improve mp_hal_delay_us so it handles pending events - mphalport: improve mp_hal_stdout_tx_XXX functions - add support for and enable uos.dupterm() - modsocket: add support for registering socket event callbacks - mpconfigport: enable webrepl module and socket events - modules: add support scripts for WebREPL - add support for the esp32's ULP - modnetwork: allow to get ESSID of AP that STA is connected to - README: add --init to submodule update command - modsocket: correctly handle reading from a peer-closed socket - use mp_rom_map_elem_t and MP_ROM_xxx macros for const dicts - modsocket: check for pending events during blocking socket calls zephyr port: - README: "make qemu" was replaced with "make run" - Makefile: clean: Remove generated prj_*_merged.conf - prj_base.conf: force zephyr.bin build output - Makefile: convert to new CMake-based Zephyr build system - Makefile: make prj_$(BOARD).conf optional, again - Makefile: syscall_macros.h generation was moved from CMake to make - CMakeLists.txt: update for latest Zephyr buildsys changes - CMakeLists.txt: properly separate CFLAGS parts gotten from CMake - main: move var declarations to the top of file - add support for binary with builtin testsuite - prj_base.conf: bump MAIN_STACK_SIZE to let builtin testsuite run - Makefile: clean: Clean libmicropython.a too - main: remove unused do_str() function docs: - esp8266/general: TLS limitations: mention also "ussl" module limitations - ure: add flags arg to ure.compile(), mention that ure.DEBUG is optional - ure: emphasize not supported features more - _thread: add a placeholder docs for _thread module - library/network: enhance AbstractNIC.status to take an argument - add notes on heap allocation caused by bound method refs - uselect: poll: Explicitly specify that no-timeout value is -1 - uctypes: tweak descriptor reference to hopefully be easier to follow - uselect: describe POLLHUP/POLLERR semantics in more details - library/utime: fix incorrect example with ticks_diff args order - uselect: ipoll: Fix grammar/wording of one-shot flag description - glossary: describe the callee-owned tuple concept - uerrno: fix xref-vs-code markup - glossary: describe "stream" term - glossary: describe string interning - library: add xrefs to "stream" dictionary entry for many modules - glossary: clarify wording for "baremetal" - reference/packages: add chapter on distribution packages and deployment - packages: add quick "Creating distribution packages" section - packages: mpy_bin2res no longer required to create resources - conf: reference CPython 3.5 docs - packages: use "install_dir/" in examples - packages: explicitly recommend usage of setuptools instead of distutils - library/index: elaborate uPy libraries intro - library/pyb.rst: add note about availability of USB MSC-only mode - esp8266: update PWM doc regarding clipping of min/max values - esp8266: add a note concerning GPIO16 pull capabilities - library/ujson: document dump() and load() functions - library/usocket: make xref to uerrno explicitly a module reference - library/micropython: describe optimisation levels for opt_level() - library/uos: create sections for distinct parts and document uname - library/uos: document mount, umount, VfsFat and block devices - reference/repl.rst: fix some minor errors in the REPL tutorial - library/pyb.ADC: document new features for ADCAll - library/pyb.ADC: remove outdated ADCAll code example - library: add ussl module to library index for unix port travis: - pass -j4 to make to speed up compilation - update for qemu-arm's testing moved to Makefile.test - build and test strict stackless build - add Unix coverage test for script via stdin ======== Wed, 1 Nov 2017 11:19:56 +1100 v1.9.3 Introduction of ports subdirectory where all ports are moved to The main change in this release is the introduction of a "ports/" subdirectory at the top-level of the repository, and all of the ports are moved here. In the process the "stmhal" port is renamed to "stm32" to better reflect the MCU that it targets. In addition, the STM32 CMSIS and HAL sources are moved to a new submodule called "stm32lib". The bytecode has changed in this release, compared to the previous release, and as a consequence the .mpy version number has increased to version 3. This means that scripts compiled with the previous mpy-cross must be recompiled to work with this new version. There have also been various enhancements and optimisations, such as: check for valid UTF-8 when creating str objects, support for reverse special binary operations like __radd__, full domain checking in the math module, support for floor-division and modulo in the viper emitter, and addition of stack overflow checking when executing a regex. The stm32 port sees improved support for F7 MCUs, addition of a new board B_L475E_IOT01A based on the STM32L475, and support for the Wiznet W5500 chipset along with improved socket behaviour. A detailed list of changes follows. py core: - objstr: startswith, endswith: check arg to be a string - nlrx86,x64: replace #define of defined() with portable macro usage - objtype: handle NotImplemented return from binary special methods - objtype: mp_obj_class_lookup: improve debug logging - map: remove unused new/free functions - make m_malloc_fail() have void return type, since it doesn't return - modstruct: in struct.pack, stop converting if there are no args left - modstruct: check and prevent buffer-read overflow in struct unpacking - modstruct: check and prevent buffer-write overflow in struct packing - nlrthumb: get working again on standard Thumb arch (ie not Thumb2) - objfloat: fix binary ops with incompatible objects - obj: fix comparison of float/complex NaN with itself - objtype: implement fallback for instance inplace special methods - objtuple: properly implement comparison with incompatible types - objstr: add check for valid UTF-8 when making a str from bytes - objlist: properly implement comparison with incompatible types - runtime0.h: move relational ops to the beginning of mp_binary_op_t - runtime0.h: move MP_BINARY_OP_DIVMOD to the end of mp_binary_op_t - objtype: make sure mp_binary_op_method_name has full size again - runtime0.h: put inplace arith ops in front of normal operations - builtinhelp: simplify code slightly by extracting object type - runtime: implement dispatch for "reverse op" special methods - nlrx86: fix building for Android/x86 - builtinhelp: change signature of help text var from pointer to array - runtime.h: change empty mp_warning macro so var-args are non empty - modbuiltins: implement abs() by dispatching to MP_UNARY_OP_ABS - {objfloat,objcomplex}: optimise MP_UNARY_OP_ABS by reusing variables - mpconfig.h: add note that using computed gotos in VM is not C99 - objstr: strip: don't strip "\0" by default - objexcept: prevent infinite recursion when allocating exceptions - stream: remove unnecessary checks for NULL return from vstr_add_len - vstr: raise a RuntimeError if fixed vstr buffer overflows - vm: use lowercase letter at start of exception message - persistentcode: define mp_raw_code_save_file() for any unix target - add config option to print warnings/errors to stderr - objfloat: support raising a negative number to a fractional power - objset: simplify set and frozenset by separating their locals dicts - objset: check that RHS of a binary op is a set/frozenset - objset: include the failed key in a KeyError raised from set.remove - objtype: change type of enum-to-qstr table to uint16_t to save space - objstr: make empty bytes object have a null-terminating byte - mpprint: only check for null string printing when NDEBUG not defined - objtype: clean up unary- and binary-op enum-to-qstr mapping tables - persistentcode: bump .mpy version number to version 3 - bc: update opcode_format_table to match the bytecode - modmath: add full checks for math domain errors - modmath: convert log2 macro into a function - formatfloat: don't print the negative sign of a NaN value - formatfloat: use standard isinf, isnan funcs instead of custom ones - modbuiltins: use existing utf8_get_char helper in builtin ord func - emitnative: implement floor-division and modulo for viper emitter - objtype: use CPython compatible method name for sizeof - objtype: fit qstrs for special methods in byte type - objtype: define all special methods if requested - objtype: introduce MICROPY_PY_ALL_INPLACE_SPECIAL_METHODS extmod: - modubinascii: only include uzlib/tinf.h when it's really needed - modussl_mbedtls: allow to compile with MBEDTLS_DEBUG_C disabled - machine_pinbase: put PinBase singleton in ROM - re1.5: upgrade to v0.8.2, adds hook for stack overflow checking - modure: add stack overflow checking when executing a regex - uos_dupterm: update uos.dupterm() and helper funcs to have index - uos_dupterm: swallow any errors from dupterm closing the stream - vfs: replace VLA in proxy func with small, static sized array - modussl: add finaliser support for ussl objects - modussl_mbedtls: allow to compile with unix coverage build lib: - add new submodule, stm32lib containing STM32 CMSIS and HAL source - embed/abort_: use mp_raise_msg helper function - libm: fix tanhf so that it correctly handles +/- infinity args - libm: remove implementation of log2f, use MP_NEED_LOG2 instead - axtls: update, support for SSL_EAGAIN return code - berkeley-db-1.xx: update, allow to override MINCACHE, DEFPSIZE drivers: - memory/spiflash: change from hard-coded soft SPI to generic SPI - display/ssd1306.py: improve performance of graphics methods - nrf24l01: make nRF24L01 test script more portable - display/ssd1306: implement SSD1306_I2C poweron method - display/ssd1306: make poweron() work the same with SSD1306_SPI - wiznet5k: improve the performance of socket ops with threading - wiznet5k: get low-level W5500 driver working tools: - upip: upgrade to 1.2.2 - pyboard: use repr() when quoting data in error messages - pyboard: update docstring for additional device support tests: - object_new: better messages, check user __new__() method - class_new: add checks for __init__ being called and other improvements - class_new: add another testcase for __new__/__init__ interaction - class_inplace_op: test for inplace op fallback to normal one - run-bench-tests: update locations of executables, now in ports/ - class_reverse_op: test for reverse arith ops special methods - run-tests: skip class_inplace_op for minimal profile - run-tests: fix copy-paste mistake in var name - cpydiff: add cases for locals() discrepancies - extmod: add test for ure regexes leading to infinite recursion - extmod: add test for '-' in character class in regex - run-tests: close device under test using "finally" - net_inet: update tls test to work with CPython and incl new site unix port: - rename modsocket.c to modusocket.c - modusocket: remove #if MICROPY_SOCKET_EXTRA code blocks - enable MICROPY_PY_REVERSE_SPECIAL_METHODS stm32 port: - modmachine: make machine.bootloader() work when MPU is enabled - modmachine: improve support for sleep/deepsleep on F7 MCUs - compute PLL freq table during build instead of at run time - modmachine: for F7 MCU, save power by reducing internal volt reg - boards/pllvalues.py: make script work with both Python 2 and 3 - Makefile: use lib/stm32lib instead of local cmsis and hal files - remove cmsis and hal files, they are now a submodule - Makefile: automatically fetch stm32lib submodule if needed - update to new STM Cube HAL library - fix clock initialisation of L4 MCUs - rename stmhal port directory to stm32 - remove unused usbd_msc.c file - boards: change remaining stm32f4xx_hal_conf.h to unix line ending - boards: change linker scripts to use "K" instead of hex byte size - boards: fix I2C1 pin mapping on NUCLEO_F401RE/F411RE boards - i2c: when scanning for I2C devices only do 1 probe per address - modnwwiznet5k: release the GIL on blocking network operations - boards: add new board B_L475E_IOT01A based on STM32L475 - make-stmconst.py: make sure mpz const data lives in ROM - timer: make pyb.Timer() instances persistent - mpconfigport.h: add configuration for max periphs on L4 series - usbdev: make the USBD callback struct const so it can go in ROM - usbdev: change static function variable to non-static - usbdev: put all CDC state in a struct - usbdev: put all HID state in a struct - usbdev: simplify CDC tx/rx buffer passing - usbdev: simplify HID tx/rx buffer passing - usbdev/core: add state parameter to all callback functions - usbdev: put all state for the USB device driver in a struct - usbdev: simplify pointers to MSC state and block dev operations - usbdev: merge all global USB device state into a single struct - usbdev: make device descriptor callbacks take a state pointer - usbdev: move all the USB device descriptor state into its struct - timer: enable ARPE so that timer freq can be changed smoothly - modnwwiznet5k: get the IP address of an established socket - boards: fix typos in stm32f767_af.csv table - usbd_cdc_interface: don't reset CDC output buf on initialisation - modnwwiznet5k: implement WIZNET5K.isconnected() method - modusocket: make getaddrinfo() work when passed an IP address - modusocket: return OSError(-2) if getaddrinfo fails - mpconfigport.h: add MICROPY_THREAD_YIELD() macro - modnwwiznet5k: add support for W5500 Ethernet chip - modnwwiznet5k: increase SPI bus speed to 42MHz - modnwwiznet5k: implement stream ioctl for the Wiznet driver - mphalport: improve efficiency of mp_hal_stdout_tx_strn_cooked - make uos.dupterm() conform to specs by using extmod version cc3200 port: - enable micropython.kbd_intr() method - use standard implementation of keyboard interrupt esp8266 port: - rename axtls_helpers.c to posix_helpers.c - posix_helpers: set ENOMEM on memory alloc failure - set DEFPSIZE=1024, MINCACHE=3 for "btree" module - esp_mphal: send data in chunks to mp_uos_dupterm_tx_strn - modnetwork: add "bssid" keyword arg to WLAN.connect() method - modules/webrepl_setup: add info about allowed password length zephyr port: - Makefile: revamp "test" target after ports were moved to ports/ - use CONFIG_NET_APP_SETTINGS to setup initial network addresses - switch to interrupt-driven pull-style console pic16bit port: - add definition of SEEK_SET to unistd.h docs: - pyboard/tutorial: add "timeout=0" to UART in pass-through example - more xrefs to "MicroPython port" in glossary - library/network: fix ref to "socket" module (should be "usocket") - machine.Signal: improve style/grammar and add usage example - library: add description of "index" parameter to uos.dupterm() - library/micropython: fix typo in RST formatting - library/framebuf.rst: generalise constructor to all colour formats - btree: describe page caching policy of the underlying implementation - esp8266/tutorial: update neopixel with example of using 4 bbp - library/network: clarify usage of "bssid" arg in connect() method - pyboard/quickref: add info for Switch, RTC, CAN, Accel classes - pyboard/tutorial: update now that yellow LED also supports PWM - esp8266/quickref: add quickref info for RTC class - library: add missing cross-ref links for classes in pyb module - library/network: update docs to state that W5500 is supported - uselect: document one-shot polling mode - usocket: elaborate descriptions - usocket: document inet_ntop(), inet_pton() - library/network: add dhcp_hostname parameter - reference/isr_rules: minor typo correction - ussl: fix module name refs and use "MicroPython port" term - esp8266/general: add section on TLS limitations - usocket: document that settimeout() isn't supported by all ports - ure: add "|" (alternative) to the list of supported operators - reference/isr_rules.rst: add tutorial on use of micropython.schedule() travis: - use --upgrade when pip is installing cpp-coveralls - update build command now that stm32 Wiznet config has changed examples: - hwconfig_console: add .on()/.off() methods all: - convert mp_uint_t to mp_unary_op_t/mp_binary_op_t where appropriate - convert remaining "mp_uint_t n_args" to "size_t n_args" - make new ports/ sub-directory and move all ports there - update Makefiles and others to build with new ports/ dir layout - remove inclusion of internal py header files - use NULL instead of "" when calling mp_raise exception helpers README: - update "Dependencies" section - add explicit section on contributing - add gcc and arm-none-eabi-newlib to list of required components .gitattributes: - remove obsolete entries for stmhal/hal, stmhal/cmsis - add entries for files that will move to ports/ dir ======== Wed, 23 Aug 2017 11:46:35 +1000 v1.9.2 Double precision math library and support on pyboard, and improved ussl This release brings general improvements and bug fixes to the core and various ports, as well as documentation additions, clean-ups and better consistency. And effort has been made to clean up the source code to make it more consistent across the core and all ports. There is a new tool "mpy_bin2res.py" to convert arbitrary (binary) files to Python resources for inclusion in source code (frozen or otherwise). The ussl module has seen improvements, including implementation of server_hostname (for axtls) and server_side mode (for mbedtls). There is now a double-precision float math library and stmhal has support to build firmware with software or hardware double-precision. A detailed list of changes follows. py core: - formatfloat: fix number of digits and exponent sign when rounding - modthread: raise RuntimeError in release() if lock is not acquired - compile: raise SyntaxError if positional args are given after */** - objint: support "big" byte-order in int.to_bytes() - objint: in to_bytes(), allow length arg to be any int and check sign - compile: fix bug with break/continue in else of optimised for-range - compile: optimise emitter label indices to save a word of heap - builtinimport: remove unreachable code for relative imports - objnamedtuple: simplify and remove use of alloca building namedtuple - mpprint: remove unreachable check for neg return of mp_format_float - binary: add missing "break" statements - runtime: mark m_malloc_fail() as NORETURN - objstr: remove unnecessary "sign" variable in formatting code - vm: make "if" control flow more obvious in YIELD_FROM opcode - modmath: check for zero division in log with 2 args - makeversionhdr.py: update to parse new release line in docs/conf.py - objdict: factorise dict accessor helper to reduce code size - change mp_uint_t to size_t in builtins code - repl: change mp_uint_t to size_t in repl helpers - compile: combine arith and bit-shift ops into 1 compile routine - compile: use switch-case to match token and operator - objgenerator: allow to hash generators and generator instances - gc: refactor assertions in gc_free function - vm: make n_state variable local to just set-up part of VM - asmx64: support moving a 64-bit immediate to one of top 8 registers - modmicropython: cast stack_limit value so it prints correctly - builtinevex: add typechecking of globals/locals args to eval/exec - py.mk: make berkeley-db C-defs apply only to relevant source files - mperrno: allow mperrno.h to be correctly included before other hdrs - mpz: make mpz_is_zero() an inline function - implement raising a big-int to a negative power - mkrules.mk: show frozen modules sizes together with executable size - objtuple: allow to use inplace-multiplication operator on tuples - objstr: raise an exception for wrong type on RHS of str binary op - modsys: initial implementation of sys.getsizeof() - binary.c: fix bug when packing big-endian 'Q' values - add verbose debug compile-time flag MICROPY_DEBUG_VERBOSE - binary: change internal bytearray typecode from 0 to 1 - objstringio: prevent offset wraparound for io.BytesIO objects - objstringio: fix regression with handling SEEK_SET - stream: seek: Consistently handle negative offset for SEEK_SET - mkrules.mk: use "find -path" when searching for frozen obj files - compile: remove unused pn_colon code when compiling func params - objcomplex: remove unnecessary assignment of variable - formatfloat: don't post-increment variable that won't be used again - use "static inline" for funcs that should be inline - asmthumb: use existing macro to properly clear the D-cache extmod: - modussl_axtls: update for axTLS 2.1.3 - modussl_axtls: implement server_hostname arg to wrap_socket() - move modonewire.c from esp8266 to extmod directory - modure: if input string is bytes, return bytes results too - modubinascii: add check for empty buffer passed to hexlify - modussl_axtls: allow to close ssl stream multiple times - modussl_mbedtls: support server_side mode - modussl_mbedtls: when reading and peer wants to close, return 0 - modframebuf: fix invalid stride for odd widths in GS4_HMSB fmt - modussl_mbedtls: make socket.close() free all TLS resources - modframebuf: consistently use "col" as name for colour variables - modussl_mbedtls: implement non-blocking SSL sockets - machine_signal: fix parsing of invert arg when Pin is first arg - modframebuf: use correct initialization for .locals_dict - modlwip: implement setsockopt(IP_ADD_MEMBERSHIP) - modussl_mbedtls.c: add ussl.getpeercert() method - modubinascii: rewrite mod_binascii_a2b_base64 - modubinascii: don't post-increment variable that won't be used - modonewire: rename public module to mp_module_onewire - for uos.stat interpret st_size member as an unsigned int - use "static inline" for funcs that should be inline lib: - axtls: upgrade to axTLS 2.1.3 + MicroPython patchset - libm/math: remove implementations of float conversion functions - add libm_dbl, a double-precision math library, from musl-1.1.16 drivers: - onewire: move onewire.py, ds18x20.py from esp8266 to drivers - onewire: enable pull-up when init'ing the 1-wire pin tools: - gen-cpydiff: use case description as 3rd-level heading - pyboard: add license header - mpy_bin2res: tools to convert binary resources to Python module - mpy-tool.py: don't generate const_table if it's empty - mpy-tool.py: fix missing argument in dump() function tests: - net_inet/test_tls_sites.py: integration test for SSL connections - net_inet: add tests for accept and connect in nonblocking mode - basics: add tests for for-else statement - net_inet: move tests which don't require full Internet to net_hosted - connect_nonblock: refactor towards real net_hosted test - auto detect floating point capabilites of the target - import: add a test for the builtin __import__ function - import: update comment now that uPy raises correct exception - basics/namedtuple1: add test for creating with pos and kw args - unix/extra_coverage: add test for mp_vprintf with bad fmt spec - basics: add tests for arithmetic operators precedence - cpydiff/modules_deque: elaborate workaround - cpydiff/core_class_mro: move under Classes, add workaround - cpydiff/core_arguments: move under Functions subsection - cpydiff/core_class_supermultiple: same cause as core_class_mro - cpydiff: improve wording, add more workarounds - cpydiff: add case for str.ljust/rjust - rename exec1.py to builtin_exec.py - basics/builtin_exec: test various globals/locals args to exec() minimal port: - Makefile: enable gc-sections to remove unused code - remove unused stmhal include from Makefile - use size_t for mp_builtin_open argument unix port: - modtime: replace strftime() with localtime() - mpconfigport.mk: update descriptions of readline and TLS options - Makefile: disable assertions in the standard unix executable - modjni: convert to mp_rom_map_elem_t - for uos.stat interpret st_size member as an unsigned int stmhal port: - mpconfigport.h: remove config of PY_THREAD_GIL to use default - make error messages more consistent across peripherals - add initial implementation of Pin.irq() method - add .value() method to Switch object, to mirror Pin and Signal - move pybstdio.c to lib/utils/sys_stdio_mphal.c for common use - add "quiet timing" enter/exit functions - make available the _onewire module, for low-level bus control - modules: provide sym-link to onewire.py driver - boards/stm32f405.ld: increase FLASH_TEXT to end of 1MiB flash - sdcard: allow a board to customise the SDIO pins - add possibility to build with double-precision floating point - boards: enable double-prec FP on F76x boards - Makefile: use hardware double-prec FP for MCUs that support it - Makefile: rename FLOAT_IMPL to MICROPY_FLOAT_IMPL to match C name - Makefile: add CFLAGS_EXTRA to CFLAGS so cmdline can add options - mpconfigport.h: allow MICROPY_PY_THREAD to be overridden - boards: add configuration files for NUCLEO_F429ZI - boards/NUCLEO_F429ZI: change USB config from HS to FS peripheral - reduce size of ESPRUINO_PICO build so it fits in flash - servo: make pyb.Servo(n) map to Pin('Xn') on all MCUs - servo: don't compile servo code when it's not enabled - use "static inline" for funcs that should be inline cc3200 port: - modusocket: simplify socket.makefile() function - make non-zero socket timeout work with connect/accept/send - modusocket: fix connect() when in non-blocking or timeout mode - use the name MicroPython consistently in code esp8266 port: - Makefile: bump axTLS TLS record buffer size to 5K - Makefile: allow FROZEN_DIR,FROZEN_MPY_DIR to be overridden - Makefile: add LIB_SRC_C variable to qstr auto-extraction list - make onewire module and support code usable by other ports - modonewire: move low-level 1-wire bus code to modonewire.c - modonewire: make timings static and remove onewire.timings func - reinstate 1-wire scripts by sym-linking to drivers/onewire/ - move mp_hal_pin_open_drain from esp_mphal.c to machine_pin.c - enable MICROPY_ENABLE_FINALISER - README: make "Documentation" a top-level section - machine_rtc: use correct arithmetic for aligning RTC mem len - mpconfigport_512k: use terse error messages to get 512k to fit - mpconfigport.h: make socket a weak link - modesp: remove unused constants: STA_MODE, etc - general: add known issue of WiFi RX buffers overflow - use size_t for mp_builtin_open argument - fix UART stop bit constants zephyr port: - Makefile: rework dependencies and "clean" target - Makefile: revert prj.conf construction rule to the previous state - remove long-obsolete machine_ptr_t typedef's - Makefile: explicitly define default target as "all" - modusocket: allow to use socketized net_context in upstream - modusocket: socket, close: switch to native Zephyr socket calls - modusocket: bind, connect, listen, accept: Swtich to native sockets - modusocket: send: switch to native sockets - modusocket: recv: switch to native sockets - modusocket: fully switch to native Zephyr sockets - modzephyr: add current_tid() and stacks_analyze() functions - prj_base.conf: enable CONFIG_INIT_STACKS - modusocket: update struct sockaddr family field name - prj_96b_carbon.conf: re-enable networking on Carbon - modzephyr: add shell_net_iface() function docs: - btree: add hints about opening db file and need to flush db - select: rename to uselect, to match the actual module name - license: update copyright year - esp8266/tutorial/intro: discourage use of 512kb firmwares - esp8266/tutorial/intro: Sphinx requires blank lines around literal blocks - conf.py: include 3 levels of ToC in latexpdf output - gc: mark mem_alloc()/mem_free() as uPy-specific - gc: document gc.threshold() function - builtins: list builtin exceptions - conf.py: set default_role = 'any' - lcd160cr: group related constants together and use full sentences - ref/speed_python: update and make more hardware-neutral - library/gc: fix grammar and improve readability of gc.threshold() - move all ports docs to the single ToC - topindex.html: remove link to wipy.io, it's no longer available - conf.py: add .venv dir to exclude_patterns - move topindex.html to templates/ subdir - differences/index_template: use consistent heading casing - builtins: add AssertionError, SyntaxError, ZeroDivisionError - add glossary - conf.py: switch to "new" format of intersphinx_mapping - conf.py: add file for global replacements definition - library: add CPython docs xref to each pertinent module - replace.inc: add |see_cpython|, to xref individual symbols from CPython - conf.py: set "version" and "release" to the same value - *_index: drop "Indices and tables" pseudo-section - pyboard: move hardware info into General Info chapter - uerrno: document "uerrno" module - esp8266/general.rst: fix name of NTP module - pyboard: move info about using Windows from topindex to general - uzlib: update description of decompress() and mention DecompIO - pyboard/tutorial/amp_skin: add example for playing large WAV files - library/ubinascii: update base64 docs - library/usocket: move socket.error to its own section - library/usocket: describe complete information on address formats - glossary: elaborate on possible MicroPython port differences - glossary: fix typos in micropython-lib paragraph - index: rewrite introduction paragraph to avoid confusion - use the name MicroPython consistently in documentation - consistently link to micropython-lib in glossary all: - make more use of mp_raise_{msg,TypeError,ValueError} helpers - unify header guard usage - remove trailing spaces, per coding conventions - don't include system errno.h when it's not needed - use the name MicroPython consistently in comments - make use of $(TOP) variable in Makefiles, instead of ".." - raise exceptions via mp_raise_XXX - make static dicts use mp_rom_map_elem_t type and MP_ROM_xxx macros README: - mention support for bytecode and frozen bytecode - improve description of precompiled bytecode; mention mpy-cross CODECONVENTIONS: - clarify MicroPython changes sign-off process - start to describe docs conventions - describe docs use of markup for None/True/False travis: - build STM32F769DISC board instead of F7DISC to test dbl-prec FP - pin cpp-coveralls at 0.3.12 ======== Sun, 11 Jun 2017 23:04:00 +1000 v1.9.1 Fixes for stmhal USB mass storage, lwIP bindings and VFS regressions This release provides an important fix for the USB mass storage device in the stmhal port by implementing the SCSI SYNCHRONIZE_CACHE command, which is now require by some Operating Systems. There are also fixes for the lwIP bindings to improve non-blocking sockets and error codes. The VFS has some regressions fixed including the ability to statvfs the root. All changes are listed below. py core: - modbuiltins: add core-provided version of input() function - objstr: catch case of negative "maxsplit" arg to str.rsplit() - persistentcode: allow to compile with complex numbers disabled - objstr: allow to compile with obj-repr D, and unicode disabled - modsys: allow to compile with obj-repr D and PY_ATTRTUPLE disabled - provide mp_decode_uint_skip() to help reduce stack usage - makeqstrdefs.py: make script run correctly with Python 2.6 - objstringio: if created from immutable object, follow copy on write policy extmod: - modlwip: connect: for non-blocking mode, return EINPROGRESS - modlwip: fix error codes for duplicate calls to connect() - modlwip: accept: fix error code for non-blocking mode - vfs: allow to statvfs the root directory - vfs: allow "buffering" and "encoding" args to VFS's open() - modframebuf: fix signed/unsigned comparison pendantic warning lib: - libm: use isfinite instead of finitef, for C99 compatibility - utils/interrupt_char: remove support for KBD_EXCEPTION disabled tests: - basics/string_rsplit: add tests for negative "maxsplit" argument - float: convert "sys.exit()" to "raise SystemExit" - float/builtin_float_minmax: PEP8 fixes - basics: convert "sys.exit()" to "raise SystemExit" - convert remaining "sys.exit()" to "raise SystemExit" unix port: - convert to use core-provided version of built-in import() - Makefile: replace references to make with $(MAKE) windows port: - convert to use core-provided version of built-in import() qemu-arm port: - Makefile: adjust object-file lists to get correct dependencies - enable micropython.mem_*() functions to allow more tests stmhal port: - boards: enable DAC for NUCLEO_F767ZI board - add support for NUCLEO_F446RE board - pass USB handler as parameter to allow more than one USB handler - usb: use local USB handler variable in Start-of-Frame handler - usb: make state for USB device private to top-level USB driver - usbdev: for MSC implement SCSI SYNCHRONIZE_CACHE command - convert from using stmhal's input() to core provided version cc3200 port: - convert from using stmhal's input() to core provided version teensy port: - convert from using stmhal's input() to core provided version esp8266 port: - Makefile: replace references to make with $(MAKE) - Makefile: add clean-modules target - convert from using stmhal's input() to core provided version zephyr port: - modusocket: getaddrinfo: Fix mp_obj_len() usage - define MICROPY_PY_SYS_PLATFORM (to "zephyr") - machine_pin: use native Zephyr types for Zephyr API calls docs: - machine.Pin: remove out_value() method - machine.Pin: add on() and off() methods - esp8266: consistently replace Pin.high/low methods with .on/off - esp8266/quickref: polish Pin.on()/off() examples - network: move confusingly-named cc3200 Server class to its reference - uos: deconditionalize, remove minor port-specific details - uos: move cc3200 port legacy VFS mounting functions to its ref doc - machine: sort machine classes in logical order, not alphabetically - network: first step to describe standard network class interface examples: - embedding: use core-provided KeyboardInterrupt object ======== Fri, 26 May 2017 19:07:37 +1000 v1.9 New VFS subsystem and scheduling framework, and less need for the heap This release adds some fundamental new components, allows for more Python operations without using the heap and has reduced code size and stack usage. Changes in the way iterators are handled allows to iterate without allocating on the heap for the types: tuple, list, str, bytes, bytearray, array, dict, set, frozenset. It also allows to call the builtins all, any, min max and sum without allocating heap memory for the iterator argument. And improvements to the handling of super() means that super().foo() method calls are now heap-less. A new generic VFS subsystem has been added which allows to mount arbitrary filesystems (even written in Python) at the root or at a mount-point within the root. The FatFS driver has been replaced with an object-oriented version (oofatfs) which allows a fully customisable filesystem layout. A scheduling framework has been implemented in the core which gives the ability to schedule callbacks to be called "as soon as possible". This allows ports to implement "soft IRQs" which allow the programmer to allocate memory during an interrupt handler, at the cost of some performance related to response time of the handler. The new micropython.schedule() function gives access to the scheduler. Other improvements to the core include: consts can now be big-nums, for example "X = const(1 << 100)"; addition of "help('modules')" to list available modules; stack usage reduced for a Python call by 8 bytes on ARM Cortex-M architectures; micropython.kbd_intr() function added to disable Ctrl-C capture; addition of uio.resource_stream(); mpy-cross is built automatically if needed; a helper tool mpy_cross_all.py is added to run mpy-cross on an entire project. The bytecode has changed in this version so existing .mpy files will need recompiling. There have also been some changes to the C API, most notably with mp_uint_t changed to size_t in many places. In the extended modules the following main changes have been made: addition of machine.Signal class to allow inversion on a Pin; framebuf has new formats of the form MONO_xxx; addition of uselect.ipoll() for allocation- free polling; addition of uos.ilistdir() for efficient iteration of a directory listing; machine.Pin high/low methods are renamed to on/off in esp8266 and zephyr (this is a backwards-incompatible change); machine.time_pulse_us() function no longer throws exceptions, but returns negative values instead. For stmhal the pyb.fault_debug() function is added, and default behaviour for a hard-fault is now an immediate reset. There is better support for F7 MCUs, in particular DMA and SD card support. A bug has been fixed with the USB VCP (USB serial) where it would in rare cases (usually when the host PC was under load) would lose characters. Pyboard now automatically mounts all available partitions on the SD card. Multithreading has been implemented and is available via the _thread module, but this feature is disabled by default and must be enabled at compile time using the MICROPY_THREAD and MICROPY_THREAD_GIL options. The ability to skip booting from SD card is now available by creating an empty file on the flash called "SKIPSD". The cc3200 port has had some backwards incompatible changes, in particular with I2C, Pin, UART and uos. Please see the documentation for the new behaviour. The esp8266 port has had a change in the size of the firmware in order to accommodate additional features. As such the filesystem for this version is incompatible with v1.8.7 and a device requires backup and erasure before flashing this version. Soft IRQs are now implemented for Pin and Timer callbacks, along with the general improvements described above. In the documentation there is now a section describing the differences between MicroPython and CPython. And code coverage is up to 98% across py/ and extmod/. Changes in code size (in bytes) between v1.8.7 and this version are: bare-arm: -1104 minimal: -1324 unix x64: -1115 unix nanbox: -11106 stmhal: +18116 cc3200: +1032 esp8266: +3060 Note that stmhal has increased significantly due to the addition of frozen bytecode and the LCD160CR driver. A detailed list of changes follows. py core: - builtinimport: raise ValueError for bad relative import, per CPython - builtinimport: remove unreachable code and change obj-import comment - runtime: refactor assert(0) to improve coverage - runtime: fix handling of throw() when resuming generator - objgenerator: when throwing an object, don't make an exc instance - objgenerator: don't raise RuntimeError if GeneratorExit ignored - parse: refactor code to remove assert(0)'s - emitnative: remove assert(0)'s or replace with mp_not_implemented - objexcept: replace if-cond and assert(0) with simple assert - runtime: refactor default case of switch to remove assert(0) - binary: mp_binary_get_size: Raise error on unsupported typecodes - formatfloat: remove unreachable code - objint_mpz: refactor switch-statement to remove unreachable default - mpz: implement mpz_set_from_bytes() as a foundation for int.from_bytes() - objint: from_bytes(): implement "byteorder" param and arbitrary precision - objint_longlong: add stub for mp_obj_int_from_bytes_impl() - add builtin help function to core, with default help msg - move weak-link map to objmodule.c, and expose module maps as public - builtinhelp: implement help('modules') to list available modules - objint: fix left-shift overflow in checking for large int - objmodule: move module init/deinit code into runtime functions - objstr: optimize string concatenation with empty string - showbc: make sure to set the const_table before printing bytecode - py.mk: add CFLAGS_MOD flag to set config file for FatFs - objstringio: allow to specify initial capacity by passing numeric argument - objset: make inplace binary operators actually modify the set - objfloat: raise ZeroDivisionError for 0 to negative power - objcomplex: correctly handle case of 0j to power of something - objset: fix inplace binary ops so frozensets are not modified - added optimised support for 3-argument calls to builtin.pow() - objstr: give correct behaviour when passing a dict to %-formatting - mpconfig.h: move PY_BUILTINS_POW3 config option to diff part of file - objstr: convert some instances of mp_uint_t to size_t - objcomplex: fix typo in ternary expression - asmxtensa.h: explicitly cast args to 32-bits so left-shift is legal - map: change mp_uint_t to size_t where appropriate - nlr: fix execstack builds for ARM - objtype: add __delattr__/__setattr__ configured by MICROPY_PY_DELATTR_SETATTR - emitbc: produce correct line number info for large bytecode chunks - objtype: replace non-ASCII single-quote char with ASCII version - modthread: use system-provided mutexs for _thread locks - vm: add MICROPY_PY_THREAD_GIL_VM_DIVISOR option - runtime: convert mp_uint_t to size_t where appropriate - mpz: convert mp_uint_t to size_t where appropriate - mpz: remove obsolete declaration of mpz_as_str_size - mpz: change type of "base" args from mp_uint_t to unsigned int - persistentcode: replace mp_uint_t with size_t where appropriate - objtuple: convert mp_uint_t to size_t where appropriate - objlist: convert mp_uint_t to size_t where appropriate - objdict: convert mp_uint_t to size_t where appropriate - objset: convert mp_uint_t to size_t where appropriate - objstr: convert mp_uint_t to size_t (and use int) where appropriate - objarray: convert mp_uint_t to size_t where appropriate - objfun: convert mp_uint_t to size_t where appropriate - objclosure: convert mp_uint_t to size_t where appropriate - objexcept: convert mp_uint_t to size_t where appropriate - objint: convert mp_uint_t to size_t where appropriate - vm: convert mp_uint_t to size_t where appropriate - add iter_buf to getiter type method - allow bytecode/native to put iter_buf on stack for simple for loops - make FOR_ITER opcode pop 1+4 slots from the stack when finished - optimise storage of iterator so it takes only 4 slots on Py stack - remove unused "use_stack" argument from for_iter_end emit function - runtime: optimise case of identity iterator so it doesn't alloc RAM - compile: optimise list/dict/set comprehensions to use stack iter - de-optimise some uses of mp_getiter, so they don't use the C stack - grammar: group no-compile grammar rules together to shrink tables - lexer: don't generate string representation for period or ellipsis - persistentcode: bump .mpy version due to change in bytecode - lexer: simplify handling of indenting of very first token - lexer: move check for keyword to name-tokenising block - lexer: use strcmp to make keyword searching more efficient - lexer: simplify handling of line-continuation error - do adjacent str/bytes literal concatenation in lexer, not compiler - lexer: convert mp_uint_t to size_t where appropriate - grammar: remove unused rule - objlist: for list slice assignment, allow RHS to be a tuple or list - moduerrno: make uerrno.errorcode dict configurable - moduerrno: make list of errno codes configurable - parse: allow parser/compiler consts to be bignums - create str/bytes objects in the parser, not the compiler - parse: simplify handling of errors by raising them directly - runtime: mp_raise_msg(): Accept NULL argument for message - objarray: disallow slice-assignment to read-only memoryview - map: fix bugs with deletion of elements from OrderedDict - move locals/globals dicts to the thread-specific state - nlr.h: mark nlr_jump_fail as NORETURN - nlrxtensa: convert from assembler to C file with inline asm - nlrx64: convert from assembler to C file with inline asm - nlrx86: convert from assembler to C file with inline asm - py.mk: force nlr files to be compiled with -Os - modsys: use MP_SMALL_INT_MAX for sys.maxsize in case of LONGINT_IMPL_NONE - runtime.c: remove optimization of '*a,=b', it caused a bug - use mp_obj_get_array where sequence may be a tuple or a list - nlrx86: add workaround for Zephyr - nlrx64: fixes to support Mac OS - objint_longlong: implement mp_obj_int_from_bytes_impl() - allow lexer to raise exceptions during construction - objint: allow to print long-long ints without using the heap - emitnative: use assertions and mp_not_implemented correctly - emitnative: remove obsolete commented out code - mpprint: fix int formatting so "+" is printed for 0-valued integer - mkrules.mk: remove special check for "-B" in qstr auto generation - objstr: fix eager optimisation of str/bytes addition - reduce size of mp_code_state_t structure - provide mp_decode_uint_value to help optimise stack usage - objstr: use better msg in bad implicit str/bytes conversion exception - add micropython.schedule() function and associated runtime code - vm: don't release the GIL if the scheduler is locked - bc: provide better error message for an unexpected keyword argument - use size_t as len argument and return type of mp_get_index - sequence: convert mp_uint_t to size_t where appropriate - define and use MP_OBJ_ITER_BUF_NSLOTS to get size of stack iter buf - lexer: remove obsolete comment, since lexer can now raise exceptions - modmath: allow trunc/ceil/floor to return a big int if necessary - objint: handle special case of -0 when classifying fp as int - modbuiltins: for round() builtin use nearbyint instead of round - modbuiltins: allow round() to return a big int if necessary - objtype: use size_t where appropriate, instead of mp_uint_t or uint - objnamedtuple: use size_t where appropriate, instead of mp_uint_t - use mp_locals/mp_globals accessor funcs instead of MP_STATE_CTX - remove MP_STATE_CTX, use MP_STATE_THREAD instead (it's an alias) - objarray: use mp_obj_str_get_str instead of mp_obj_str_get_data - nlrx86: better check for Zephyr (requires 1.7) - obj: change mp_uint_t to size_t for mp_obj_get_array_fixed_n len arg - vm: fix VM opcode tracing to print correct stack pointer - compile: when compiling super(), handle closed-over self variable - objmap: convert mp_uint_t to size_t - use mp_raise_TypeError/mp_raise_ValueError helpers where possible - lexer: simplify and reduce code size for operator tokenising - compile: simplify syntax-error messages for illegal assignments - shorten a couple of error messages - compile: provide terse error message for invalid dict/set literals - convert mp_uint_t to size_t for tuple/list accessors - change mp_uint_t to size_t for mp_obj_str_get_data len arg - objzip: convert mp_uint_t to size_t - obj.h: make sequence grow more efficient and support overlapping - objstr: use MICROPY_FULL_CHECKS for range checking when constructing bytes - add very simple but correct hashing for float and complex numbers - objint: consolidate mp_obj_new_int_from_float to one implementation - raise a ValueError if range() step is zero - objtuple: add support for inplace add (same as normal add) - make sure that static emg-exc-buffer is aligned to size of mp_obj_t - runtime: when init'ing kbd intr exc, use tuple ptr instead of object - objint: extract small int value directly because type is known - objint: use unsigned arithmetic when formatting an integer - obj: clean up and add comments describing mp_obj_type_t struct - optimise types for common case where type has a single parent type - objfloat: add implementation of high-quality float hashing - nlrsetjmp: add check for failed NLR jump - gc: execute finaliser code in a protected environment - modmicropython: add micropython.kbd_intr() function - reduce str/repr precision of float numbers when floats are 30-bit - objtype: mp_obj_new_super doesn't need to be public, so inline it - compile: don't do unnecessary check if parse node is a struct - compile: extract parse-node kind at start of func for efficiency - compile: add COMP_RETURN_IF_EXPR option to enable return-if-else opt - compile: don't do unnecessary check if iter parse node is a struct - compile: refactor handling of special super() call - add LOAD_SUPER_METHOD bytecode to allow heap-free super meth calls - mpz: strip trailing zeros from mpz value when set from bytes - mpz: in mpn_sub, use existing function to remove trailing zeros - cleanup use of global DEBUG preprocessor definition - modio: implement uio.resource_stream(package, resource_path) - objint: in int.from_bytes, only create big-int if really needed - modio: resource_stream: Implement "package" param handling - binary: handle storing big-ints to all arrays types - lexer: simplify lexer startup by using dummy bytes and next_char() - mkrules.mk: add dependency of .mpy files upon mpy-cross - lexer: process CR earlier to allow newlines checks on chr1 - modsys: update conditionals for code referencing sys.stdout - objstringio: fix StringIO reads at or beyond EOF - sequence: fix boundary errors when slicing with a negative step - objrange: fix slicing of range when step of slice is negative - mkenv.mk: use $(TOP) instead of ".." to reference tools, mpy-cross - vm: fix bug with stackless mode and unwinding of exceptions - vm: fix bug with unwind jump popping the iterator from a for loop - emitbc: fix bug with BC emitter computing Python stack size - mkrules.mk: fix auto-qstr generation when "make -B" is used - objstringio: catch mp_uint_t overflow of stream position in write() - move BYTES_PER_WORD definition from ports to py/mpconfig.h extmod: - modframebuf: optimize fill_rect subroutine call - modframebuf: clip pixels drawn by line method - modframebuf: add GS4_HMSB format - vfs_fat: rework so it can optionally use OO version of FatFS - rename vfs_fat_file.h to vfs_fat.h - add generic VFS sub-system - vfs_fat: rework to support new generic VFS sub-system - vfs: add ability for VFS sub-system to import using VfsFat - modlwip: add socket.readinto() method - vfs: expose mp_vfs_mount_t type - vfs_fat: use SECSIZE macro to determine FatFs sector size - machine_signal: implement "Signal" abstraction for machine module - vfs_fat: update to use FF_DIR instead of DIR - vfs: expose lookup_path_raw as mp_vfs_lookup_path - vfs_fat: remove MICROPY_READER_FATFS component - vfs_fat: remove MICROPY_FSUSERMOUNT_ADHOC config option - remove MICROPY_FSUSERMOUNT and related files - vfs_fat: remove MICROPY_FATFS_OO config option - merge old fsusermount.h header into vfs.h and vfs_fat.h - vfs_fat: remove unused fatfs_builtin_open function - vfs_fat: remove unused function fat_vfs_listdir - vfs_reader: fix use of NLR by popping context - vfs_fat.c: use explicit include path for timeutils.h - machine_pulse: make time_pulse_us() not throw exceptions - machine_spi: remove EVENT_POLL_HOOK from soft-SPI transfer func - machine_signal: implement Signal .on() and .off() methods - vfs: allow to mount a block device, not just a VFS object - vfs: raise OSError(EEXIST) on attempt to mkdir a mount point - vfs: allow to stat the root directory - modlwip: add my copyright - modurandom: use mp_raise_ValueError() - modutimeq: make scheduling fair (round-robin) - modutimeq: add peektime() function (provisional) - vfs_fat: remove obsolete and unused str/len members - vfs_fat: allow to compile with MICROPY_VFS_FAT disabled - vfs: rewrite path lookup algo to support relative paths from root - modframebuf: add support for monochrome horizontal format - utime_mphal: don't exit/enter the GIL in generic sleep functions - modlwip: use mp_obj_str_get_str instead of mp_obj_str_get_data - vfs_fat: fix calculation of total blocks in statvfs - moduselect: update to use size_t for array accessor - update for changes to mp_obj_str_get_data - modframebuf: make monochrome bitmap formats start with MONO_ - machine_signal: support all Pin's arguments to the constructor - machine_signal: rename "inverted" arg to "invert", it's shorter - moductypes: fix bigint handling for 32-bit ports - crypto-algorithms/sha256: remove non-standard memory.h header - moduselect: convert to MP_ROM_QSTR and friends - moduselect: refactor towards introduction of poll.ipoll() - moduselect: implement ipoll() method for alloc-free polling - modlwip: getaddrinfo: Allow to accept all 6 standard params - modlwip: ioctl POLL: Fix handling of peer closed socket - vfs: allow a VFS to be mounted at the root dir - vfs: implement mp_vfs_ilistdir() - vfs_fat: replace listdir() with implementation of ilistdir() - vfs: use MP_S_IFDIR, MP_S_IFREG consts instead of magic numbers - vfs_fat_misc: remove dot-dirs filter since FatFS already does it lib: - utils: remove old pyhelp helper, replaced with py/builtinhelp.c - utils/pyexec: only print help prompt if HELP feature is enabled - oofatfs: add OO version of FatFS library - fatfs: remove old fatfs library component, it's replaced by oofatfs - oofatfs/ffconf.h: allow to configure FS_EXFAT option - oofatfs/ffconf.h: add MICROPY_FATFS_NORTC option - utils/pyexec: allow to compile when the uPy compiler is disabled - utils/pyexec: refactor to put lexer constructors all in one place - memzip: make lexer constructor raise exception when file not found - utils/pyexec: fix bug with pyexec_file not setting flag for source - libm: add implementation of nearbyintf, from musl-1.1.16 - netutils: update for changes to mp_obj_str_get_data - utils/pyexec: update event-driven REPL to match non-event REPL drivers: - fix some minor spelling mistakes - display: add driver and test for uPy LCD160CR display - memory: add SPI flash driver, written in C - display/lcd160cr: use correct variable in set_power() - display/lcd160cr: fix bugs with lcd.get_pixel() - display/lcd160cr: fix bug with save_to_flash method - display/lcd160cr: add check that JPEG size is less than 65536 - nrf24l01: update to work on newer ports, using machine, utime - display/lcd160cr: fix get_line method and enhance screen_dump - display/lcd160cr_test: allow test to take orientation parameter - replace deprecated Pin.high()/low() methods with .__call__(1/0) tools: - tinytest-codegen.py: blacklist heapalloc_str.py test for qemu-arm - upip: update to 1.1.5. Better and more user-friendly error handling - add gen-cpydiff.py to generate docs differences - gen-cpydiff.py: set the Python import path to find test modules - gen-cpydiff.py: configurable CPython and micropython executables - tinytest-codegen: update for recent test renaming ("intbig" suffix) - pyboard: tighten up Pyboard object closure on errors - pyboard: add "exec" and "execpty" pseudo-devices support - pyboard: execpty: Use shell=False to workaround some curdir issues - pyboard: processPtyToTerminal: Add workaround for PySerial bug - pyboard: provide more details when expected reply not received - mpy-tool: make work if run from another directory - upip: upgrade to 1.1.6, supports commented lines in requirements.txt - upip: upgrade to 1.2 - mpy-tool.py: use MP_ROM_xxx macros to support nanbox builds - mpy_cross_all.py: helper tool to run mpy-cross on the entire project - mpy-tool.py: fix regression with freezing floats in obj repr C tests: - add feature check for "const" keyword and skip related tests - update test suite to be compatible with CPython 3.6 - improve stream.c test coverage - import: improve builtinimport.c test coverage - improve frozen import test coverage - update tests, and add new ones, for recent generator tweaks - io: improve test coverage of io.BufferedWriter - basics: improve runtime.c test coverage - extmod: improve test coverage of ure module - float: add test for assigning to attribute of complex number - extmod/framebuf1: add test for no-op fill_rect - micropython/opt_level: add test for opt_level 3 - misc/non_compliant: add test for inability to assign func attrs - basics: add test for assignment of attribute to bound method - add test for int.from_bytes() for arbitrary-precision integer - heapalloc_int_from_bytes: test that int.from_bytes() can work w/o alloc - add test for builtin help function - basics/builtin_help: add test for help('modules') - make sure special tests can be skipped as well - extmod/framebuf4: add tests for GS4_HMSB framebuf format - extmod/framebuf1: fix test for framebuf invalid constructor - extmod: add test for ure debug printing when compiling a regex - heapalloc_str: test for alloc-free string operations - extmod: update vfs_fat tests for new OO FatFs library - extmod/vfs_fat: update tests to work with new VFS sub-system - extmod/vfs_fat_ramdisk: make it work on pyboard - run-tests: skip frozenset tests if set literal syntax is not available - basics/zip: make skippable - thread: make thread_exc2 runable on baremetal - thread: fix stack size test so tests run reliably on baremetal - heapalloc_bytesio: test for BytesIO with preallocates space - basics/set_binop: add tests for inplace set operations - float: add tests for zero to a negative power - split tests for 2- and 3-arg pow() - basics/string_format_modulo: add more tests for dict formatting - pyb: adjust tests so they can run on PYB and PYBLITE - misc: add test for line number printing with large bytecode chunk - add option to not clear MICROPYPATH when running tests - run-tests: allow to skip tests using async/await keywords - comprehension1, containment: split set tests to separate files - builtin_dir: the most expected thing in sys is exit, test for it - basic/[a-f]*: make skippable - dict_fromkeys: revert to use reversed() to run in native codegen mode - extmod: make tests skippable - thread: replace busy waiting loops with a loop that sleeps - thread: add stress-test for creating many threads - gen_yield_from_close: use range() instead of reversed() - basic/: make various tests skippable - cmdline: update tests to pass with latest changes to bytecode - cmdline/cmd_showbc: update to work with recent changes - micropython: add test for iterating with the heap locked - micropython/heapalloc_iter: add tests for contains and unpack - cmdline: update cmd_parsetree test for changes to grammar order - cmdline/cmd_parsetree: update to work with changes to grammar - basics/string_join: add more tests for string concatenation - heapalloc_exc_raise.py: heap alloc test for raising/catching exc - cpydiff: add initial set of tests for uPy-CPython differences - cpydiff: add a test for storing iterable to a list slice - micropython: add test for consts that are bignums - extmod: add test for machine.Signal class - basics: add further tests for OrderedDict - run-tests: check for big int availability and skip related tests - basic: split tests into working with small ints and not working - float/complex1: split out intbig test - float2int*: suffix with _intbig, don't run on any other int type - string_format_modulo2: split off intbig test - basics/string_join.py: add test case where argument is not iterable - basics/unpack1.py: test if *a, = b copies b when b is a list - micropython/: split off intbig tests - uctypes_array_assign_native_le: split off intbig part - basic: make various tests skippable - float: make various tests skippable - extmod: add very basic feature test for ussl module - extmod: add websocket tests - dict_fromkeys: split out skippable part - micropython: make uio-using tests skippable - micropython/heapalloc_traceback: fix backtrace line # after refactor - micropython/opt_level: clarify the expected output for opt_level == 3 - feature_check/int_big: rework "big int" detection - basics/fun_error: split out skippable test - extmod: rename websocket test to websocket_basic - misc/: make few tests skippable - extmod: add a test for core VFS functionality, sans any filesystem - extmod/vfs_basic: add more tests for basic VFS functionality - extmod: improve re1.5/recursiveloop.c test coverage - improve binary.c test coverage - basics/struct_micropython: add test for 'S' typecode in ustruct - run-tests: re-instate skipping of doubleprec test on pyboard - extmod/vfs_basic: unmount all existing devices before doing test - extmod: improve tinfgzip.c test coverage - micropython/viper_error: add more tests to improve coverage - basics/string_format2: adjust comment now that tests succeed - basics: add test for string module formatting with int argument - basics: move string-modulo-format int tests to dedicated file - basics/bytes_add: add tests for optimised bytes addition - micropython: add tests for micropython.schedule() - heapalloc_str: test no-replacement case for str.replace() - float: add tests for math funcs that return ints - float: add tests for round() of inf, nan and large number - basics: add test for super() when self is closed over - basics: add tests for list and bytearray growing using themselves - run-tests: be sure to close Pyboard object on completion - vfs_fat_fileio.py is too big to be parsed in 16K heap, split in 2 - extmod/vfs_fat_fileio*: improve skippability - float/byte*_construct: skip on missing array module - micropython/heapalloc_iter: improve skippability - run-tests: introduce generic "minimal" target - float: add tests for hashing float and complex numbers - run-tests: update names of tests that may need skipping - basics: add tests for raising ValueError when range() gets 0 step - basics: add test for tuple inplace add - extmod/utimeq1: improve coverage of utimeq module - run-tests: search feature checks wrt to main script location - run-tests: don't post-process CRASH result in any way - micropython: add test for micropython.kbd_intr() - add tests for calling super and loading a method directly - basics: add tests for int.from_bytes when src has trailing zeros - cpydiff/core_arguments: fill in cause/workaround - cpydiff/core_function_userattr: clarify, fill in cause and workaround - cpydiff/core_import_prereg: fill in cause and workaround - io/resource_stream: add test for uio.resource_stream() - cpydiff/core_import_path: test showing difference in package.__path__ - cpydiff/core_import_split_ns_pkgs: test for split namespace packages - cpydiff/core_function_unpacking: fill in workaround - extmod: add more tests for VFS FAT - extmod: add some more VFS tests - micropython: add test for int.from_bytes with many zero bytes - move super-as-local test from cpydiff to basic tests - basics: update array test for big-int with lL typecodes - basics: add memoryview test for big ints - basics/lexer: add lexer tests for input starting with newlines - extmod: make some vfs tests fully unmount FSs before running - extmod/vfs: update tests to reflect new ilistdir() method - basics/lexer: add line continuation tests for lexer - extmod/vfs_fat: add test for ilistdir of a non-existent directory - extmod/vfs_fat_more: make skippable is uos is not available - io/bytesio_ext: test read() after seek() past end of BytesIO object - basics/list_slice_3arg: add more tests for negative slicing - basics/builtin_range: add tests for negative slicing of range - basics: add more tests for unwind jumps from within a try-finally mpy-cross: - main: move lexer constructor to within NLR handler block - fix compiler detection for including windows/fmode.c - Makefile: override undefine any inherited variables - Makefile: guard "override undefine" by test for make feature bare-arm port: - main: move lexer constructor to within NLR handler block - Makefile: change C standard from gnu99 to c99 minimal port: - update frozentest.mpy file for new .mpy version - add ability and description to build without the compiler - main: move lexer constructor to within NLR handler block - Makefile: change C standard from gnu99 to c99 - main: make Cortex-M vector table constant unix port: - coverage: move coverage #if guard back to top of file - enable builtin help function in coverage build - enable MICROPY_PY_BUILTINS_HELP_MODULES in coverage build - switch to OO version of FatFS library - get minimal version compiling again - change to use new generic VFS sub-system in coverage build - fatfs_port: include new oofatfs header - mpconfigport.h: remove obsolete MICROPY_FATFS_VOLUMES config - modos: remove VfsFat from uos module, it's now in uos_vfs module - make stack be non-executable - fix freedos port build problems - main: properly handle MICROPYPATH starting with ':' - moduselect: implement ipoll() method with no-allocation policy - modmachine: add Signal class to machine module - remove remaining, obsolete traces of GNU readline support - moduselect: properly implement ipoll object iteration - main: refactor to put lexer constructors all in one place - use mp_handle_pending() in time.sleep() - coverage: enable scheduler and add tests for it - use mp_obj_str_get_str instead of mp_obj_str_get_data - convert mp_uint_t to size_t for use of mp_obj_list_get - convert mp_uint_t to size_t in alloc.c - enabled high-quality float hashing in coverage build - remove obsolete MICROPY_FATFS macro - main: ignore SIGPIPE signal, instead make EPIPE arrive - main: don't allow to specify too small heap size - main: implement -m option for packages - Makefile: enable frozen bytecode modules dir - move upip to frozen bytecode dir - Makefile: don't add frozen bytecode to minimal build - add ilistdir in uos module - use core-provided KeyboardInterrupt exception object windows port: - .gitignore: ignore VC.db and VC.opendb files from VS2015 - make msvc project file support any version from VS2013 to VS2017 - bring mpconfigport.h up-to-date with unix port - README: convert to Markdown - README: fix some typos and grammar - README: add a note about stack usage for msvc - use core-provided KeyboardInterrupt exception object - msvc: add machine/pin-related sources to build - msvc: remove directory with generated files when cleaning - msvc: do not define DEBUG for debug builds - msvc: rebuild all qstrs when mpconfig headers are modified - msvc: workaround parser bug in older MSBuild versions qemu-arm port: - don't compile tests in "REPL" mode - mpconfigport.h: enable MICROPY_PY_BUILTINS_POW3 option - enable machine module and associated tests - add basic uos module with generic VFS capabilities - move lexer constructors to within NLR handler block stmhal port: - support PortG on STM32L476 and STM32L486 - fix wrong usage of gcc -print-libgcc-file-name - fix USB HID receive not receiving the first packet - implement ioctl for USB HID read - implement SNAK/CNAK mechanism for USB HID receive - convert to use builtin help function - enable help('modules') feature - add default frozen-bytecode directory and link lcd160cr driver - fix examples in openocd configs to include addresses - add ability to have filesystem stored on external SPI flash - boards/STM32L476DISC: use external SPI flash for filesystem - mpconfigport.h: reorganise the config options into groups - usbd_msc_storage: use storage functions instead of disk ones - convert to use VFS sub-system and new ooFatFs component - fix name of automatically created boot.py - moduos: remove duplicated chdir - use LED constants from PYBv4 onwards - set the FatFs partition number when initialising VFS object - fix stack pointer initialisation for F411 and F429 boards - README: add paragraph about building mpy-cross - on boot, mount all available partitions of the SD card - main: put /sd directory before /flash in sys.path - pin: add C-level pin ioctl method - modmachine: add machine.Signal type - main: guard init_sdcard_fs with MICROPY_HW_HAS_SDCARD - pendsv: fill in comments about what the stack contains - initial implementation of multithreading, currently disabled - main: use _estack value to initialise stack extents - fix build issue when MICROPY_PY_THREAD is disabled - mpconfigport.h: enable MICROPY_PY_BUILTINS_POW3 option - on HardFault, print stack pointer and do a stack dump - add pyb.fault_debug() function, to control hard-fault behaviour - use MICROPY_EVENT_POLL_HOOK instead of __WFI where appropriate - add ability to skip booting from SD card via /flash/SKIPSD file - Makefile: drop use of -mabi=aapcs-linux; link libgcc by default - boards: for STM32F411DISC, change I2C pin according to datasheet - implement a proper thread scheduler - use generic interrupt char code - main: remove unnecessary header includes - use mp_hal_delay_ms instead of HAL_Delay - rename sys_tick ticks/delay functions to corresp. mp_hal ones - modpyb: use utime ticks ms/us functions instead of custom ones - modnwcc3k: add include for mp_hal_delay_ms - mphalport: get ticks_cpu() working on F7 MCUs - main: allocate flash's VFS struct on the heap to trace root ptrs - enable micropython.schedule() - pendsv: disable interrupts during a thread switch - irq: shift IRQ priorities of TIM and EXTINT to be above PENDSV - pybthread: allow interrupts to work during lock/unlock of mutex - systick: make mp_hal_delay_ms release the GIL when sleeping - boards: fix alt-func config for PA5 of STM32F767 - board: fix existing and add more pin defs for NUCLEO_F767ZI - spi: clean and/or invalidate D-cache before SPI DMA transfers - hal: for F7 MCUs, expose DMA_CalcBaseAndBitshift function - dma: fix reinitialisation of DMA on F7 MCUs, following F4 - update to use size_t for tuple/list accessors - update for changes to mp_obj_str_get_data - spi: increase SPI transfer timeout, proportional to num bytes - support SDMMC alternate functions in pin generation - sdcard: add support for SDMMC2 on F7 MCUs - boards: update F76x alternate function table to add SDMMC2 - boards/STM32F769DISC: get SD card working by using SDMMC2 - boards/STM32F769DISC: fix user switch pin, and document stlink - boards: remove F769 alt function table, it's same as for F767 - dma: don't include SDMMC2 struct if SDMMC2 is not available - move L4/F7 I2C timing constants from mpconfigboard.h to i2c.c - i2c: clean the cache so that I2C DMA works on F7 MCUs - usbd_cdc_interface: increase in-endpoint timeout to 500ms - usbd_cdc_interface: change CDC RX to use a circular buffer - enable parsing of all Pin constructor args by machine.Signal - timer: clear interrupt flag before setting callback - convert all module and method tables to use MP_ROM macros - modmachine: add machine.UART class, linking to pyb.UART - modmachine: remove TODO comment that is now implemented - add machine.Pin on/off methods - add ilistdir in uos module cc3200 port: - convert to use builtin help function - add implementations of mp_import_stat and builtin_open - modusocket: remove deprecated socket.error - convert to use new VFS sub-system and new ooFatFs library - refactor "ticks" functions to use common extmod implementation - move stoupper to ftp.c and define in terms of unichar_toupper - use simplelink API instead of emulated BSD API - remove util/std.h, can just use stdio.h instead - mods/modwlan: remove unused header includes; simplify others - mods/modwlan: make multi-threaded a proper compile-time option - mods/modwlan: allow antenna diversity to be fully compiled out - mods/modwlan: add int casts to silence compiler warnings - remove remaining references to std.h - move wlan socket glue functions from modwlan to modusocket - convert to using uPy internal errno numbers - when raising OSError's use MP_Exxx as arg instead of a string - enable uerrno module with short, custom list of error codes - mods/modusocket: init vars to 0 to silence compiler warnings - remove socket.timeout class, use OSError(ETIMEDOUT) instead - moduos: remove uos.sep, as it's strictly optional - mptask: allocate flash VFS struct on the heap to trace root ptrs - mods/modutime: use generic sleep_ms and sleep_us implementations - update to use size_t for tuple/list accessors - update for changes to mp_obj_str_get_data - mods/pybi2c: raise OSError if readfrom_mem fails to write addr - modmachine: return frequency value directly, like other ports - pybuart: make parity specifications consistent with HW API - mods/pybi2c: make machine.I2C constructor/init conform to HW API - mods/pybi2c: make readfnom_mem_into/writeto_mem return None - mods/pybpin: remove toggle() method teensy port: - convert to use builtin help function - main: remove unnecessary header includes - lexerfrozen: make mp_lexer_new_from_file raise an exception esp8266 port: - convert to use builtin help function - factor out common linker code to esp8266_common.ld - switch to use OO version of FatFs library - change to use new generic VFS sub-system - fatfs_port: include new oofatfs header - machine_pin: implement pin ioctl protocol - modmachine: add Signal class - mpconfigport.h: remove obsolete MICROPY_FATFS_VOLUMES config - uart: add support for polling uart device - moduos: populate release field of uname in case it was GC'd - mpconfigport.h: enable help('modules') feature - update lexer constructors so they can raise exceptions - only execute main.py if in friendly REPL mode - enable micropython.schedule() with locking in pin callback - change machine.Timer callback to soft callback - machine_pin: add "hard" parameter to pin.irq, soft by default - machine_pin: make pin.irq arguments positional - machine_pin: fix memset size for zeroing of pin_irq_is_hard - machine_pin: fix pin.irq() to work when all args are keywords - modesp: use mp_obj_str_get_str instead of mp_obj_str_get_data - modesp: remove long-obsolete and unused espconn bindings - update to use size_t for tuple/list accessors - update for changes to mp_obj_str_get_data - remove unused entry in port root pointers - README: replace reference of alpha status to beta status - README: add notice about 512K version - change default settings to mount flash at root dir - esp8266.ld, esp8266_ota.ld: grow main firmware size by 32KB - modesp: flash_user_start: Use value from linker script - modules/flashbdev: reserve one sector for native code storage - scripts: move drivers/modules to modules/ (frozen bytecode) - scripts: move initsetup & port_diag tools to modules/ - ets_alt_task.c: prevent spurious large increment of ticks_ms() - modnetwork: in connect, fix potential buffer overflows - machine_uart: add uart.any() method - modules: mount filesystem at root when creating for first time - mpconfigport.h: remove duplicate link to lwip module - rename machine.Pin high/low methods to on/off - add ilistdir in uos module zephyr port: - help: update n_args param type to size_t - remove deprecated .mdef file - add separate Zephyr config for "minimal" build - enable SLIP networking for the default build - convert to use builtin help function - make sure that correct Zephyr config is used for "minimal" build - allow to have per-board Zephyr config fragments - prj_frdm_k64f.conf: add, enable Ethernet support - Makefile.zephyr: support and default to networked (SLIP) QEMU - README: describe many gotchas of networked builds - enable IPv6 networking in addition to IPv4 - add qemu_cortex_m3 config fragment - main: don't unconditionally dump stats on each GC - README: network startup issues with frdm_k64f resolved - modzephyr: add a module for Zephyr-specific things - modzephyr: fix typo in identifier - make sure that generated prj.conf is updated only on content changes - move "minimal" configuration building to a separate wrapper script - main: nlr_jump_fail: Fix noreturn warning - main: remove unused __fatal_error() - main: move lexer constructor to within NLR handler block - zephyr_getchar: use native k_sem instead of legacy nano_sem - prj_base.conf: disable legacy kernel compatibility - prj_base.conf: enable TCP (and UDP explicitly) - Makefile: rework to use modern, official build integration - Makefile: add workaround (fix?) for broken builds for DTS targets - fix NLR segfault in minimal build - modusocket: initial version of usocket module for Zephyr - integrate modusocket into build - modusocket: implement bind() and connect() - modusocket: implement send() - modusocket: implement recv() for UDP sockets - modusocket: implement recv() for TCP sockets - prj_base.conf: add config for net_buf logging - modusocket: be sure to use MP_OBJ_FROM_PTR - modusocket: factor out socket_new() function - zephyr_getchar: explicitly yield to other threads on char availability - Makefile: add "test" target, runs testsuite in QEMU - modusocket: factor out "extended k_fifo API" - modusocket: implement listen() - modusocket: socket_bind: Don't set recv callback on STREAM sockets - modusocket: implement accept() - mpconfigport.h: fix build if usocket module is disabled - modmachine: add Signal class - machine_pin: implement pin protocol for machine.Signal support - modusocket: call net_nbuf_print_frags() in recv callback if DEBUG > 1 - modusocket: strip packet header right in the receive callback - modmachine: implement machine.reset() - main: configure IPv4 netmask and gateway to allow Internet access - add 96b_carbon configuration - modusocket: refactor send() into stream write() method - modusocket: enable stream write() method - modusocket: refactor recv() into stream read() method - modusocket: add read/readline/readinto stream methods - modusocket: sock_read: Check socket status only at the start of packet - modusocket: add dummy makefile() implementation - Makefile: add debugserver Zephyr target - mpconfigport.h: enable line number information for scripts - main: remove superfluous include - modusocket: add dummy setsockopt() implementation - modusocket: add SOL_SOCKET and SO_REUSEADDR constants - prj_qemu_x86.conf: bump RAM size to 320K - README: update to require Zephyr 1.8 - modusocket: wrap pkt_get_info() call - modusocket: update for net_pkt refactor - modusocket: switch to net_pkt_append() returning length - modusocket: if there're no packets in recv_q, cancel waiter - modusocket: implement getaddrinfo() - modusocket: first step to switch to alternative FIFO processing - modusocket: get rid of cur_pkt object member - main: check default netif before applying operations to it - modusocket: getaddrinfo: Use RAISE_ERRNO for proper error decoding - modusocket: getaddrinfo: Raise OSError on resolution timeout, etc - modusocket: use DEBUG_PRINT macro name as other modules do - rename machine.Pin high/low methods to on/off - don't send more than MTU allows - modusocket: handle a case when recv_q is empty when EOF is signaled pic16bit port: - main: make nlr_jump_fail never return - main: make mp_lexer_new_from_file raise an exception README: - explicitly mention "await" support, and formatting for keywords - add link to docs.micropython.org - describe extmod/ dir - change Travis & Coveralls badges to not use link references travis: - unconditionally run coveralls analysis, even if others failed - change an stmhal rule to build PYBV11 instead of default PYBV10 gitattributes: - add .mpy files to list of binary files - remove obsolete lines docs: - fix some minor spelling mistakes - add documentation for lcd160cr module - pyboard/tutorial: add tutorial for LCD160CR - library/lcd160cr: fix set_brightness range, should be 0..31 - machine.Timer: move WiPy adhoc parts to its documentation - machine: add explicit note on machine module level and scope - usocket: clarify exceptions used - usocket: elaborate "Constants" section - usocket: clarify description of various methods - usocket: dedent Methods section - uio: describe differences between uPy an CPy stream hierarchy - conf.py: add myself as a copyright holder on the docs - uio: typo fixes/lexical improvements - pyboard/tutorial/lcd160cr_skin: fix typo, get_touched->get_touch - for LCD160CR driver and tutorial, add link to positioning image - esp8266/tutorial: specify the baudrate in picocom example command - add M-logo as favicon - library/pyb.Pin: minor typo fix, B6 should be A0 - library/machine: make separate TOC for WiPy vs non-WiPy - uos: remove mention of uos.sep - library/lcd160cr: mention the valid values for set_power() method - modify Makefile and indexes to generate cPy-differences pages - uhashlib: provide port-neutral description - Makefile: define and use PYTHON as the interpreter for CPYDIFF - machine: fix formatting of Constants section - library/lcd160cr: add note about supported JPEG format/encodings - library: add framebuf documentation - library/lcd160cr: add link to framebuf page - esp8266/tutorial: update since esptool 1.3 added Python 3 support - library/framebuf: fix typo in bit-width for MVLSB description - library/machine.I2C: fix scan() doc to match implementation - library/btree: add btree module docs - utime: de-conditionalize description of sleep_ms() and friends - uos: de-conditionalize statvfs() description - machine.SPI: remove outdated wipy chunk - machine.Pin: move wipy-specific details to its own docs - machine.Pin: move wipy-specific methods to its docs - esp8266/general: start explicit "Known Issues", mentioned RTC inaccuracy - library/builtins: int: Add notice on byteorder param for to/from_bytes - library/machine.UART: remove some conditionals - utime: deconditionalize description of sleep() - usocket: deconditionalize - uhashlib: deconditionalize - esp8266/tutorial/intro: reword section on flash size requirement - library/micropython: deconditionalize - library/uos: urandom: Generalize description - library/ussl: deconditionalize, wipy notes moved to its documentation - machine.UART: deconditionalize normal methods - machine: move machine.main() misnomer to wipy's known issues - library/machine: typo fix in machine_callbacks section - library/machine.UART: remove pyboard-specific section - wipy/quickref: update reference for change to I2C API - wipy/general: add section about specifics of I2C implementation - library/machine.I2C: deconditionalise all methods - library/machine.*: add cross-reference label to individual classes - esp8266/quickref: add links from quickref page to machine classes - library/machine.I2C: remove WiPy-specific return values - library/machine.SPI: fix formatting of bullet list to stop warning - library/uos: add description of uos.ilistdir() function - machine.Pin: there's no toggle() method in MicroPython hardware API - machine.Signal: add initial draft description of Signal class - library/index: add important summary of the intro section as warning - change single occurrence of "Micropython" to "MicroPython" - library/micropython: document the newer micropython functions - library/machine.UART: update and improve uart.any() docs - library/machine.Pin: remove .id() method and .board class attr examples: - hwapi: use Signal for inverted LED on ESP-12 - hwapi: consistently use Signal class to define LEDs - button_reaction: update for time_pulse_us() no longer raising exc - hwapi: add hwconfig_pyboard.py for pyboard - hwapi: be sure to import Signal when it's used - hwapi/soft_pwm: use Signal on()/off() methods - embedding/README: convert to markdown, grammar and clarity fixes - embedding: place lexer constructor within NLR handler block - hwapi: add config for Zephyr port of 96Boards Carbon - hwapi/hwconfig*: use inline Signal() args where possible - hwapi/soft_pwm2_uasyncio: update for call_later_ms() ======== Sun, 8 Jan 2017 23:53:08 +1100 v1.8.7 Support for Xtensa emitter and assembler, and upgraded F4 and F7 STM HAL This release adds support for the Xtensa architecture as a target for the native emitter, as well as Xtensa inline assembler. The int.from_bytes and int.to_bytes methods now require a second argument (the byte order) per CPython (only "little" is supported at this time). The "readall" method has been removed from all stream classes that used it; "read" with no arguments should be used instead. There is now support for importing packages from compiled .mpy files. Test coverage is increased to 96%. The generic I2C driver has improvements: configurable clock stretching timeout, "stop" argument added to readfrom/writeto methods, "nack" argument added to readinto, and write[to] now returns num of ACKs received. The framebuf module now handles 16-bit depth (generic colour format) and has hline, vline, rect, line methods. A new utimeq module is added for efficient queue ordering defined by modulo time (to be compatible with time.ticks_xxx functions). The pyboard.py script has been modified so that the target board is not reset between scripts or commands that are given on a single command line. For the stmhal port the STM Cube HAL has been upgraded: Cube F4 HAL to v1.13.1 (CMSIS 2.5.1, HAL v1.5.2) and Cube F7 HAL to v1.1.2. There is a more robust pyb.I2C implementation (DMA is now disabled by default, can be enabled via an option), and there is an implementation of machine.I2C with robust error handling and hardware acceleration on F4 MCUs. It is now recommended to use machine.I2C instead of pyb.I2C. The UART class is now more robust with better handling of errors/timeouts. There is also more accurate VBAT and VREFINT measurements for the ADC. New boards that are supported include: NUCLEO_F767ZI, STM32F769DISC and NUCLEO_L476RG. For the esp8266 port select/poll is now supported for sockets using the uselect module. There is support for native and viper emitters, as well as an inline assembler (with limited iRAM for storage of native functions, or the option to store code to flash). There is improved software I2C with a slight API change: scl/sda pins can be specified as positional only when "-1" is passed as the first argument to indicate the use of software I2C. It is recommended to use keyword arguments for scl/sda. There is very early support for over-the-air (OTA) updates using the yaota8266 project. A detailed list of changes follows. py core: - emitnative: fix native import emitter when in viper mode - remove readall() method, which is equivalent to read() w/o args - objexcept: allow clearing traceback with 'exc.__traceback__ = None' - runtime: mp_resume: handle exceptions in Python __next__() - mkrules.mk: rework find command so it works on OSX - *.mk: replace uses of 'sed' with $(SED) - parse: move function to check for const parse node to parse.[ch] - parse: make mp_parse_node_new_leaf an inline function - parse: add code to fold logical constants in or/and/not operations - factor persistent code load/save funcs into persistentcode.[ch] - factor out persistent-code reader into separate files - lexer: rewrite mp_lexer_new_from_str_len in terms of mp_reader_mem - lexer: provide generic mp_lexer_new_from_file based on mp_reader - lexer: rewrite mp_lexer_new_from_fd in terms of mp_reader - lexer: make lexer use an mp_reader as its source - objtype: implement __call__ handling for an instance w/o heap alloc - factor out common code from assemblers into asmbase.[ch] - stream: move ad-hoc ioctl constants to stream.h and rename them - compile: simplify configuration of native emitter - emit.h: remove long-obsolete declarations for cpython emitter - move arch-specific assembler macros from emitnative to asmXXX.h - asmbase: add MP_PLAT_COMMIT_EXEC option for handling exec code - asmxtensa: add low-level Xtensa assembler - integrate Xtensa assembler into native emitter - allow inline-assembler emitter to be generic - add inline Xtensa assembler - emitinline: embed entire asm struct instead of a pointer to it - emitinline: move inline-asm align and data methods to compiler - emitinline: move common code for end of final pass to compiler - asm: remove need for dummy_data when doing initial assembler passes - objint: from_bytes, to_bytes: require byteorder arg, require "little" - binary: do zero extension when storing a value larger than word size - builtinimport: support importing packages from compiled .mpy files - mpz: remove unreachable code in mpn_or_neg functions - runtime: zero out fs_user_mount array in mp_init - mpconfig.h: enable MICROPY_PY_SYS_EXIT by default - add MICROPY_KBD_EXCEPTION config option to provide mp_kbd_exception - compile: add an extra pass for Xtensa inline assembler - modbuiltins: remove unreachable code - objint: rename mp_obj_int_as_float to mp_obj_int_as_float_impl - emitglue: refactor to remove assert(0), to improve coverage - lexer: remove unreachable code in string tokeniser - lexer: remove unnecessary check for EOF in lexer's next_char func - lexer: permanently disable the mp_lexer_show_token function - parsenum: simplify and generalise decoding of digit values - mpz: fix assertion in mpz_set_from_str which checks value of base - mpprint: add assertion for, and comment about, valid base values - objint: simplify mp_int_format_size and remove unreachable code - unicode: comment-out unused function unichar_isprint - consistently update signatures of .make_new and .call methods - mkrules.mk: add MPY_CROSS_FLAGS option to pass flags to mpy-cross - builtinimport: fix bug when importing names from frozen packages extmod: - machine_i2c: make the clock stretching timeout configurable - machine_i2c: raise an error when clock stretching times out - machine_i2c: release SDA on bus error - machine_i2c: add a C-level I2C-protocol, refactoring soft I2C - machine_i2c: add argument to C funcs to control stop generation - machine_i2c: rewrite i2c.scan in terms of C-level protocol - machine_i2c: rewrite mem xfer funcs in terms of C-level protocol - machine_i2c: remove unneeded i2c_write_mem/i2c_read_mem funcs - machine_i2c: make C-level functions return -errno on I2C error - machine_i2c: add 'nack' argument to i2c.readinto - machine_i2c: make i2c.write[to] methods return num of ACKs recvd - machine_i2c: add 'stop' argument to i2c readfrom/writeto meths - machine_i2c: remove trivial function wrappers - machine_i2c: expose soft I2C obj and readfrom/writeto funcs - machine_i2c: add hook to constructor to call port-specific code - modurandom: allow to build with float disabled - modframebuf: make FrameBuffer handle 16bit depth - modframebuf: add back legacy FrameBuffer1 "class" - modframebuf: optimise fill and fill_rect methods - vfs_fat: implement POSIX behaviour of rename, allow to overwrite - moduselect: use stream helper function instead of ad-hoc code - moduselect: use configurable EVENT_POLL_HOOK instead of WFI - modlwip: add ioctl method to socket, with poll implementation - vfs_fat_file: allow file obj to respond to ioctl flush request - modbtree: add method to sync the database - modbtree: rename "sync" method to "flush" for consistency - modframebuf: add hline, vline, rect and line methods - machine_spi: provide reusable software SPI class - modframebuf: make framebuf implement the buffer protocol - modframebuf: store underlying buffer object to prevent GC free - modutimeq: copy of current moduheapq with timeq support for refactoring - modutimeq: refactor into optimized class - modutimeq: make time_less_than be actually "less than", not less/eq lib: - utils/interrupt_char: use core-provided mp_kbd_exception if enabled drivers: - display/ssd1306.py: update to use FrameBuffer not FrameBuffer1 - onewire: enable pull up on data pin - onewire/ds18x20: fix negative temperature calc for DS18B20 tools: - tinytest-codegen: blacklist recently added uheapq_timeq test (qemu-arm) - pyboard.py: refactor so target is not reset between scripts/cmd - mpy-tool.py: add support for OPT_CACHE_MAP_LOOKUP_IN_BYTECODE tests: - micropython: add test for import from within viper function - use read() instead of readall() - basics: add test for logical constant folding - micropython: add test for creating traceback without allocation - micropython: move alloc-less traceback test to separate test file - extmod: improve ujson coverage - basics: improve user class coverage - basics: add test for dict.fromkeys where arg is a generator - basics: add tests for if-expressions - basics: change dict_fromkeys test so it doesn't use generators - basics: enable tests for list slice getting with 3rd arg - extmod/vfs_fat_fileio: add test for constructor of FileIO type - extmod/btree1: exercise btree.flush() - extmod/framebuf1: add basics tests for hline, vline, rect, line - update for required byteorder arg for int.from_bytes()/to_bytes() - extmod: improve moductypes test coverage - extmod: improve modframebuf test coverage - micropython: get heapalloc_traceback test running on baremetal - struct*: make skippable - basics: improve mpz test coverage - float/builtin_float_round: test round() with second arg - basics/builtin_dir: add test for dir() of a type - basics: add test for builtin locals() - basics/set_pop: improve coverage of set functions - run-tests: for REPL tests make sure the REPL is exited at the end - basics: improve test coverage for generators - import: add a test which uses ... in from-import statement - add tests to improve coverage of runtime.c - add tests to improve coverage of objarray.c - extmod: add test for utimeq module - basics/lexer: add a test for newline-escaping within a string - add a coverage test for printing the parse-tree - utimeq_stable: test for partial stability of utimeq queuing - heapalloc_inst_call: test for no alloc for simple object calls - basics: add tests for parsing of ints with base 36 - basics: add tests to improve coverage of binary.c - micropython: add test for micropython.stack_use() function - extmod: improve ubinascii.c test coverage - thread: improve modthread.c test coverage - cmdline: improve repl.c autocomplete test coverage - unix: improve runtime_utils.c test coverage - pyb/uart: update test to match recent change to UART timeout_char - run-tests: allow to skip set tests - improve warning.c test coverage - float: improve formatfloat.c test coverage using Python - unix: improve formatfloat.c test coverage using C - unix/extra_coverage: add basic tests to import frozen str and mpy - types1: split out set type test to set_types - array: allow to skip test if "array" is unavailable - unix/extra_coverage: add tests for importing frozen packages unix port: - rename define for unix moduselect to MICROPY_PY_USELECT_POSIX - Makefile: update freedos target for change of USELECT config name - enable utimeq module - main: allow to print the parse tree in coverage build - Makefile: make "coverage_test" target mirror Travis test actions - moduselect: if file object passed to .register(), return it in .poll() - Makefile: split long line for coverage target, easier to modify - enable and add basic frozen str and frozen mpy in coverage build - Makefile: allow cache-map-lookup optimisation with frozen bytecode windows port: - enable READER_POSIX to get access to lexer_new_from_file stmhal port: - dma: de-init the DMA peripheral properly before initialising - i2c: add option to I2C to enable/disable use of DMA transfers - i2c: reset the I2C peripheral if there was an error on the bus - rename mp_hal_pin_set_af to _config_alt, to simplify alt config - upgrade to STM32CubeF4 v1.13.0 - CMSIS/Device 2.5.1 - upgrade to STM32CubeF4 v1.13.0 - HAL v1.5.1 - apply STM32CubeF4 v1.13.1 patch - upgrade HAL driver to v1.5.2 - hal/i2c: reapply HAL commit ea040a4 for f4 - hal/sd: reapply HAL commit 1d7fb82 for f4 - hal: reapply HAL commit 9db719b for f4 - hal/rcc: reapply HAL commit c568a2b for f4 - hal/sd: reapply HAL commit 09de030 for f4 - boards: configure all F4 boards to work with new HAL - make-stmconst.py: fix regex's to work with current CMSIS - i2c: handle I2C IRQs - dma: precalculate register base and bitshift on handle init - dma: mark DMA sate as READY even if HAL_DMA_Init is skipped - can: clear FIFO flags in IRQ handler - i2c: provide custom IRQ handlers - hal: do not include in HAL headers - mphalport.h: use single GPIOx->BSRR register - make-stmconst.py: add support for files with invalid utf8 bytes - update HALCOMMITS due to change to hal - make-stmconst.py: restore Python 2 compatibility - update HALCOMMITS due to change to hal - moduselect: move to extmod/ for reuse by other ports - i2c: use the HAL's I2C IRQ handler for F7 and L4 MCUs - updates to get F411 MCUs compiling with latest ST HAL - i2c: remove use of legacy I2C_NOSTRETCH_DISABLED option - add beginnings of port-specific machine.I2C implementation - i2c: add support for I2C4 hardware block on F7 MCUs - i2c: expose the pyb_i2c_obj_t struct and some relevant functions - machine_i2c: provide HW implementation of I2C peripherals for F4 - add support for flash storage on STM32F415 - add back GPIO_BSRRL and GPIO_BSRRH constants to stm module - add OpenOCD configuration for STM32L4 - add address parameters to openocd config files - adc: add "mask" selection parameter to pyb.ADCAll constructor - adc: provide more accurate measure of VBAT and VREFINT - adc: make ADCAll.read_core_temp return accurate float value - adc: add ADCAll.read_vref method, returning "3.3v" value - adc: add support for F767 MCU - adc: make channel "16" always map to the temperature sensor - sdcard: clean/invalidate cache before DMA transfers with SD card - moduos: implement POSIX behaviour of rename, allow to overwrite - adc: use constants from new HAL version - refactor UART configuration to use pin objects - uart: add support for UART7 and UART8 on F7 MCUs - uart: add check that UART id is valid for the given board - cmsis: update STM32F7 CMSIS device include files to V1.1.2 - hal: update ST32CubeF7 HAL files to V1.1.2 - port of f4 hal commit c568a2b to updated f7 hal - port of f4 hal commit 09de030 to updated f7 hal - port of f4 hal commit 1d7fb82 to updated f7 hal - declare and initialise PrescTables for F7 MCUs - boards/STM32F7DISC: define LSE_STARTUP_TIMEOUT - hal: update HALCOMMITS due to change in f7 hal files - refactor to use extmod implementation of software SPI class - cmsis: add CMSIS file stm32f767xx.h, V1.1.2 - add NUCLEO_F767ZI board, with openocd config for stm32f7 - cmsis: add CMSIS file stm32f769xx.h, V1.1.2 - add STM32F769DISC board files - move PY_SYS_PLATFORM config from board to general config file - mpconfigport: add weak-module links for io, collections, random - rename mp_const_vcp_interrupt to mp_kbd_exception - usb: always use the mp_kbd_exception object for VCP interrupt - use core-provided keyboard exception object - led: properly initialise timer handle to zero before using it - mphalport.h: explicitly use HAL's GPIO constants for pull modes - usrsw: use mp_hal_pin_config function instead of HAL_GPIO_Init - led: use mp_hal_pin_config function instead of HAL_GPIO_Init - sdcard: use mp_hal_pin_config function instead of HAL_GPIO_Init - add support for STM32 Nucleo64 L476RG - uart: provide a custom function to transmit over UART - uart: increase inter-character timeout by 1ms - enable utimeq module cc3200 port: - tools/smoke.py: change readall() to read() - pybspi: remove static mode=SPI.MASTER parameter for latest HW API - mods/pybspi: remove SPI.MASTER constant, it's no longer needed - update for moduselect moved to extmod/ - re-add support for UART REPL (MICROPY_STDIO_UART setting) - enable UART REPL by default - README: (re)add information about accessing REPL on serial - make: rename "deploy" target to "deploy-ota" - add targets to erase flash, deploy firmware using cc3200tool - README: reorganize and update to the current state of affairs - modwlan: add network.WLAN.print_ver() diagnostic function esp8266 port: - enable uselect module - move websocket_helper.py from scripts to modules for frozen BC - refactor to use extmod implementation of software SPI class - mpconfigport_512k: disable framebuf module for 512k build - enable native emitter for Xtensa arch - enable inline Xtensa assembler - add "ota" target to produce firmware binary for use with yaota8266 - use core-provided keyboard exception object - add "erase" target to Makefile, to erase entire flash - when doing GC be sure to trace the memory holding native code - modesp: flash_user_start(): support configuration with yaota8266 - force relinking OTA firmware image if built after normal one - scripts/inisetup: dump FS starting sector/size on error - Makefile: produce OTA firmware as firmware-ota.bin - modesp: make check_fw() work with OTA firmware - enable utimeq module - Makefile: put firmware-ota.bin in build/, for consistency - modules/flashbdev: add RESERVED_SECS before the filesystem - modules/flashbdev: remove code to patch bootloader flash size - modules/flashbdev: remove now-unused function set_bl_flash_size - modules/flashbdev: change RESERVED_SECS to 0 zephyr port: - add .gitignore to ignore Zephyr's "outdir" directory - zephyr_getchar: update to Zephyr 1.6 unified kernel API - switch to Zephyr 1.6 unified kernel API - support raw REPL - implement soft reset feature - main: initialize sys.path and sys.argv - use core-provided keyboard exception object - uart_core: access console UART directly instead of printk() hack - enable slice subscription docs: - remove references to readall() and update stream read() docs - library/index: elaborate on u-modules - library/machine.I2C: refine definitions of I2C methods - library/pyb.Accel: add hardware note about pins used by accel - library/pyb.UART: added clarification about timeouts - library/pyb.UART: moved writechar doc to sit with other writes - esp8266/tutorial: update intro to add Getting the firmware section - library/machine.I2C: fix I2C constructor docs to match impl - esp8266/tutorial: close socket after reading page content - esp8266/general: add "Scarcity of runtime resources" section - library/esp: document esp.set_native_code_location() function - library/esp: remove para and add further warning about flash - usocket: clarify that socket timeout raises OSError exception travis: - build STM32 F7 and L4 boards under Travis CI - include persistent bytecode with floats in coverage tests examples: - hwapi: button_led: Add GPIO pin read example - hwapi: add soft_pwm example converted to uasyncio - http_client: use read() instead of readall() - hwapi: add uasyncio example of fading 2 LEDs in parallel - hwapi: add example for machine.time_pulse_us() - hwapi: add hwconfig for console tracing of LED operations - accellog.py: change 1: to /sd/, and update comment about FS - hwapi/hwconfig_console: don't alloc memory in value() ======== Thu, 10 Nov 2016 21:24:53 +1100 v1.8.6 ESP8266 port uses SDK 2.0, has more heap, has support for 512k devices This release brings some code size reductions to the core as well as more tests and improved coverage which is now at 94.3%. The time.ticks_diff(a, b) function has changed: the order of the arguments has been swapped so that it behaves like "a - b", and it can now return a negative number if "a" came before "b" (modulo the period of the ticks functions). For the ESP8266 port the Espressif SDK has been updated to 2.0.0, the heap has been increased from 28k to 36k, and there is support for 512k devices via "make 512k". upip is included by default as frozen bytecode. The network module now allows access-point reconnection without WiFi credentials, and exposes configuration for the station DHCP hostname. The DS18B20 driver now handles negative temperatures, and NeoPixel and APA102 drivers handle 4 bytes-per-pixel LEDs. For the CC3200 port there is now support for loading of precompiled .mpy files and threading now works properly with interrupts. A detailed list of changes follows. py core: - py.mk: automatically add frozen.c to source list if FROZEN_DIR is defined - be more specific with MP_DECLARE_CONST_FUN_OBJ macros - specialise builtin funcs to use separate type for fixed arg count - {modbuiltins,obj}: use MP_PYTHON_PRINTER where possible - modbuiltins: add builtin "slice", pointing to existing slice type - add "delattr" builtin, conditional on MICROPY_CPYTHON_COMPAT - sequence: fix reverse slicing of lists - fix null pointer dereference in mpz.c, fix missing va_end in warning.c - remove asserts that are always true in emitbc.c - fix wrong assumption that m_renew will not move if shrinking - change config default so m_malloc0 uses memset if GC not enabled - add MICROPY_FLOAT_CONST macro for defining float constants - move frozen bytecode Makefile rules from ports to common mk files - strip leading dirs from frozen mpy files, so any path can be used extmod: - vfs_fat_file: check fatfs f_sync() and f_close() returns for errors - vfs_fat_file: make file.close() a no-op if file already closed - utime_mphal: ticks_diff(): switch arg order, return signed value - utime_mphal: add MP_THREAD_GIL_EXIT/ENTER warppers for sleep functions - utime_mphal: implement ticks_add(), add to all maintained ports - utime_mphal: allow ticks functions period be configurable by a port lib: - utils/pyhelp.c: use mp_printf() instead of printf() - utils/pyexec: add mp_hal_set_interrupt_char() prototype - libm: move Thumb-specific sqrtf function to separate file drivers: - add "from micropython import const" when const is used tools: - upgrade upip to 1.1.4: fix error on unix when installing to non-existing absolute path - pip-micropython: remove deprecated wrapper tool - check_code_size.sh: code size validation script for CI - replace upip tarball with just source file, to make its inclusion as frozen modules in multiple ports less magic tests: - extmod/vfs_fat: improve VFS test coverage - basics/builtin_slice: add test for "slice" builtin name - basics: add test for builtin "delattr" - extmod/vfs_fat_fsusermount: improve fsusermount test coverage - extmod/vfs_fat_oldproto: test old block device protocol - basics/gc1: garbage collector threshold() coverage - extmod/uhashlib_sha1: coverage for SHA1 algorithm - extmod/uhashlib_sha256: rename sha256.py test - btree1: fix out of memory error running on esp8266 - extmod/ticks_diff: test for new semantics of ticks_diff() - extmod/framebuf1: test framebuffer pixel clear, and text function minimal port: - Makefile: split rule for firmware.bin generation unix port: - Makefile: remove references to deprecated pip-micropython - modtime: use ticks_diff() implementation from extmod/utime_mphal.c - mphalport.h: add warning of mp_hal_delay_ms() implementation - modtime: switch ticks/sleep_ms/us() to utime_mphal - fix symbol references for x86 Mac - replace upip tarball with just source file windows port: - enable utime_mphal following unix, define mp_hal_ticks_* - fix utime_mphal compilation for msvc - implement mp_hal_ticks_cpu in terms of QueryPerformanceCounter qemu-arm port: - exclude ticks_diff test for qemu-arm port - exclude extmod/vfs_fat_fileio.py test - exclude new vfs_fat tests - enable software floating point support, and float tests stmhal port: - modutime: refactor to use extmod's version of ticks_cpu - refactor pin usage to use mp_hal_pin API - led: refactor LED to use mp_hal_pin_output() init function - Makefile: use standard rules for frozen module generation - modutime: consistently convert to MP_ROM_QSTR/MP_ROM_PTR - enable SD power save (disable CLK on idle) cc3200 port: - use mp_raise_XXX helper functions to reduce code size - mods/pybspi: allow "write" arg of read/readinto to be positional - enable loading of precompiled .mpy files - fix thread mutex's so threading works with interrupts teensy port: - update to provide new mp_hal_pin_XXX functions following stmhal esp8266 port: - Makefile: use latest esptool.py flash size auto-detection - esp_init_data: auto-initialize system params with vendor SDK 2.0.0 - esp8266.ld: move help.o to iROM - esp8266.ld: move modmachine.o to iROM - esp8266.ld: move main.o to iROM - add MP_FASTCODE modifier to put a function to iRAM - main: mark nlr_jump_fail() as MP_FASTCODE - modules/webrepl: enforce only one concurrent WebREPL connection - etshal.h: add few more ESP8266 vendor lib prototypes - modesp: add flash_user_start() function - add support for building firmware version for 512K modules - scripts: make neopixel/apa102 handle 4bpp LEDs with common code - modutime: consistently convert to MP_ROM_QSTR/MP_ROM_PTR - modnetwork: config(): fix copy-paste error in setting "mac" - scripts/port_diag: add descriptions for esf_buf types - modnetwork.c: allows AP reconnection without WiFi credentials - main: bump heap size to 36K - etshal.h: add prototypes for SPIRead/SPIWrite/SPIEraseSector - etshal.h: adjust size of MD5_CTX structure - modules: fix negative temperature in ds18x20 driver - rename "machine" module implementation to use contemporary naming - rework webrepl_setup to run over wired REPL - espneopixel.c: solve glitching LED issues with cpu at 80MHz - include upip as a standard frozen bytecode module - update docs for esptool 1.2.1/SDK 2.0 (--flash_size=detect) - modnetwork.c: expose configuration for station DHCP hostname zephyr port: - implement utime module - use board/SoC values for startup banner based on Zephyr config - initial implementation of machine.Pin - zephyr_getchar: update for recent Zephyr refactor of console hooks - support time -> utime module "weaklink" - README: update for the current featureset, add more info - mpconfigport.h: move less important params to the bottom - Makefile: allow to adjust heap size from make command line - Makefile: update comments to the current state of affairs - Makefile: allow to override Zephyr config from make command line - Makefile: add minimal port - Makefile: add -fomit-frame-pointer to reduce code size - mphalport.h: update for new "unified" kernal API (sleep functions) docs: - machine.SPI: bring up to date with Hardware API, make vendor-neutral - machine.SPI: improve descriptions of xfer methods - library/builtins: add docs for delattr and slice - library/network: reword intro paragraph - library/network: typo fixes, consistent acronym capitalization - library/index: update TOCs so builtins sorted before modules - utime: document ticks_cpu() in more detail - utime: describe new semantics of ticks_diff() (signed ring arithmetics) - utime: add docs for ticks_add(), improvements for other ticks_*() - esp8266: update for new WebREPL setup procedure - */quickref.rst: use new semantics of ticks_diff() - library/machine.Pin: update Pin docs to align with new HW API travis: - integrate tools/check_code_size.sh - minimal: Use CROSS=1, for binary size check examples: - http_server_simplistic: add "not suitable for real use" note - hwapi: example showing best practices for HW API usage in apps - hwapi: add hwconfig for DragonBoard 410c ======== Mon, 17 Oct 2016 15:32:43 +1100 v1.8.5 New port to Zephyr, upip runs on baremetal, and reduction in code size This release adds a new port of MicroPython to run on top of the Zephyr real-time operating system. As part of this there is now basic support for using mbedTLS as the ussl module. The release also brings initial support for running the package manager upip on baremetal systems with low heap memory (such as esp8266), through a Python module interface. Work has been done in this release to clean up the core, removing redundant and/or unreachable code, and factoring existing duplicated code patterns. This brings a reduction of 828 bytes in code size to the bare-arm port, and 1368 bytes to the minimal port. There is also improved coverage through the addition of new tests for corner cases. The "micropython" module sees the addition of the "const" identity function which should be used as "from micropython import const" in scripts that want to use the MicroPython constant optimisations in the compile stage. There is also the addition of the "opt_level" function to change the parser/compiler optimisation level at runtime. The behaviour of "sys.exit" (and "raise SystemExit") on baremetal is now changed: this function no longer does a soft-reset of the board, rather it just stops the running script and drops to the REPL. In order to do an actual soft reset the "machine.soft_reset" function has been added (to the stmhal port only, for the time being). Following CPython, KeyError exceptions for dictionary lookups now have the failed key stored as the argument of the exception instance, accessible as exc.args[0]. The "ujson.load" function has also been added, to load JSON data from an arbitrary stream. The I2C support in the machine module now has clock stretching, the addition of the "addrsize" parameter in memory transfer methods, and I2C scanning now uses dummy writes instead of dummy reads to make the scanning more reliable. The CMSIS library has been upgrade to v4.30, and the boards section of the stmhal port has been refactored to use a common.ld script. The stmhal port now has a full implementation of the machine.SPI class, with support for both hardware SPI peripherals and fast software SPI. The USB HID driver in stmhal has added support to receive USB HID messages from the host. py core: - asmthumb: flush D-cache, and invalidate I-cache on STM32F7 - makeqstrdefs.py: use python 2.6 syntax for set creation - objnone: remove unnecessary handling of MP_UNARY_OP_BOOL - move frozen modules rules from esp8266 port for reuse across ports - combine 3 comprehension emit functions (list/dict/set) into 1 - combine 3 comprehension opcodes (list/dict/set) into 1 - vstr: remove vstr.had_error flag and inline basic vstr functions - objnone: use mp_generic_unary_op instead of custom one - showbc: make printf's go to the platform print stream - remove 'name' member from mp_obj_module_t struct - builtinimport: fix nanbox build after change to better handle -m modules - stream: remove unnecessary check for NULL return from vstr_extend - py.mk: suppress some compiler warnings when building berkeley-db - shrink mp_arg_t struct by using reduced-size integer members - update opcode format table because 3 opcodes were removed, 1 added - parse: only replace constants that are standalone identifiers - py.mk: add support for building modussl_mbedtls - only store the exception instance on Py stack in bytecode try block - vm: use MP_OBJ_FROM_PTR to cast a type to an object - modmicropython: add micropython.const, alias for identity function - objstr: remove unreachable function used only for terse error msgs - emitbc: remove/refactor unreachable code, to improve coverage - objfun: remove unnecessary check for viper fun with 5 or more args - objfun: use if instead of switch to check return value of VM execute - objset: use mp_check_self() to check args of set/frozenset methods - objset: ensure that use of frozenset.update raises an exception - compile: fix async-for/async-with to work with simpler exc on stack - scope: use lookup-table to determine a scope's simple name - scope: shrink scope_t struct by 1 machine word - scope: factor common code to find locals and close over them - compile: fix typo when checking for parse-node kind - argcheck: simplify if-chain so that the last one is the default - objbool: defer bool's unary op implementation to small int - objbool: make a slight simplification of bool constructor - modstruct: remove unreachable code, and add comment about CPy diff - add mp_raise_OSError(errno) helper function - objstringio: add readinto() method - modmicropython: add micropython.opt_level([value]) function - compile: remove unreachable code - mpz: in divmod, replace check for rhs!=0 with assert - mpz: use assert to verify mpz does not have a fixed digit buffer - factor duplicated function to calculate size of formatted int - objint: use size_t for arguments that measure bytes/sizes - compile: remove debugging code for compiler dispatch - lexer: remove unnecessary code, and unreachable code - vstr: combine vstr_new_size with vstr_new since they are rarely used - objdict: fix optimisation for allocating result in fromkeys - objdict: actually provide the key that failed in KeyError exception - use mp_raise_msg helper function where appropriate - add the module specified by -m to sys.modules as '__main__' extmod: - modussl_mbedtls: initial implementation of mbedTLS ussl module - uctypes: allow full 32-bit address range - modubinascii: fix crc32() function on 32-bit platforms - modussl_mbedtls: implement key= and cert= args to wrap_socket() - modussl_mbedtls: use 2-component include paths - machine_i2c: add clock stretching support - modussl_mbedtls: add server_hostname param for wrap_socket() - uzlib: add tinfgzip.c (gzip header parsing) from upstream - moduzlib: DecompIO: Add support for gzip-formatted streams - uzlib/: update uzlib to v2.0.3 - vfs_fat: add fat_vfs_statvfs(), reused from stmhal - machine_i2c: add support for the addrsize parameter in mem xfers - machine_spi: simplify SPI xfer function to only take one buf len - machine_spi: factor out software SPI code from esp8266 to extmod - machine_spi: use delay_half, not baudrate, for internal timing - machine_spi: add optional support for fast software SPI - vfs_fat: use mp_raise_OSError helper function - modlwip: use mp_raise_OSError helper function - use mp_raise_OSError helper function - vfs_fat_file: use MP_Exxx errno constants - uzlib: update to upstream v2.1 - machine_i2c: use writes not reads in i2c.scan() - vfs_fat: add file and directory checks for remove and rmdir - modujson: implement ujson.load() to load JSON from a stream - modujson: fix nanbox build - utime_mphal: factor out implementations in terms of mp_hal_* for reuse - utime_mphal: sleep_us/ms(): Don't wait on negative argument - modussl_mbedtls: add dummy setblocking() method lib: - interrupt_char: factor out typical Ctrl+C handling from esp8266 port - cmsis: move CMSIS headers to lib/ - cmsis: remove CMSIS-DSP headers, they are unused - cmsis: upgrade CMSIS-CORE to V4.30 - utils/pyexec: don't treat SystemExit as "forced exit" - utils/pyexec: allow behaviour of SystemExit to be configurable drivers: - dht: use mp_raise_OSError helper function tools: - update upip to 0.8, fixes IPv6 support - upgrade upip to 1.0, fully self-hosted release (without fallbacks), and uses stream gzip decompression (step towards support for limited-heap baremetal systems) - upgrade upip to 1.1.3, initial support for running on a baremetal, low-heap systems (like esp8266), using Python module interface tests: - pyb: add test for ExtInt when doing swint while disabled - pyb: update exp file for previously updated extint test - extmod/urandom: add urandom tests for error cases - basics: add errno1 test, to check basics of uerrno module - extmod: add test for machine.time_pulse_us() - struct1: test "l" specifier to improve coverage - array1: add tests for "l", "L" array types to improve coverage - get cmdline verbose tests running again - run-tests: add --via-mpy option to run test from precompiled code - uzlib_decompio_gz: test for DecompIO with gzip bitstream - basics: add test case for overflowing Py stack in try-finally - micropython: add tests for const names being replaced in parser - cmdline/cmd_showbc: fix test now that 1 value is stored on stack - extmod/vfs_fat_ramdisk: add test for VFS.statvfs() - float: add test for parsing a float from an empty string - basics: add test for set.difference_update with arg being itself - basics: add further tests for nonlocal scoping and closures - import: add test for compiling "import a.b as c" - basics: add test constructing a set from a non-trivial expression - basics: add test for printing OSError when errno is unknown - run-tests: disable cmdline/cmd_showbc test on Windows - extmod/btree1: checks for put, seq, string print and unsupported binary op - fix expected output of verbose cmdline test - extmod/uzlib: test adaptive huffman tree for tinflate coverage - improve coverage of struct with test for non-compliant behaviour - io/write_ext: add description comment - io/bytesio_ext: add test for readinto() - micropython: add test for micropython.opt_level() function - improve test coverage of py/compile.c - extmod/vfs_fat: test coverage for remove() and rmdir() - extmod: add test for ujson.load() - extmod/vfs_fat: replace asserts with prints and expected outputs - micropython: add tests for heap_lock, and emergency exceptions - cmdline: improve coverage test for printing bytecode - improve coverage of array, range, dict, slice, exc, unicode - add test to print full KeyError exc from failed dict lookup - run-tests: enable extmod/machine1.py on pyboard unix port: - fix build for when MICROPY_PY_SOCKET=0 - modjni: implement subscription for object arrays - modjni: add array() top-level function to create Java array - modjni: array(): Support creation of object arrays - enable btree module for coverage build - use mp_raise_OSError helper function - use common RAISE_ERRNO macro from mphalport.h windows port: - enable MICROPY_PY_UERRNO qemu-arm port: - enable lots of extmods and enable tests for them stmhal port: - lcd: de-assert chip select after completing SPI transmission - {accel,lcd}: use GPIO_{set,clear}_pin - extint: force 0 to 1 transition on swint() - boards: add pllvalues.py script to compute PLL values for sysclk - boards: for OLIMEX_E407, enable UART1 and fix I2C1 mapping - use attribute to avoid inlining - put common definitions from linker files to common.ld - remove STM32CubeF2 HAL files, they are unused/unsupported - modmachine: fix clearing of reset-cause flags - add virtual com port support for STM32L476DISC - remove CMSIS STM32F2xx files, they are unused/unsupported - spi: simplify spi_transfer function to take only one buf len arg - mphalport: implement mp_hal_pin_{input,output,write} - spi: make machine.SPI class conform to correct API - mphalport: fix mp_hal_pin_write to use correct pin_mask - spi: use software SPI if no periph id given, even if pins given - spi: enable use of fast software SPI - fix linker map for STM32L476 chips - usbdev: add OUT endpoint to HID interface - usb: add support to receive USB HID messages from host - usb: use correct ClassData structure for HID receive - usb: use real packet size (not maximum) in HID receive - fix ESPRUINO_PICO by adding ld scripts with correct flash size - mphalport: change pin obj type to const pointer, to avoid casts - moduos: implement total-number-of-blocks field in statvfs - disable network and usocket for ESPRUINO_PICO - enable machine.time_pulse_us() function - use mp_raise_OSError helper function - pybstdio: use size_t instead of mp_uint_t - modutime: refactor to use extmod/utime_mphal.c - implement machine.soft_reset() - enable str.center(), str.[r]partition() and builtin compile() cc3200 port: - add ssl_version argument to ssl.wrap_socket() esp8266 port: - Makefile: rename SCRIPTDIR to FROZEN_DIR for consistency with FROZEN_MPY_DIR - ets_alt_task: ets_post: Should return 0 on success, !0 - failure - esp_mphal: add tentative change to mp_hal_stdin_rx_chr() to wait IRQ - extend system microsecond counter to 64-bits; use in ticks_ms - add uos.statvfs() to get filesystem status - moduos: move stat/statvfs funcs to sit within #if VFS guard - modmachine: idle(): Return number of CPU cycles spent idling - main: put /lib before / in sys.path - modpybrtc.c: implement machine.RTC.alarm_left() - make PY_UHASHLIB_SHA1 config depend on PY_USSL and SSL_AXTLS - add FLASH_MODE,FLASH_SIZE options for make deploy target - use mp_raise_OSError helper function - make neopixel support configurable - mpconfigport: enable MICROPY_PY_BUILTINS_SLICE_ATTRS - enable sys.{stdin,stdout,stderr}.buffer for raw serial access - enable importing of precompiled .mpy files - enable micropython.alloc_emergency_exception_buf() zephyr port: - initial Zephyr RTOS port, MicroPython part - initial Zephyr RTOS port, Zephyr part - add zephyr_getchar module to handle console input - switch to microkernel, required for network to work in background - automatically derive ARCH - support extra make targets - Makefile: automatically derive target-specific CFLAGS - use recently added "make outputexports" Zephyr target - add README - enable stack checking and micropython.mem_info() - enable frozen modules support - main: execute main.py frozen module on boot, if available - zephyr_getchar: add support for Ctrl+C handling - add Ctrl+C handling - implement the help() function - add copyright blurbs README: - remove issue-stats badges, the service is no longer available - mention _thread module availability in select ports docs: - library/pyb.SPI: init(): describe "bits" argument - library/machine: update description of disable/enable IRQ funcs - uos: add uos.statvfs() documentation - wipy: correct deep sleep current figure - wipy: small doc fixes - reference: add constrained.rst doc travis: - abandon mingw32 in favour of mingw-w64 - run feature and coverage test for precompiled mpy files examples: - network/http_client*: use \r\n line-endings in request ======== Fri, 9 Sep 2016 14:07:09 +1000 v1.8.4 Support for stream decompression in uzlib, and more ESP8266 features This release includes some bug fixes, code clean-up, updates to the docs, more tests, and various feature additions. The uzlib module now supports efficient stream decompression in the form of the uzlib.DecompIO class. Freezing of bytecode now supports floats for the ESP8266 port, as well as complex numbers for all ports. The stmhal port has ADC working on L4 microcontrollers, fixed initialisation for DAC, and addition of the machine.WDT class and machine.reset_cause function. For the ESP8266 port Pin(16) now works as an input pin and the hardware SPI peripheral is exposed as machine.SPI(1). The os.umount function is implemented and the port supports mounting of externally connected SD cards. The machine.WDT class is added, wlan.scan() is fixed to return all access points, and there is support for DS18S20 devices. py core: - runtime: factor out exception raising helpers - runtime: define mp_check_self(pred) helper macro - objdict: get rid of asserts (remove/replace with mp_check_self()) - get rid of assert() in method argument checking functions - objtuple: in tuple_cmp_helper, use mp_check_self instead of raising - objstr: use mp_raise_{Type,Value}Error instead of mp_raise_msg - obj.h: for obj reprs A,B,C use void* explicitly for mp_obj_t typedef - mpconfigport.h: remove typedef of machine_ptr_t, it's no longer needed - sequence: allow to use bignums as indices in slice objects - stream.c: use mp_obj_get_type in mp_get_stream_raise - gc: add MICROPY_GC_CONSERVATIVE_CLEAR option to always zero memory - compile: don't compile assert statements when optimisations enabled - modstruct: use more compact mp_raise_ValueError function - emitglue: use more compact mp_raise_ValueError function - rename struct mp_code_state to mp_code_state_t - mkrules.mk: allow to override name of libmicropython.a - mpprint: fail an assertion with unsupported format specifiers - makeqstrdata.py: compute the qstr hash from bytes, not characters - if str/bytes hash is 0 then explicitly compute it - emitglue.c: provide mp_raw_code_load_file for any unix architecture - add MICROPY_USE_INTERNAL_PRINTF option, defaults to enabled extmod: - modwebrepl: set_password(): raise exception for too long password - uzlib/: update uzlib to v2.0: new API supporting stream decompression - moduzlib: refactor to new stream-compatible uzlib 2.0 API - uzlib/: update uzlib to v2.0.1: fixes for pedantic compiler warnings - uzlib/: update uzlib to v2.0.2: consistently use stdint types - modbtree: do CHECK_ERROR after __bt_seq() - modubinascii: implement binascii.crc32 - modubinascii: make crc32() support configurable - modframebuf: fix pixel accessor to return a 1-bit result - add machine_spi with generic SPI C-protocol and helper methods - modframebuf: fix fill and scroll when height not divisible by 8 - moduzlib: implement zlib stream decompressor class, DecompIO - moduzlib: use mperrno.h for error constants - modframebuf: include font from stmhal directory explicitly - moduzlib: support wbits arg to DecompIO - framebuf: add the xstep!=0 case to scroll() method lib: - utils/stdout_helpers: fix function signature to match py/mphal.h - berkeley-db-1.xx: update to upstream, fixes MacOSX build - utils/pyexec: qstr_pool_info() requires size_t* parameters drivers: - sdcard: port the SDCard driver to new machine API, with backwards compatibility for pyboard tools: - mpy-tool.py: support freezing float literals with obj-repr C - mpy-tool.py: store qstr config values in global config object - mpy-tool.py: compute the hash value for str/bytes objects - mpy-tool.py: support freezing of complex numbers tests: - rename zlibd_decompress.py -> uzlib_decompress.py - basics: add more tuple tests to improve coverage testing - basics: add more list tests to improve coverage testing - misc/non_compliant: add tests to improve coverage testing - basics: add test for break from within try within a for-loop - basics: add a test file for overriding special methods - basics/special_methods: enable tests for extra special methods - uzlib_decompress: actually test raw DEFLATE stream - run-tests: disable thread/thread_lock4.py on Travis - run-tests: disable thread/stress_heap.py when running on Travis - cmdline: add test for -O option to check optimisation value - extmod/vfs_fat_ramdisk: add tests for VFS.umount() - run-tests: disable thread_gc1.py test on Travis - unix/extra_coverage: add test for str/bytes with invalid hash - extmod: add test for uzlib.DecompIO - extmod: add a test for framebuf module, tested by coverage build - extmod/uzlib_decompio: add zlib bitstream testcases - extmod/framebuf1: add tests for scrolling in the x-direction - run-tests: disable thread/stress_recurse.py test on Travis unix port: - mpconfigport.h: don't include stdio.h on MacOS - when find'ing frozen files don't use extra slash, do follow symlinks qemu-arm port: - enable MICROPY_PY_ALL_SPECIAL_METHODS stmhal port: - boards: update STM32L476 pin defs to include ADC channels - adc.c: get ADC working on STM32L4 MCUs - fix timer capture/compare interrupt handling for TIM1 and TIM8 - remove obsolete code for special handling of TIM3 irq settings - make ADC channel 16 available on L4 MCUs - update pin print to print new constants - modusocket: set self->nic to MP_OBJ_NULL after socket close - update boot.py files to use VCP instead of CDC - spi: factor out SPI transfer code to a single function - spi: support new machine SPI methods in legacy SPI object - add machine.WDT class - set STM32F7DISC CPU Frequency to 216 MHz - dac: fix DAC (re-)initialisation by resetting DMA - wdt: implement keyword args to WDT constructor - modmachine: implement machine.reset_cause() function, and consts - machine.POWER_ON is renamed to machine.PWRON_RESET - when find'ing frozen files don't use extra slash, do follow symlinks cc3200 port: - add machine.PWRON_RESET constant (machine.POWER_ON is now deprecated) teensy port: - fix execution of frozen boot.py and main.py esp8266 port: - fix reading of pin object for GPIO16; Pin(16) now works as an input - PULL_UP is not supported on Pin(16), so raise an exception in this case - enable support for all special methods - modpybhspi: add a HSPI module for hardware SPI support - modmachinespi: add a factory method for SoftSPI/HSPI - esp_mphal: no longer disable watchdog on startup - modpybrtc: use 64-bit arithmetic when computing alarm expiry - hspi: enable duplex operation of hardware SPI - modous: add os.umount method to unmount a filesystem - modmachinewdt: implement machine.WDT class - modules: split onewire.py into OneWire and DS18X20 driver - modules/onewire: change onewire.read() to onewire.readinto() - modules/ds18x20.py: add support for DS18S20 devices - modpybspi: use generic SPI helper methods to implement SPI - modpybhspi: simplify HSPI driver by using 1 function for xfers - modmachinewdt: add .deinit() method - modmachine: add WDT_RESET and SOFT_RESET constants - modmachine: don't expose internal SoftSPI and HSPI classes - modmachine: simplify SPI class implementation multiplexing - espneopixel: disable IRQs during eps.neopixel_write - modnetwork: fix wlan.scan() method so it returns all networks - modmachine: map PWR_ON_RESET to vendor's REASON_DEFAULT_RST - machine.PWR_ON_RESET is renamed to machine.PWRON_RESET - when find'ing frozen files don't use extra slash, do follow symlinks docs: - esp8266/tutorial/pins: fix typo in commands for pin input mode - esp8266/intro: add command to install esptool.py 1.0.1 via pip - library/machine.WDT: add note that WDT is only available on WiPy - esp8266/quickref: fix and update the SPI docs - esp8266: update quickref and tutorial for OneWire/DS18X20 driver - pyboard: update USB mouse tutorial to use VCP instead of CDC - pyboard: update USB mouse tutorial to use pyb.USB_HID() - library: add reference for pyb.usb_mode and pyb.USB_HID - pyboard/quickref: add links to pinouts for other pyboard variants - pyboard/quickref: add section on "delay and timing" for utime mod - esp8266/quickref: add internal links to docs for some modules - esp8266/quickref: update information on SPI classes - esp8266/quickref: further improvements for SPI subsections - library/machine.WDT: add that WDT is available on pyboard - reference/isr_rules.rst: two minor additions to docs for using ISR misc: - add *.pyc to .gitignore, because Python 2 doesn't use __pycache__ - build mpy-cross as part of the Travis process ======== Tue, 9 Aug 2016 23:49:25 +1000 v1.8.3 Many small improvements and additions, with btree support in ESP8266 port This release brings various improvements and additions to the core, extended modules and the ESP8266 port, as well as enhancements to the docs. There is now a "threshold" function in the gc module for the user to configure the garbage collector to run earlier than usual, in order to help reduce fragmentation of the heap. The btree module is now available in the ESP8266 port, and there is improved WebREPL file transfer: get file is now non-blocking (this change requires an update of the client software). py core: - nlrx64.S: prefix mp_thread_get_state with an underscore on Mac - stream: implement 2- and 3-arg write() method as an extension to CPython - gc: implement GC running by allocation threshold, user configurable - fix nlrthumb.c when DEBUG=1 is defined - obj: issue a warning when str and bytes objects are compared - mpconfig.h: fix description for MICROPY_PY_STR_BYTES_CMP_WARN - objstrunicode: str_index_to_ptr: should handle bytes too - objstrunicode: str_index_to_ptr: implement positive indexing properly - stream: implement generic flush() method, in terms of C-level ioctl - objstringio: add MP_STREAM_FLUSH ioctl and flush() method - objstringio: implement MP_STREAM_SEEK ioctl and add seek() method - stream: add adapter methods with POSIX-compatible signatures - mpconfig.h: add MICROPY_STREAMS_POSIX_API setting - py.mk: extra switches to build "embedded" BerkeleyDB BTree lib - mkrules.mk: allow to add more items for "clean" target using CLEAN_EXTRA - objstr: make .partition()/.rpartition() methods configurable - mpconfig.h: define MP_ALWAYSINLINE for reuse extmod: - modussl: rename to modussl_axtls.c, to allow impl using other SSL libs - modussl_axtls: further changes to allow alternative SSL modules - modussl_axtls: add dummy setblocking() method - vfs_fat: implement rmdir() method (aliases to unlink) - modussl_axtls: use mp_stream_close() method - modwebrepl: use mp_stream_close() method - modbtree: check __bt_open() return value for error - modbtree: switch to accepting stream object instead of filename - modbtree: implement __contains__ operation - modwebrepl: factor out "GET" iteration to write_file_chunk() - modwebrepl: make GET_FILE operation non-blocking - modbtree: open(): add option kwargs - modwebsocket: add readline method - modwebsocket: make compatible with non-default object models - modwebsocket: use mp_rom_map_elem_t and friends - modwebrepl: add GET_VER operation to query MicroPython version lib: - axtls: upgrade to axTLS 1.5.4 + MicroPython patchset - axtls: update, fixes esp8266 build - utils/stdout_helpers: move from minimal/uart_extra.c for reuse - embed/abort_: implementation of abort_() function raising uPy exception - berkeley-db-1.xx: switch to "embedded" branch - berkeley-db-1.xx: update, sets default page size to 4096 tests: - add test for extended arguments to stream .write() method - extmod/machine_pinbase: skip if machine.PinBase is not available - bytes_compare: rework test for bytes <-> str comparison - extmod/btree1: close database at the end of test - unicode_subscr.py: detailed test for subscripting unicode strings - run-tests: make "regex'ed .exp" facility available to device tests - io/bytesio_ext: test for .seek()/.flush() on BytesIO - extmod/btree1: tests against in-memory DB (using io.BytesIO) - machine_mem.py: too non-portable, rework as an example for unix port - machine1: revamp to work with unix port (which has "umachine") - basics: bytes/str.partition/rpartition are now optional mpy-cross: - fix Makefile to handle gc-sections linker flags on OS X - use binary file translation mode for creating mpy files on windows - fix mingw and msys2 compilation minimal port: - disable MICROPY_GC_ALLOC_THRESHOLD unix port: - mpthreadport: adjust minimum thread stack, and stack limit check - cache libaxtls.a in local build dir - disable MICROPY_GC_ALLOC_THRESHOLD for minimal build - enable MICROPY_PY_STR_BYTES_CMP_WARN - mpconfigport.h: include stdio.h by default - file: implement MP_STREAM_FLUSH ioctl - file: ioctl(): check that file is open before operations - file: fdfile_ioctl(): fix argument to check_fd_is_open() - file: use generic stream flush() method - enable websocket module - moduselect: allow poll.register(), etc. accept fd-like objects stmhal port: - fix malloc when used with external libraries - make SPI NSS pin definition optional - fix I2C mappings for STM32F429DISC board esp8266 port: - select axTLS for SSL implementation, following recent refactor - moduos: add rmdir() function - cache Xtensa-built libaxtls.a in local build dir - enable MICROPY_PY_STR_BYTES_CMP_WARN - dupterm_task_init() should be called before running _boot.py, etc - _boot.py: set GC alloc threshold to half of heap size - _boot.py: decrease GC alloc threshold to quarter of heap size - modpybuart: fix UART parity setting - axtls_helpers: remove abort_(), now in lib/embed/ - mpconfigport.h: include sys/types.h for POSIX types definitions - esp_mphal: implement libc's errno - enable btree module - eagle.rom.addr.v6.ld: add Enable_QMode symbol from SDK 2.0.0 - make APA102 driver inclusion configurable - makeimg.py: store firmware size as last 4 bytes of padding area - makeimg.py: append md5 hash to the generated binary - modesp: add check_fw() function to check integrity of the firmware - scripts/port_diag.py: include esp.check_fw() call - flashbdev: reserve extra sysparam sector for SDK 2.0.0 compatibility - scripts/inisetup: add commented-out call to esp.osdebug(None) - modmachine: implement idle() function - esp_mphal.h: add mp_hal_ticks_cpu() for reuse - modutime: actually implement ticks_cpu() - modmachine: implement dummy sleep() function - tutorial/intro: reword para abou -fm dio switch - modules/flashbdev: start filesystem at 0x90000 - esp8266.ld: increase firmware image size to 0x90000 (576K) docs: - add DHT to ESP8266 Quick Ref and Tutorial - fix some spelling mistakes - array: document array module - library/index: include array module in ToC - esp8266/intro: rename to "Getting started" from "Introduction" - esp8266/intro: add troubleshooting section - esp8266/quickref: link to installation instructions - esp8266/tutorial/intro: add anchor for link from quickeref - esp8266/intro: focus on hazards of unearthed power wrt electronics - uio: mention seek()/flush() support for io.BytesIO misc: - logo/1bit-logo A black & white version of the logo examples: - http_server*: update for buffered-like streams (read line by line) - embedding: example for embedding MicroPython in an app - embedding: add README - http_client*: be sure to close socket - network: split recv- and read-based HTTP servers qemu-arm: - enable gcc LTO option for nlrthumb.c ======== Sun, 10 Jul 2016 12:46:50 +0100 v1.8.2 Thread support, ESP8266 memory improvements, btree module, improved docs This release brings multi-threading support in the form of the _thread module, which closely matches the semantics of the corresponding CPython module. There is support for GIL and non-GIL builds; without the GIL enabled one must protect concurrent access to mutable Python state at the Python level using Lock objects. Threading with the GIL is enabled in the cc3200 port on the WiPy. Threading without the GIL is enabled on the unix port. The ESP8266 port has support for frozen bytecode (for scripts in the modules/ subdirectory), as well as optimisations for reduced memory usage and decreased memory fragmentation. The ESP8266 RTC also resumes correctly after a deepsleep. An initial "btree" module has been implemented for database support (unix port only), and the documentation has been further improved, with pre-built PDF versions of the docs now available. py core: - parse: treat constants that start with underscore as private - objdict: implemented OrderedDict equality check - support to build berkeley db 1.85 and "btree" module - mpconfig.h: MP_NOINLINE is universally useful, move from unix port - makeqstrdefs.py: remove restriction that source path can't be absolute - mkrules.mk: define "lib" outside conditional block - rename __QSTR_EXTRACT flag to NO_QSTR - objtype: instance: inherit protocol vtable from a base class - mphal.h: if virtpin API is used, automagically include its header - objtype: inherit protocol vtable from base class only if it exists - add MP_STATE_THREAD to hold state specific to a given thread - add basic _thread module, with ability to start a new thread - modthread: properly cast concrete exception pointer to an object - modthread: add stack_size() function - modthread: add exit() function - modthread: implement lock object, for creating a mutex - modthread: add with-context capabilities to lock object - gc: make memory manager and garbage collector thread safe - modthread: satisfy unused-args warning - gc: fix 2 cases of concurrent access to ATB and FTB - modthread: be more careful with root pointers when creating a thread - modthread: call mp_thread_start/mp_thread_finish around threads - gc: fix GC+thread bug where ptr gets lost because it's not computed - make interning of qstrs thread safe - implement a simple global interpreter lock (GIL) - don't use gc or qstr mutex when the GIL is enabled, there is no need - modthread: make Lock objects work when GIL is enabled - mpthread.h: move GIL macros outside MICROPY_PY_THREAD block - modthread: allow to properly set the stack limit of a thread - nlrthumb: convert NLR thumb funcs from asm to C with inline-asm - nlrsetjmp: update to take into account new location of nlr_top - mpthread: include mpstate.h when defining GIL macros - gc: be sure to count last allocated block at heap end in stats - gc: calculate (and report) maximum contiguous free block size - builtinimport: disable "imported as namespace package" warning - mpconfig.h: mention MICROPY_PY_BTREE config option - objarray: split out header to allow direct access to object - rename mp_obj_type_t::stream_p to "protocol" extmod: - modbtree: initial implementation of "btree" module based on BerkeleyDB - modbtree: handle default value and error check - modbtree: implement .items() iterator - modbtree: actually implement end key support for .items() - modbtree: items(): Implement "end key inclusive" flag - modbtree: items(): Implement DESC flag - modbtree: __getitem__() should raise KeyError for non-existing key - modbtree: open(): Support "in-memory" database with filename=None - machine_pinbase: implementation of PinBase class - machine_pinbase: fix nanbox build - modlwip: store a chain of incoming pbufs, instead of only one - modbtree: implement keys(), values(), items() iterators - modbtree: cleverly implement "for key in btree:" syntax - modwebsocket: add readinto() method - modwebrepl: add readinto() method - modbtree: fix unused argument warning - modbtree: fixes for nanbox build - moduos_dupterm: reserve buffer bytearray object for dupterm - moduos_dupterm: reuse dupterm_arr_obj for write operations lib: - berkeley-db-1.xx: add Berkeley DB 1.85 as a submodule - berkeley-db-1.xx: update to upstream which builds for uPy - fatfs/option/ccsbcs: follow uPy optional features model - libm: format code to pass gcc v6.1.1 warning - libm: remove unused definition of "one" drivers: - display/ssd1306: add width arg and support 64px wide displays tests: - recursive_iternext: clang/Linux is even more stack-frugal than MacOS - bench: add testcase to compare bytes(N) vs b"\0" * N - add testcase for OrderedDict equality - add a testcase for machine.PinBase class - extmod: add "btree" module test - btree1: add testcase for iterating btree object directly - add tests for _thread module - add 3 more tests for _thread module - thread: remove need to sleep to wait for completion in some tests - thread: add tests for running GC within a thread, and heap stress - thread: rename thread_stress_XXX.py to stress_XXX.py - thread: add tests that mutate shared objects - thread: add test for concurrent interning of strings - thread: add test for concurrent mutating of user instance - thread: make stack-size test run correctly and reliable on uPy - thread: make sure that thread tests don't rely on floating point - thread: allow thread_sleep1 to run without floating point - thread: allow some tests to run on ports with not much heap - meminfo: update for addition of "max free sz" output - run-tests: If running thread tests on unix, don't run mutate ones unix port: - unbreak "minimal" target by disabling FatFs - mpconfigport_minimal.h: clearly mark where user-define config ends - deprecate support for GNU Readline (MICROPY_USE_READLINE=2) - time to build with --gc-sections - move "utime" module config to C level instead of make level - Makefile: libffi: Build with -Os - alloc: add option to use uPy's alloc-exec implementation even for libffi - alloc: make coverage build and its overzealous warnings happy - disable FatFs VFS for normal build, keep enabled for coverage - modmachine: include PinBase class - modmachine: enable time_pulse_us() function - fix Makefile to handle gc-sections linker flags on Mac OS - add basic thread support using pthreads - file: if write syscall returns because of EINTR then try again - implement garbage collection with threading - mpthreadport: use SA_SIGINFO for GC signal handler - gccollect: provide declaration of exported function - mpthreadport: suppress compiler warning about unused arguments - modtime: release the GIL when sleeping - enable btree module - Makefile: make "minimal" build be minimal again - mpconfigport_minimal.h: allow to print a string within 1KB of heap - main: error out on unknown value of suffix in -X heapsize= option - main: improve help for -X options a bit - main: when preparing sys.path, allocate exact strings on uPy heap - disable the GIL to improve performance of non-thread code windows port: - follow unix port changes regarding "utime" module - msvc: include machine_pinbase.c in build and enable umachine module stmhal port: - add board definition files for Olimex STM32-E407 - port of f4 hal commit 1d7fb82 to l4 hal (SD card modifications) - correct DMA to allow SD card on L4 MCUs - enable SD card on L4 MCUs cc3200 port: - update FreeRTOS to v9.0.0 - define our own FreeRTOS heap so it can go in a special segment - add basic threading capabilities - fix call to new exception to be _msg instead of _arg1 - use xTaskCreateStatic instead of osi_TaskCreate - mpthreadport: make mutex statically allocated - mpthreadport: properly initialise the main thread's data - gccollect: use MP_STATE_THREAD(stack_top) to get top of stack - mpthreadport: scan more root pointers from thread data - mpthreadport: move mem alloc outside the thread_mutex lock - enable the GIL - in FreeRTOSConfig.h, comment on configSUPPORT_STATIC_ALLOCATION - remove .boot section attribute from osi_TaskCreate function - start the simplelink spawn task using the static task creator - shrink the FreeRTOS heap and place TCB+stack in freed location - allow to compile bootloader with threading enabled - remove obsolete singleton heart-beat object teensy port: - update the README with OSX specific information and tips esp8266 port: - modnetwork: use struct bss_info::ssid_len for ESSID length - let RTC work correctly after deepsleep - switch floating-point arith routines to BootROM - Makefile: enable --verify option for esptool.py write_flash - use RTC to set date & time stamps for files - main.c: clear the command line history when (re)booting - enable frozen bytecode, with scripts in modules/ subdir - README: describe how to build mpy-cross - websocket_helper.py: avoid extra string allocations - websocket_helper.py: fix typo in debug output - modpybuart: allow setting baudrate and other params - explicitly collect garbage in bootstrap scripts - switch webrepl_setup to use frozen bytecode - switch webrepl to use frozen bytecode - README: promote from "highly experimental" to "experimental" - main: init recently added dupterm_arr_obj port state var - esp_mphal: call_dupterm_read: Use readinto() method - esp_mphal: properly handle dupterm EOF after switching to readinto() qemu-arm port: - disable gcc LTO option for nlrthumb.c docs: - esp8266/tutorial/network_basics: minor typo fix, ap becomes ap_if - add link to PDF version of docs in sidebar - library/network: wipy: fix literal block indentation - esp.socket: remove unused file - ure: typo fix - usocket: there must be empty line after .only:: - library/machine.Pin: mention GPIO and cross-link .value() function - machine.*: add "currentmodule:: machine" directive - pyb.*: add "currentmodule:: pyb" directive - machine.Pin: remove explicit target - machine.UART: cleanup pyboard section - machine.*: use proper class case in method headers - machine.Pin: add class designator to all constants - pyb.CAN: mark CAN.initfilterbanks() as classmethod explicitly - pyb.Pin: af_list() is a normal method, not a class method - pyb.ExtInt,pyb.Pin: mark up class methods as such - pyb.*: use proper class case in method headers - pyb.Pin: sort .af() and .af_list() methods together - builtins: enumerate all builtin functions implemented - library/index: add builtins.rst - machine.Pin: disambiguate object call method - machine*: remove explicit targets and "machine." prefixes on classes - uctypes: improve documentation - sys: detailed description of print_exception() diff from traceback module - add sphinx_selective_exclude extension suite - conf.py: active sphinx_selective_exclude extensions - rebuild docs from scratch, as required for proper only:: handling - select: add an article - sys: print_exception: Fixes/clarifications - conf.py: exclude cmath from modindex for wipy - library: fix typo in docs for usocket.listen() examples: - unix/ffi_example.py: update for current "ffi" module API - unix/ffi_example.py: remove TODO, make output more clear ======== Fri, 3 Jun 2016 15:45:43 +0100 v1.8.1 Many ESP8266 improvements, enhanced WebREPL, and support for STM32L4 MCUs This release brings general improvements and bug fixes, and some new features. There is now a uerror module for consistent errno handling across ports, as well as textual names of OS errors that are printed when an OSError is raised. There is support for frozen packages, via both frozen scripts and frozen bytecode. WebREPL on the ESP8266 is greatly improved with many bug fixes and now supports an unlimited (or very large) number of reconnects. The os module on the ESP8266 now has rename, chdir, getcwd and stat. The unix port now includes the ussl module by default. The stmhal port has support for STM32L4 MCUs including the STM32L476 Discovery board and the LimiFrog board. README: - add explicit note that subdirs contain more READMEs - add "make deplibs" to quick build section - "quick build": Use "make axtls" after all CODECONVENTIONS.md: - describe git commit messages conventions py core: - obj: add warning note about get_array return value and GC blocks - objstr: binary type of str/bytes for buffer protocol is 'B' - runtime: properly handle passing user mappings to ** keyword args - repl: if there're no better alternatives, try to complete "import" - mpz: fix bug with overflowing C-shift in division routine - mpz: do Python style division/modulo within bignum divmod routine - mpz: fix mpn_div so that it doesn't modify memory of denominator - vstr: vstr_null_terminated_str(): Extend string by at most one byte - vstr: change allocation policy, +16 to requested size, instead of *2 - add mperrno.h file with uPy defined errno constants - add uerrno module, with errno constants and dict - parse: add uerrno to list of modules to look for constants in - mperrno: add EAFNOSUPPORT definition - repl: fix handling of backslash in quotes when checking continuation - gc: gc_dump_alloc_table(): Show byte/str and (byte)array objects - gc: make (byte)array type dumping conditional on these types being enabled - gc: use '=' char for tail blocks when dumping heap - mperrno: add some more MP_Exxx constants, related to networking - moduerrno: add more constants to the errno module - add mp_errno_to_str() and use it to provide nicer OSError msgs - objfloat, py/modmath: ensure M_PI and M_E defined - emitglue: fix build on AArch64 (ARMv8, etc.) related to loading .mpy files - objexcept: don't convert errno to str in constructor, do it in print - moduerrno: add EACCES, pretty common error on Unix - gc: gc_dump_alloc_table(): dump heap offset instead of actual address - objstr: make dedicated splitlines function, supporting diff newlines - objstringio: add TODO comment about avoiding copying on .getvalue() - modstruct: raise ValueError on unsupported format char - stream: support both "exact size" and "one underlying call" operations - declare constant data as properly constant - stream: add mp_stream_close() helper function - mphal.h: provide default prototypes for mp_hal_delay_us/mp_hal_ticks_us - rework frozen modules support to support packages - objstr: implement str.center() - allow to stat and import frozen mpy files using new frozen "VFS" - makeqstrdata.py: allow to have double-quote characters in qstrs - objnamedtuple: allow passing field names as a tuple - moduerrno: add EEXIST, EISDIR, ECONNREFUSED - modstruct: allow to have "0s" in struct format extmod: - modlwip: convert errno's to use MP_Exxx symbols - modlwip: rework how Python accept callback is called - when including extmod headers, prefix path with extmod/ - modwebsocket: add close() method - modwebrepl: add close() method - moduos_dupterm: dumpterm subsystem is responsible for closing stream - modussl: make more compatible with non-default obj representations - machine_i2c: redo mp_hal_pin macros to use open_drain and od_low - virtpin: initial implementation of open-ended C-level Pin interface - vfs_fat: replace text error messages by POSIX error numbers - vfs_fat: add chdir() method - vfs_fat: add getcwd() method - vfs_fat: add vfs.stat() method - add machine time_pulse_us function (at C and Python level) - machine: add MICROPY_PY_MACHINE_PULSE config for time_pulse_us lib: - timeutils/timeutils: timeutils_mktime may accept negative time values drivers: - cc3000: rename timeval to cc3000_timeval, to avoid clash - add C-level function to read DHT11 and DHT22 devices - display/ssd1306: update SSD1306_SPI to work with new API tools: - make-frozen.py: properly escape hex chars when making C strings - make-frozen.py: quick fix to support package-modules - mpy-tool.py: add checks for critical configuration vars - make-frozen.py: update for latest changes in frozen modules support - mpy-tool.py: include .py extension in frozen filename - mpy-tool.py: don't strip directories from the frozen source name - upgrade upip to 0.7: SSL cert warning, use uerrno, better usage message tests: - run-tests: factor out list of supported external boards - disable memoryview tests that overflow int conversion - basics/string_splitlines: reinstate feature test for splitlines - struct1: add testcase for an unknown type char - add testcase for str.center() - extmod/vfs_fat_ramdisk: add testcases for chdir(), getcwd() - misc/recursive_iternext.py: increase depth N from 1000 to 2000 - misc/recursive_iternext.py: provide more fine-grained selection of N - pyb/rtc: make RTC test on pyboard more reliable by calling init() mpy-cross: - add -s option to specify the embedded source filename unix port: - mphalport: add mp_hal_delay_us() for consistency with other ports - enable uerrno module - add ability to include frozen bytecode in the build - mpconfigport_coverage.h: add dedicated config file for coverage build - unix_mphal: implement mp_hal_ticks_us() - support frozen packages - Makefile: nanbox build is not compatible with modussl, disable - enable "ussl" module - mpconfigport.mk: document MICROPY_STANDALONE make-level option - Makefile: "make axtls": automatically fetch submodules if missing windows port: - enable multi-processor compilation for msvc stmhal port: - l4: adapt DMA to be able to support STM32L4 MCU series - l4: adapt startup code, clock configuration and interrupts - l4: make CCM/DTCM RAM start-up conditional on MCU type - l4: add support for machine.sleep on STM32L4 MCUs - dma: make DAC DMA descriptors conditional on having a DAC - add board files for LIMIFROG board - for LIMIFROG board, add early-init function to get to DFU mode - dma: fix builds for boards with an F4 or F7 but no DAC - sdcard: fix initialisation of DMA TX so that writes work - can: allow to get existing CAN obj if constructed without args - fix clock configuration for STM32L476-discovery; also add I2C2 - convert to use internal errno symbols; enable uerrno module - for network drivers, convert to use MP_Exxx errno symbols - led: allow LEDs to be in PWM mode with TIM1 and channels 1-4 - i2c: expose I2CHandle3 for use by custom C code - sdcard: allow to do unaligned read-from/write-to SD card - support frozen packages using .mpy files - moduos: getcwd(): use mp_obj_new_exception_arg1() - dac: add DAC deinit() method - uart: fix wrong baudrate calculation for stm32l4 series esp8266 port: - scripts/: remove use of pin.PULL_NONE - scripts/inisetup: don't start WebREPL on boot in master branch - scripts/: add fill() to NeoPixel - scripts/webrepl: add optional password argument to webrepl.start() - scripts/webrepl: add start_foreground() method - main: bump heap size to 28K - mpconfigport: reduce various parser-related allocation params - help: add "sta_if.active(True)" command - convert to use new MP_Exxx errno symbols - enable uerrno module, weak linked also as errno - change to use internal errno's - moduos.c: addition of the rename method to module uos - scripts/port_diag: add network diagnostic output - scripts/webrepl_setup: show password placeholder char - scripts/webrepl_setup: add max password length check - README: add a very first start section - add APA102 serial individually controllable LEDs support - enable collections.OrderedDict - main: update _boot module loading for recent frozen modules refactors - scripts/port_diag: dump network interface IP settings - esp_mphal: fix NLR buffer leak in call_dupterm_read() - esp_mphal: handle Ctrl+C from dupterm (e.g. WebREPL) - esp_mphal: mp_uos_dupterm_deactivate() may raise exception - add mp_hal_pin_input() and mp_hal_pin_output() functions - modpybspi: configure pins when initialising an SPI object - xtirq: add xtirq.h for controlling xtensa irqs - ets_alt_task: don't run ets_loop_iter if irqs are disabled - modmachine: add disable_irq and enable_irq functions - enable DHT C-level driver - add dht.py script for high-level control of DHT11/DHT22 sensor - Makefile: document "disable" value for UART_OS - modnetwork: scan() is only supported by STA when it's enabled - modnetwork: protect scan() callback against memory errors - modnetwork: allow to press ctrl-C while scan() is running - uart: properly initialise UART0 RXD pin in uart_config - moduos: add chdir() and getcwd() functions - scripts/ntptime: allow to override NTP server - modmachine: add machine.time_pulse_us function - enable MICROPY_PY_IO_FILEIO to get compliant text/binary streams - moduos.c: add stat() to the module uos of esp8266 - rtc: set RTC user memory length to 0 on first boot - provide a dedicated variable to disable ets_loop_iter - modpybrtc: handle RTC overflow docs: - machine.UART: filter out unimplemented UART methods from esp8266 docs - esp8266/quickref: new way to get MAC address - esp8266/quickstart: remove i2c examples with stop=False - ustruct: describe supported type codes - ussl: add basic description of axTLS-based modussl - esp8266: Include ussl module in the docs - machine: make disable_irq and enable_irq docs available for all - library/machine: add documentation for machine.time_pulse_us - math, cmath: add port availability information - library/index: add intro paragraph regarding availability of modules - README: add some hints for PDF docs generation - wipy/tutorial: add note about screen key bindings on OS X - esp8266/quickref: update WebREPL section for 1.8.1 release - esp8266: fix ESP8266 Network tutorial - esp8266/quickref: use local image of Adafruit Huzzah board - esp8266/general: add note about RTC overflow travis: - install gcc-arm-none-eabi with --force-yes for now ======== Tue, 3 May 2016 17:32:32 +0100 v1.8 First general release of ESP8266 port, and support for frozen bytecode This release marks the first general release of official ESP8266 support within the MicroPython code base. The ESP8266 port has many improvements and additions, including: websocket and webrepl modules, deep-sleep mode, reading on UART, enhanced I2C support, enhanced network configuration, full sequence of start-up scripts (built-in _boot.py, boot.py and main.py), improved filesystem support with automatic flash-size detection as well as documentation and a tutorial. Known issues with ESP8266 port are: - Basic SSL support is available but it works only with relatively short data lengths (a few kilobytes). - WebREPL over SSL is not supported. - Only 5 or so WebREPL sessions in succession can be started (including file transfer sessions), after that the board requires a hard reset. - File transfer over WebREPL has issues with large files (above a few tens of kilobytes). - By design, only one concurrent WebREPL connection is supported. - Soft reset doesn't reset the network stack. In addition to ESP8266 support, this release brings frozen bytecode which allows to compile bytecode offline and link it into the firmware, completely eliminating the need for compilation (and the associated RAM usage) at runtime. Basic async/await syntax is now supported, and qstrs are now auto-generated in the build system. A detailed list of changes is given below. README: - explicitly point to required dependencies section - promote "docs" and "tests" to "major components" - mention support "async" keyword from Python 3.5 ACKNOWLEDGEMENTS: - add list of 842 backers from the ESP8266 campaign py core: - modbuiltins: add comment about setting "_" special var - add async/await/async for/async with syntax - fix constant folding and inline-asm to work with new async grammar - emitglue: move typedef of mp_raw_code_t from .c to .h file - emitglue: make mp_raw_code_t* arguments constant pointers - makeqstrdata: factor out some code to functions that can be reused - add ability to have frozen persistent bytecode from .mpy files - makeqstrdata: add more names for escaped chars and esc non-printable - simplify "and" action within parser by making ident-rules explicit - makeqstrdata: fix rendering of qstrs that have non-printable ASCII - makeqstrdata: add special case to handle \n qstr - declare help, input, open builtins in core - map: change hash-table allocation policy to be less aggressive - makeqstrdefs: add script to automate extraction of qstr from sources - frozenmod: pass the source name of the frozen module to the lexer - rework QSTR extraction to work in simple and obvious way - divide "split" and "cat" phases of qstr extraction for better efficiency - fix bug passing a string as a keyword arg in a dict - move call_function_*_protected() functions to py/ for reuse - makeqstrdefs.py: windows compatibility - obj.h: when constructing a small-int cast to mp_uint_t for bit-shift - emitnative: use MP_OBJ_NEW_SMALL_INT instead of manual bit shifting - vm: "yield from" didn't handle MP_OBJ_STOP_ITERATION optimization - modio: rename module name to "uio" for consistency with other modules - modcollections: rename module name have "u" prefix for consistency extmod: - add initial framebuf module - add generic machine.I2C class, with bit-bang I2C - machine_i2c: fix I2C reading by sending ack/nack at end of byte - machine_i2c: implement I2C memory reading/writing - moduos_dupterm: don't swallow exceptions in dupterm's read()/write() - modlwip: lwip_tcp_receive(): Properly handle EOF for non-blocking sock - modlwip: more debug messages for various edge conditions - fsusermount: in mount/mkfs, deregister VFS object on error - modlwip: lwip_tcp_send(): full error handling - modlwip: lwip_tcp_receive(): full error handling - modlwip: add ability to run callback on "recv" and "accept" events - machine_i2c: allow mp_hal_pin_obj_t to be any type, not a ptr - modlwip: protect recv/accept Python callback against exceptions - modlwip: workaround esp8266 sendto issue where 1 is returned - modlwip: add print_pcbs() debug function - modwebsocket: handle CLOSE control frame - modussl: throw Python exceptions in case of errors - modussl: support server-side SSL sockets - modussl: SSL_OK from ssl_read() means "no user data so far" - modwebrepl: module to handle WebREPL protocol - modwebrepl: initial implementation of "get file" operation - modwebrepl: keep reading data when there's something to read - modwebrepl: GET_FILE: Send length-prefix chunk with one write() - modwebrepl: add rate-limiting workaround for broken network drivers - modwebrepl: set debugging by default to off - modwebrepl: add support for password - modlwip: implement sendall() method for TCP sockets - fix typo of macro that detects if float is enabled lib: - utils/printf: rework overriding printer of DEBUG_printf() - utils/pyexec: condition-out GC calls from pyexec - utils/pyhelp: extract implementation of help(obj) to a library function - axtls: update to the latest upstream, fix reported MacOSX build issue drivers: - add SSD1306 OLED driver, with I2C and SPI interfaces tools: - mpy-tool.py: new tool to work with .mpy files; currently it can freeze them - mpy-tool.py: add support for Python 2.7 tests: - add 6 tests for async await/for/with - add .exp files for async tests, so they can run with Python 3.4 - fix dict1.py so it doesn't rely on the order of dict elems - extmod: move split-on-empty-match tests to a separate test file - add testcase for yielding from a stopped generator - run-bench-tests: process tests in alphabetical order - update for _io/_collections module having been renamed minimal port: - add example of frozen persistent bytecode (.mpy file) - disable async/await syntax unix port: - build with MICROPY_PY_UHASHLIB_SHA1 if already building with axTLS - make sure build dir exists before accessing it for freezing upip - Makefile: make install more compatible (BSD, etc.) windows port: - msvc: implement automatic qstr generation using makeqstrdefs stmhal port: - implement basic C-level pin HAL - use new generic I2C object in machine module - enable framebuf module - properly handle RTS/CTS flow control for buf/unbuf transfers - add Makefile option FROZEN_MPY_DIR to support frozen bytecode - for frozen bytecode generation, add dependency of qstr file - l4: add CMSIS files to support STM32L476 - l4: add basic STM32L4xx HAL files - l4: adapt UART HAL to avoid 64-bit integer division - update HALCOMMITS due to change to hal - l4: add board definition files for STM32L476DISC - l4: add line to Makefile for building L4 series - l4: modify adc.c to add support for STM32L4 series - l4: modify uart.c to support L4 MCU - l4: modify usbd_conf.c to support L4 MCU - l4: modify rtc.c to support L4 MCU - l4: modify timer.c to support L4 MCU - fix machine.unique_id() function to work for all MCUs - l4: modify mphalport to support L4 MCU - l4: modify flash.c and storage.c to support L4 MCU - l4: add support for external interrupts/events - accel: raise an exception if the accel couldn't be initialised - use pyhelp_print_obj function - change i2c.scan() method to scan addresses 0x08-0x77 - fix typo of macro that detects if float is enabled cc3200 port: - use pyhelp_print_obj function - change i2c.scan() method to scan addresses 0x08-0x77 - disable async/await syntax esp8266 port: - enable websocket module - modnetwork: .config(): Check interface whose config is requested - modnetwork: .config(): Add "authmode" param - modnetwork: .config(): Add "password" param (W/O) - add Python modules for initial configuration - scripts/inisetup.py: set WPA/WPA2 AP mode with a predefined password - protect modpyb.h header file from multiple inclusions - implement basic C-level pin HAL - switch from using custom I2C driver to generic extmod one - enable framebuf module - in callback helpers, pop nlr_buf on successful call - esp_mphal: don't swallow exceptions in dupterm's read()/write() - esp_mphal: call_dupterm_read(): Fix order of deactivating on EOF - remove pin_id field from C pin object - add dummy entries for non-existing pins to simplify pin logic - add hard IRQ callbacks for pin change on GPIO0-15 - separate 1-wire timing funcs from Python module to save iRAM - switch integer arith routines to BootROM - scripts/port_diag.py: module to collect diagnostic info - enable input() builtin - scripts/_boot: mount block device on "" instead of "/" - moduos: add uos.mkdir function - modmachine: add reset_cause() function - adapt port to use new auto-qstr generation - moduos: add dupterm_notify() function - esp_mphal: protect dupterm_task_handler() from recursive exec - README.md: update feature list for current state of affairs - modesp: allow esp.deepsleep to take 2nd arg for RF wake opt - scripts/flashbdev: use all available space in 1MB FlashROM for FS - modesp: add flash_size() function - scripts: don't try to create filesystem on 512KB devices or less - modnetwork: .config(): Add "channel" param - scripts/flashbdev: disable debug output/checks - scripts/_boot: print notice when initial setup is executed - scripts/flashbdev: correct bootloader flash size to match real size - modnetwork: .config(): Add "hidden ESSID" param - implement basic deep-sleep capabilities - add uart_rx_wait and uart_rx_char functions - implement UART.read functionality - uart: remove obsolete UART rx buffering code - esp_mphal: remove mp_hal_feed_watchdog - convert mp_hal_pin_obj_t from pin ptr to simple integer - allow GPIO16 to be used as a pin in the uPy pin HAL - change software SPI driver to use general pin HAL - scripts/websocket_helper: module encapsulating handshake sequences - scripts/websocket_helper: disable debug output - scripts/webrepl: webREPL based on C-level websocket object - scripts/webrepl: convert to persistent daemon - scripts/webrepl: don't start on import - scripts/webrepl: allow to override port - scripts/webrepl: print connection address - scripts/webrepl: print client address for incoming connections - scripts/flashbdev: use all available Flash for filesystem - scripts/webrepl: add "ws://" to "daemon started at" message - Makefile: add target to build axTLS - esp8266.ld: put axTLS to FlashROM - Makefile: override abort() when building axtls - axtls_helpers: helper/wrapper functions for axTLS - tests/onewire.py: don't run test on import - Makefile: support linking with axTLS built from source - Makefile: enable "ussl" module; axTLS should be built first using "make axtls" - move pyb.info() function to esp module and remove pyb module - move onewire.py, neopixel.py drivers from tests/ to scripts/ - scripts/onewire.py: simplify and improve 1-wire driver - scripts/neopixel.py: remove test function from neopixel driver - set suitable values for axtls's RT_MAX_PLAIN_LENGTH & RT_EXTRA - README: add recently required step of 'make axtls' - modnetwork: make WLAN.ifconfig() read/write - help: implement help() builtin - help: add cheatsheet for basic WiFi configuration - enable WebREPL file transfer rate limiting - enable webrepl module - scripts: move all of initial setup to inisetup module - scripts/inisetup: create default boot.py in filesystem - scripts/webrepl: connection ack prompt is now printed by modwebrepl - scripts/webrepl: switch to using _webrepl object wrapper - scripts/webrepl: add "first connection" mode to setup password - README: mention WebREPL - Makefile: be sure to pass cross-compiling AR when building axtls - scripts/webrepl_setup: reject too short passwords - change platform name from ESP8266 to esp8266 - modnetwork: remove deprecated wifi_mode() - esp_mphal: add ets_esf_free_bufs(), etc. functions - modesp: add esf_free_bufs() debugging function - modesp: add malloc() and free() functions - scripts/inisetup: enable WebREPL auto-start on boot - modnetwork: remove .mac() method, move to .config("mac") - scripts/inisetup: update for nic.mac() method being gone - scripts/neopixel.py: swap red and green in pixel accessor - modpybpin: use enum+array instead of struct for parsing args - modpybpin: use None instead of PULL_NONE for no-pull config - modpybpin: make pin.irq() methods take keyword args - tutorial: mention that esptool is available via pip - scripts/ntptime: add simple NTP client docs: - esp: enumerate flash access functions - machine: start to update for esp8266 port - speed_python: clarify/generalize "Buffers" subsection - speed_python: generalize "Floating point" subsection - speed_python: add many more details on memoryviews - machine: reset_cause() has been implemented for esp8266 - topindex.html: esp8266: Enable quickref/general on the main page - esp8266/general: start "General information" for esp8266 - esp8266: add info about using deep-sleep mode to quickref - esp8266/tutorial: add tutorial placeholder page - ustruct: there's no complete "struct" module, only "ustruct" subset - esp8266: include usocket module reference - library/usocket: add link to CPython's socket module - usocket: socket-specific exceptions are for WiPy only - usocket: socket.IPPROTO_SEC is WiPy-specific - usocket: describe address format once at the beginning - network: esp8266: scan(): add note that bssid is bytes object - library: group MicroPython-specific modules under separate heading - library/index: move WiPy "micro-libraries" under corresponding heading - library/index: esp8266 has the same set of stdlibs as pyboard/unix - module "time" is actually "utime" - library/index: make single section for "micro-ified" modules - library/index: order sections from the most to least standard modules - Makefile: default BUILDDIR based on MICROPY_PORT - library: "os" module is actually "uos" - fix uos and utime heading underlines to be the correct length - library/utime: add more time functions for unix and esp8266 ports - utime: describe time() peculiarities in MicroPython - utime: describe sleep() peculiarities in MicroPython - library: consistently use admonitions for CPython differences - ubinascii: clean up grammar - network: esp8266: Add wlan.ifconfig() method - network: esp8266: Describe wlan.config() method - make the short port names in the port/version sidebar lowercase - esp8266: update quickref to reflect changes to 1-wire and NeoPixel - library/utime: elaborate on epochs and calendar time maintenance - esp8266/quickref: add info about WebREPL - ustruct: document pack_into(), unpack_from() - sys: document sys.modules - ustruct: fix argument formatting - sys: remove port-specific details from description of stdin/out/err - sys: clarify description of sys.exit() - sys: clean up print_exception() description - sys: describe sys.implementation - sys: describe sys.maxsize - sys: describe sys.platform is port-neutral manner - add _collections module reference - add _io module reference - _io and _collections were renamed to have standard "u" prefix - library/machine.I2C: update to reflect ESP8266 implementation - esp8266/general: webREPL is described in quickref for now - esp8266/general: add more points to "Multitude of boards" section - esp8266/general: fix list formatting - esp8266/general: add techspec section - esp8266/general: add "Boot process" section - esp8266_contents: reference general and tutorial docs - network: esp8266: MAC address is set via .config() method - esp8266: add ESP8266 tutorial - machine: generalize docs from just WiPy to other ports - machine: move WiPy-specific hardware details to its general reference - machine: more generic description of sleep's, WiPy details to its genref - machine: idle() description generalization - library/machine.Pin: update pin docs to reflect ESP8266 support - esp8266/tutorial: update pins tutorial to reflect changes in API examples: - http_server_ssl.py: add HTTPS server example ======== Mon, 11 Apr 2016 12:18:10 +0100 v1.7 New MicroPython cross-compiler, and vastly improved ESP8266 port This release adds the MicroPython cross-compiler that can generate .mpy files (pre-compiled bytecode) which can be executed within any MicroPython runtime/VM. The ESP8266 port is also vastly improved thanks to a hugely successful Kickstarter campaign. This port now has an alternative event loop implementation to allow proper Berkeley sockets using lwIP built from source, and a greatly improved network module. Many extension modules are now enabled (ujson, ubinascii, uctypes, uhashlib, urandom, uheapq, ure, uzlib) and the machine module includes Timer, Pin, PWM, ADC, I2C, SPI, and basic UART. Bignums are supported, along with 30-bit precision floating point, and normal error messages. There is FatFS support and uos.dupterm. Many other improvements and bug fixes have been made to the core and other ports. The basic test suite can now run within a 16k heap. Inline assembler functions now support 4 arguments. The Unix port has the -i option to start the REPL after a script is finished. The stmhal port now exposes the flash and SD card as proper objects with the block protocol. There is support for generic STM32F439 boards, the NUCLEO-F411RE board, and targets to deploy via ST-LINK and OpenOCD. py core: - mpprint: fix sign extension when printf'ing %u, %x and %X - vm: fix popping of exception block in UNWIND_JUMP opcode - objstr: for str.format, add nested/computed fields support - objstr: for str.format, don't allocate on the heap for field name - extend native type-sig to use 4 bits, so uint is separate to ptr - mpz: complete implementation of mpz_{and,or,xor} for negative args - mpz: add commented-out mpz_pow3_inpl function, to compute (x**y)%z - viper: allow casting of Python integers to viper pointers - viper: allow uint as index to load/store, and give better error msg - objarray: implement "in" operator for bytearray - mpstate.h: fs_user_mount is now standard, reusable uPy functionality - asmx64: add helper macro for generating REX_[WRXB] bits from a reg64 - asmx64: support all 16 regs in reg to memory move instructions - emitnative: add check that RHS of viper store is of integral type - repl: check for an identifier char after the keyword - vm: add macros to hook into various points in the VM - parse: use m_renew_maybe to ensure that memory is shrunk in-place - malloc: provide a proper malloc-based implementation of realloc_ext - emitinlinethumb: use qstrs instead of char* for names of asm ops - add MICROPY_DYNAMIC_COMPILER option to config compiler at runtime - stackctrl: add mp_stack_set_top() to explicitly set stack top value - emitglue: get persistent bytecode working on Linux ARM platform - objboundmeth: allocate arg state on stack if heap alloc fails - use MP_SMALL_INT_POSITIVE_MASK to check if uint fits in a small int - fix passing of some wide int types to printf varg format list - objarray: fix array slice assignment when array is reallocated - formatfloat: fix buffer overflow when formatting tiny numbers - objfun: allow inline-asm functions to be called with 4 arguments - frozenmod: allow port to override lexer to use for frozen modules - parse: don't allocate an extra parse node for power exponent - parse: when looking up consts, check they exist before checking type - stream: add mp_stream_writeall() helper function - stream: fix object vs ptr usecase in mp_stream_writeall() - modio: initial implementation of io.BufferedWriter class - modio: implement io.BufferedWriter.flush() - modio: io.BufferedWriter: describe flushing policy - formatfloat: fix case of float format where leading digit was "10" - formatfloat: fix further cases of buffer overflow in formatting - parsenum: use pow function to apply exponent to decimal number - ringbuf.h: add reusable ring buffer class - map: prevent map resize failure from destroying map - move stream-related declarations from obj.h to stream.h - combine continuous block of emit steps into with_cleanup emit call - implement basic with support in native emitter - objarray: fix array.append so it doesn't extend if append fails - stream: add bigger inventory of stream ioctl's - stream: add Python-level ioctl() method extmod: - update uzlib to 1.2.2 - fsusermount: introduce separate mkfs() function - fsusermount: implement separate umount() function - fsusermount: change block protocol to support ioctl method - modmachine: truncate integers that are to be stored using mem* - fsusermount: expose umount as a public function - fsusermount: support mounting of multiple block devices - vfs_fat: object-oriented encapsulation of FatFs VFS - vfs_fat_diskio: reusable FatFs module, move from stmhal/diskio - vfs_fat_file: reusable FatFs module, move from stmhal/file - vfs_fat_ffconf: reusable FatFs module, move from stmhal/ffconf - vfs_fat: move listdir() method from stmhal for reuse - vfs_fat: add .remove() method - vfs_fat: add .mkdir() method - vfs_fat: add fat_vfs_import_stat(), reusable import stat routine - vfs_fat: add .rename() method - vfs_fat: add lexer, move from stmhal port for reuse - vfs_fat_lexer: make conditional on FatFs support enabled - modlwip: add .print() method - modlwip: implement dummy setsockopt() - modlwip: add stream protocol read method - modlwip: add dummy .makefile() method - modlwip: add stream .read() and .readline() methods - modlwip: check for state change during recv busy-wait loop - modlwip: still process remaining incoming data of a closed socket - modlwip: add .write() stream method - modlwip: support non-blocking recv() - modlwip: factor out "socket connected" check to a function - modlwip: use MICROPY_EVENT_POLL_HOOK for event polling if defined - modlwip: rework getaddrinfo() data passing - modlwip: add socket.setblocking() method - modlwip: lwip_tcp_receive: Properly map lwIP error to POSIX errno - uctypes: use mp_binary_get_val helper when extracting value - uctypes: finish support for FLOAT32 and FLOAT64 types - modwebsocket: start module for WebSocket helper functions - modwebsocket: implement read support - modlwip: add SOL_SOCKET and SO_REUSEADDR constants for setsockopt() - modlwip: implement setsocketopt(SO_REUSEADDR) - modlwip: lwip_tcp_send: handle properly send buffer full condition - modlwip: add lwip->POSIX error map for lwIP 1.4.0 - modlwip: lwip_socket_setsockopt: handle option value properly - vfs_fat_diskio: actually support sectors != 512 with Python blockdevs - modwebsocket: properly check number of args to constructor - modure: re_exec() renamed to ure_exec() due to collison in 4.3BSD - modwebsocket: make sure to propagate EOF - modwebsocket: reset mask between packets - modwebsocket: add option for blocking writes to non-blk sockets - modwebsocket: record current fragment type (binary/text/etc.) - modwebsocket: allow to get type of last read data using ioctl() - modwebsocket: implement MP_STREAM_SET_DATA_OPTS ioctl - modwebsocket: split websocket-related defines for reuse - modlwip: fix for loss of data in unaccepted incoming sockets - modwebsocket: support write size beyond 125 bytes lib: - fatfs: add support for sector sizes larger than 512 bytes - axtls: update to the latest upstream master drivers: - sdcard: add support for multi-block read/write; add SD test tests: - open_plus: add tests for "r+", "w+" open modes - pyb: add simple test for stm module on pyboard - run-tests: add esp8266 target - bytearray1: add testcases for "in" operator - vfs_fat_ramdisk: add test for VfsFat - vfs_fat_ramdisk: switch to ioctl-based blockdev API - vfs_fat_ramdisk: allow to override sector size - vfs_fat_ramdisk: skip test if can't allocate ramdisk - skip uctypes and urandom tests not supported byt the WiPy - vfs_fat_ramdisk: add .listdir() testcase - vfs_fat_ramdisk: add testcase for .remove() - vfs_fat_ramdisk: add testcase for .mkdir() - vfs_fat_ramdisk: allow to run in native mode (don't use "with") - vfs_fat_ramdisk: add testcase for .rename() - reduce large object allocations so tests can run with small heap - print_exception: use exception which prints the same regardless of config - recursive_iternext.py: make low-heap friendly - run-tests: simplify handling of newline in output from tests - run-tests: add cmd line option "--heapsize" - split large tests into smaller files, to run with a small heap - add new subdir "stress/" specifically for stress tests - add a test for argument passing to inline-asm functions - add test for io.BufferedWriter - wipy: add Timer class tests - float2int_fp30: variant of float2int for 30-bit stuffed float - string_format_fp30: variant of string_format for 30-bit stuffed float mpy-cross: - add new component, a cross compiler for MicroPython bytecode - give a more sensible error message when file doesn't exist - remove setting of MICROPY_FORCE_32BIT=1 from Makefile unix port: - file: stop assuming that O_RDWR == O_RDONLY | O_WRONLY - enable VfsFat support - enabled importing of persistent bytecode (.mpy files) - modsocket: add comment regarding close() error checking (which is none) - unix_mphal: hack to make uos.dupterm() actually work - implement -i option (inspect - start REPL after script is finished) - file: parse "buffering" argument of open() builtin - file: "encoding" arg to open() isn't kw-only - djgpp errno.h have no ENOTSUP, so define it to Linux value - freedos: strip and size names for binaries stmhal port: - diskio: introduce MICROPY_HW_HAS_FLASH setting - move stmhal-specific FatFs routines/structs to fatfs_port.c - file: recast as "FatFs file" class, to support other VFS types - file: for self-contained usecase, don't define global types - improve NUCLEO-F401RE build, with UART2 as REPL - expose flash and SD card as proper objects with block protocol - add mount/umount/mkfs to os module - add a function for setting the pin alternate function - NUCLEO 401 - Add a bunch of missing pins and reorder the pins - CERB40 - Add pins defines for I2C3 - NUCLEO 401 - Add definitions for I2C2 and I2C3 - diskio: add provision for default returns for ioctl INIT/SEC_SIZE - improvements to the STM32F4DISC UART config settings - enabled importing of persistent bytecode (.mpy files) - make SPI use mp_hal_gpio_set_af - switch from dfu-util to tools/pydfu.py for default deploy method - add stmhal-specific README.md with extra details for this port - add makefile target to deploy stmhal build via ST-LINK - add support for generic STM32F439 board (non DISCO) - add makefile target and configuration to deploy via OpenOCD - add board definition files for NUCLEO_F411RE - rename STM32F401NUCLEO to NUCLEO_F401RE - NUCELO_F401RE cleanup - consistently enable USB SOF Irqs for all USB modes (FS and HS) qemu-arm port: - reinitialise uPy heap and runtime at start of each test - enable builtin override feature, and enable more tests cc3200 port: - add stmhal/builtin_open.c to build - fix breakage after VfsFat refactor - finally fix the Timer class API - improve robustness of the I2C driver - simplify the Timer API and correct the documents - fix "debug" build - improve robustness of WLAN during sleep modes - rename 'server' class to 'Server' for consistency - update WiPy software version to 1.2.0 esp8266 port: - modesp: implement flash_write(), flash_erase() - README: add hint about adding toolchain to PATH - modpybrtc: simplify multiplication by fixed-point value - switch bignum implementation from long-long to mpz - enable float support, using 30-bit stuffed floats - enable math module - allow Makefile's PORT variable to be overridden - change "soft reboot" message to work with pyboard.py - add network.ifconfig() - enable ujson, ubinascii, and uctypes modules - esp8266.ld: link in SDK version section - enable config settings helpful for debugging - enable uhashlib module - enable more features in mpconfigport.h - add mp_hal_delay_us function - add time.{sleep_ms,sleep_us,ticks_ms,ticks_us,ticks_diff} - reset "virtual RTC" on power on - modutime: support float argument to time.sleep() - add modmachine with mem* arrays - modmachine: basic implementation of Timer for OS virtual timers - modmachine: changing params of a timer requires disarming it first - etshal.h: add timer functions prototypes - modmachine: use etshal.h - modmachine: timer: Add ONE_SHOT and PERIODIC symbolic constants - add custom _assert() function - implement Pin.__call__() and Pin.OPEN_DRAIN mode - expose simple pin API at C level - modpybpin: add support for GPIO16 - modmachine: add Pin class from modpyb - etshal.h: more prototypes of ESP8266 SDK/BootROM functions - support raising KeyboardInterrupt on Ctrl+C - uart: add uart_flush() function - allow Makefile's BAUD variable to be overridden - enable stack overflow checking - don't gc-collect BSS - enable modlwip - Makefile: add define for ESP8266 lwIP - put more code in iROM section - main: module to run on boot is "boot", not "main" - move pyb.freq to machine.freq - modnetwork: allow to configure STA and AP interfaces separately - move wifi_mode() and phy_mode() to network module - modnetwork: add per-interface .active() method - modnetwork: move config defines to the top - modnetwork: introduce interface .config() method - modnetwork: add symbolic names for network interfaces: STA_IF & AP_IF - add alternative event loop implementation - feed WDT in ets_loop_iter() - ets_alt_task: be sure to "pop" event before calling its handler - ets_alt_task: update for vendor SDK 1.5.0 - esp_mphal: add higher-level event polling function - define MICROPY_EVENT_POLL_HOOK for the port - switch to lwIP built from source - store frozen modules in FlashROM - ets_alt_task: make FIRST_PRIO=0 to cover all task priorities - make mp_hal_delay_us work with new event framework - enable urandom module - add module weak link from json to ujson - enable more extmod's: uheapq, ure, uzlib - enable non-blocking stream support - add "socket" and "usocket" aliases for lwip module - enable auto-indent in REPL - expose pin object as a public structure for use as C pin API - add basic I2C driver, with init and writeto methods - modpybi2c: add missing include - clean up bit-bang I2C implementation - implement bit-bang I2C read, and add i2c.readfrom method - add onewire helper functions as C module - add tests/onewire.py as a driver and test code for ds18b20 dev - implement software SPI class - add PWM support - esppwm.c: fix IRQ handler prototype - put lexerstr32.o into FlashROM - put utils.o to FlashROM - link ADC class into machine module - add esp.neopixel_write function to bit-bang WS2812 data - tests: add neopixel.py test - put modpybi2c.o to FlashROM - set up UART handling task soon into init process - modesp: flash_write(): Writes in multiples of 4 bytes - modesp: flash_read(): Accept buffer to read to as a second argument - README: update for the current status of the port - enable FatFs support - esp8266.ld: put FatFs to FlashROM - deploy: Use --flash_size=8m option to esptool.py - moduos: add listdir() proxy for MP_STATE_PORT(fs_user_mount)[0] - moduos: factor out VFS method proxy helper - moduos: add os.remove(), proxying to VFS object - zero out fs_user_mount state on (soft) reset - support importing modules from filesystem - implement os.urandom function - add basic support for duplicating REPL output - enable uos.dupterm() method - esp_mphal: add support for debug UART-only output - let esp8266 "os" messages go to standard (REPL) UART - support synchronous wifi scanning - fix issue when current REPL line was garbage-collected - switch back to accumulating input data via ring buffer - implement input part of dupterm handling - reset term_obj on reboot - move PHY mode constants from modesp to modnetwork - disallow recursive calls to REPL - support dedicated REPL loop (aka pull-style) - switch to non event-driven REPL to support paste mode - uart: get ctrl-C working now that event-based REPL is disabled - use VM_HOOK to call ets_loop_iter within the VM - README: add link to docs - move .rodata where it belongs with -mforce-l32 help - bump iROM size to 512k - ets_alt_task: comment out debug output - minimize gap between Inst/DataRAM segments and FlashROM segment - switch back to flashing combined firmware (single file) - update flashing instructions in README - bump heap size to 24k - move pyb.hard_reset() to machine.reset() - move pyb.unique_id() to machine.unique_id() - modnetwork: require_if(): Report the actual interface required - make destination for vendor OS debug output soft-configurable - add initial implementation of machine.UART - README: add short troubleshooting section - switch from terse error messages to normal ones - implement multistage bootstrap sequence - add esp.freemem() and esp.meminfo() functions - implement mp_builtin_open() using vfs_proxy_call() examples: - http_client.py, http_server.py aren't just unix, move to network/ - http_client.py: improve CPython compatibility in stream mode - http_client.py: introduce main() function - http_server.py: refactor/simplify for Python 3.5 - http_server.py: introduce main() function - http_server.py: bind to 0.0.0.0, to be accessible from other hosts - http_client_ssl.py: HTTPS client example docs: - correct WiPy Timer docs - minor change to improve clarity in machine.Timer docs - add note on machine.Timer class regarding PWM output pins - correct machine.Timer code examples related to duty cycle - add esp8266 quick reference page, with basic info - esp8266: minor tweaks to quickref, Timer and I2C classes - add versions.html template and support code for a version sidebar - allow list of versions to be specified by environment variable - esp8266: fix indent errors, typos, and add info about REPL UART - update asm_thumb2_hints_tips re return type of asm funcs - update details on using ADCAll object for vref/vbat channels - add Python speed optimisation guide, including minimal viper ref - esp8266: update quick reference: i2c.readfrom and neopixel example - update asm tutorial, maximum number of allowed args is now 4 - update pyb.I2C constructor to reflect changes in Pyboard Lite - mention that pyb.SPI constructor accepts "X" and "Y" arguments - update pyb.UART.any() to mention that it returns character count - topindex.html: refer to "pyb" module only for pyboard - add standard modules list for esp8266 - network: esp8266: Update docs on WLAN constructor - more standard modules for esp8266 - esp: remove getaddrinfo(), now in socket module as expected - esp8266/quickref: note that timers supported are virtual ones - esp8266/quickref: add note about GPIO16 - esp8266: phy_mode() moved to network module - esp8266: esp.wifi_mode() replaced with network.WLAN.active() - esp8266: esp.mac() replaced with network.WLAN.mac() - correct pin interrupt example code for the WiPy - network: esp8266: status is WLAN object method - network: esp8266: .scan() is now synchronous and returns result list - update copyright notice - esp8266: esp.socket is deprecated, remove from docs - os: change wording to be a bit more port-neutral - machine: change wording to be a bit more port-neutral - ubinascii: document a2b_base64(), b2a_base64() - esp8266/quickref: add note about physical vs logical pin numbers - ubinascii: document non-standard "sep" argument to hexlify() - esp8266: Enable "machine" module docs ======== Sun, 31 Jan 2016 23:22:41 +0000 v1.6 IPv6 support in unix, bignum constant folding, urandom module, faster VCP In this release there are many bug fixes and consolidation of previous features. Constant folding in the parser can now operate on arbitrary precision integers, and the inline assembler is no longer restricted to using small-ints or 30-bits. The urandom module has been added with the most useful random functions included. The uhashlib module now implements SHA1. The Unix port supports IPv6. The stmhal port has much faster USB VCP for board to PC transfers, and Timer(3) is now freed up for general purpose use by the user. py core: - frozenmod: make frozen module content be 0-terminated - frozenmod: store frozen module names together, to quickly scan them - use polymorphic iterator type where possible to reduce code size - make dir report instance members - implement __dict__ for instances - objstr: in str.format, handle case of no format spec for string arg - parse: optimise away parse node that's just parenthesis around expr - change mp_obj_int_is_positive to more general mp_obj_int_sign - parse: improve constant folding to operate on small and big ints - inlinethumb: allow assembler to use big ints as args to instructions - inlinethumb: remove 30-bit restriction on movwt instruction - viper: truncate viper integer args so they can be up to 32-bit - emitglue: add more feature flags to .mpy persistent bytecode output - mpz: fix conversion of float to mpz so it works on big endian archs - objint: fix classification of float so it works for OBJ_REPR_D - change type of .make_new and .call args: mp_uint_t becomes size_t - change type signature of builtin funs that take variable or kw args - change first arg of type.make_new from mp_obj_t to mp_obj_type_t* - emitglue: use mp_obj_is_float instead of MP_OBJ_IS_TYPE - use new code pattern for parsing kw args with mp_arg_parse_all - add ustruct.pack_into and unpack_from - modmicropython: add stack_use, heap_lock and heap_unlock functions - inlineasm: add ability to specify return type of asm_thumb funcs - runtime: mp_stack_ctrl_init() should be called immediately on startup - formatfloat: add ability to format doubles with exponents > 99 - builtin property: accept keyword arguments extmod: - moduos_dupterm: make uos.dupterm() implementation reusable - moduos_dupterm: make mp_uos_dupterm_tx_strn() function reusable - moduos_dupterm: handle exceptions in call to dupterm's .write() - fix uctypes size calculation for bitfields - modurandom: add "urandom" module - modurandom: make yasmarang() function static - modurandom: add some extra random functions - moduhashlib: add support for SHA1 (based on axTLS) - moduhashlib: use MICROPY_PY_UHASHLIB_SHA1 config define - moductypes: implement assignment for scalar array tests: - uctypes: test item assignment for scalar arrays - object_dict.py: add test for obj.__dict__ - allow float tests to run when MATH_SPECIAL_FUNCTIONS is disabled - fix math_fun_special test so it passes with single prec float - remove builtin_dict test - add some tests for urandom module - update pyboard LED test - for pyboard, add test for I2C error handling and recovery minimal port: - add enough code to run minimal build on STM32F4xx hardware unix port: - unix_mphal: handle exceptions in call to dupterm's .read() - unix_mphal: be sure to wrap dupterm code with MICROPY_PY_OS_DUPTERM - modtime: strftime(): Support 2nd argument, but as time_t value - add socket.inet_ntop function - allow to build coverage build with OBJ_REPR_D - add option to build 64-bit NaN-boxing interpreter - modffi: allow to compile modffi in OBJ_REPR_D mode - modsocket: accept(): Make IPv6-clean - modsocket: sockaddr(): Handle AF_INET6 addresses windows port: - enable urandom module stmhal port: - make stm constants big ints when they don't fit in a small int - remove custom mod_machine_mem_get_{read,write}_addr functions - add os.statvfs - add support for building frozen files - add support for the STM32F401NUCLEO board - make USB CDC driver use SOF instead of TIM3 for outgoing data - make TIM3 available for use by the user - add PWM capability for LED(3) and LED(4) on pyboards - in HAL I2C driver, move DMA setup to after sending I2C address docs: - fix readthedocs build by updating Latex params - set author as 'Damien P. George and contributors' - add link from pyboard switch tutorial to ISR rules document - include extra functions in time documentation for pyboard - several minor changes: network, pyb, ADCAll and inline asm - update to say that Timer(3) is free, and detail LED intensity travis: - add unix NaN-boxing build to Travis builds - switch to Ubuntu 14.04 Trusty ======== Thu, 31 Dec 2015 14:43:19 +0000 v1.5.2 64-bit NaN-boxing, FreeDOS target, and PYBv1.1 and PYBLITEv1.0 boards This release brings a new object model for 64-bit NaN-boxing on 32-bit architectures, while allows double precision floating point numbers to be used without allocating on the heap. Unix and Windows ports have better handling of Ctrl-C, and there is now a FreeDOS target within the unix Makefile. Windows (msvc) builds are now checked using Appveyor CI. The stmhal port has new board config files for then next version of the pyboard, PYBv1.1 and PYBLITEv1.0, as well as config files for the STM32F429 discovery kit. There is now delayed RTC initialisation with LSI fallback, and DMA support for the SD card. The DMA controllers are turned off if DMA is idle for 100 msec or more, saving power. py core: - mpconfig.h: allow to build without alloca() for ANSI C compliance - binary: make use of MP_ALIGN - asmx86: fix function definition to use int32_t instead of int - change mp_print_strn_t func type to use size_t for the str length - change qstr_* functions to use size_t as the type for str len arg - emit: change type of arg of load_const_obj from void* to mp_obj_t - make mp_setup_code_state take concrete pointer for func arg - use uintptr_t instead of mp_uint_t in MP_TAGPTR_* macros - gc: move away from using mp_uint_t, instead use uintptr_t and size_t - add MP_ROM_* macros and mp_rom_* types and use them - wrap all obj-ptr conversions in MP_OBJ_TO_PTR/MP_OBJ_FROM_PTR - add support for 64-bit NaN-boxing object model, on 32-bit machine - mpprint: printing of doubles is now supported (by uPy own routine) - gc: make GC block size be configurable - mpconfig: actually allow to override MICROPY_BYTES_PER_GC_BLOCK - fix function calls that have positional and a star-arg-with-iterator - modsys: implement sys.modules - make it easy to build without MICROPY_PY_BUILTINS_COMPLEX - add MICROPY_PY_BUILTINS_MIN_MAX, disable for minimal ports - add min/max "default" keyword argument - don't try to optimise for+range when args are not simple expressions - fix calling of parent classmethod from instance of subclass - add mp_get_stream_raise to factor out check for stream methods - mkrules.mk: don't pass COPT to linker - emitinlinethumb: add support for MRS instruction - make UNARY_OP_NOT a first-class op, to agree with Py not semantics - fix compiler to handle lambdas used as default arguments - modmath: add domain error checking to sqrt, log, log2, log10 - objpolyiter: implement instance-polymorphic iterator type - gc: scan GC blocks as an array of pointers, not an array of objects - gc: for finaliser, interpret a pointer into the heap as concrete obj - gc: use size_t instead of mp_uint_t to count things related to heap - mpprint: implement %llu and %lld format specifiers for mp_printf - bc: use size_t instead of mp_uint_t to count size of state and args - qstr: use size_t instead of mp_uint_t when counting allocated bytes - qstr: change type of qstr from mp_uint_t to size_t - parse: replace mp_int_t/mp_uint_t with size_t etc, where appropriate - compile: use size_t or uintptr_t instead of mp_uint_t - parse: include stddef.h for definition of size_t - compile: simplify compilation of comprehension iterators - emitglue: add include of unistd.h for read function - add MICROPY_ENABLE_COMPILER and MICROPY_PY_BUILTINS_EVAL_EXEC opts - gc: when printing info, use %u instead of UINT_FMT for size_t args - obj: fix float constants for MICROPY_OBJ_REPR_C - mpprint: fix printing of 64bit integers for 64bit windows builds - objstr: make sure that b"%s" % b"foo" uses undecorated bytes value - objstr: applying % (format) operator to bytes should return bytes, not str - handle case of return within the finally block of try-finally - be more restrictive binding self when looking up instance attrs - map: add fast-path for hashing of map index when it is a qstr - gc: improve mark/sweep debug output - map: in map lookup, check for fixed map independent of ordered map - nlr: use single preprocessor symbol to check if building on Windows extmod: - move fsusermount.c from stmhal for cross-port reuse - fsusermount: make configurable with MICROPY_FSUSERMOUNT - modmachine: use uintptr_t instead of mp_uint_t for address type - moductypes: set_aligned(): Handle INT64/UINT64 - moductypes: sizeof operation depends on layout type of structure - moduhashlib: add namespace prefix for crypto-algorithms/sha256.h - modubinascii: add "separator" argument to hexlify() - modlwip: tcp_recv: Use more regular and responsive poll pattern - modlwip: mark some lwip_socket_obj_t's fields as volatile - modlwip: user proper field name and value names for socket state - modlwip: avoid magic numeric values in memcpy() - modlwip: use _ERR_BADF instead of magic number lib: - utils/printf: apply workaround for static linking with uclibc - utils/printf: add vsnprintf alias for Clang - libm: allow math funcs to be used by non-Thumb archs - utils: add pyexec_frozen_module to load and execute frozen module tools: - allow pyboard.py to work when boot.py prints things - add option to pyboard.py to wait for serial device to be ready - upgrade upip to 0.6.3; updated for _os -> uos builtin module rename - add C middle-processor to make builtin tables proper hash tables tests: - run-tests: improve robustness of REPL tests - extra_coverage: update for sys.modules addition - run-tests: allow to skip complex tests if it's not compiled in - add min/max "default" agrument test - builtin_minmax: add testcase for lazy iterable (generator) - add test for "not" of a user defined class - add tests for %-formatting of bytes - add tests for stream IO errors - add test which demonstrates uctypes LITTLE_ENDIAN packing failure unix port: - unix_mphal: use size_t instead of mp_uint_t in stdout_tx_strn decls - moduselect: fix bug in poll.poll() scanning loop - moduselect: poll.register(): Reuse freed entries in poll array - moduselect: support growing of poll array - modtime: sleep(): automatically restart after receiving EINTR - modtime: sleep(): return early if KeyboardInterrupt is pending - mpconfigport.h: for MICROPY_NO_ALLOCA=1, don't even include alloca.h - main: check pending exception at the end of code block execution - moduselect: register(): allow to call with duplicate file descriptor - modtermios: provide B57600 and B115200 constants only if defined - moduselect: implement "one-shot" flag for poll.poll() - rename "_os" module to "uos" for consistency with baremetal ports - move modmachine into unix directory - moduselect: make configurable with MICROPY_PY_USELECT - modtime: add strftime() function (only single argument is supported) - modos: implement ilistdir() - modos: allow to configure use of d_ino using _DIRENT_HAVE_D_INO - modos: add errno() function to get/set errno value - add FreeDos target - change define logic of _DIRENT_HAVE_D_INO to match other macros - unix_mphal: properly initialize struct sigaction - unix_mphal: just consistently set sigaction.sa_flags to 0 - machine_mem improvements - properly cancel REPL input when Ctrl-C is pressed - unix_mphal: raise KeyboardInterrupt straight from signal handler - implement uos.dupterm(), conditional on MICROPY_PY_OS_DUPTERM windows port: - cleanup makefile - support 64bit mingw-w64 builds - make keyboard_interrupt_obj available, it's standard feature - add basic support for raising KeyboardInterrupt - add Appveyor CI builds for msvc port - better handling of Ctrl-C - msvc: nicer handling of asserts and 'invalid' parameters - msvc: use different output directories depending on build type - msvc: use new modmachine infrastructure per changes in f925165 - msvc: add dirent.h/.c implementation stmhal port: - implement delayed RTC initialization with LSI fallback - put IRQs into priority order - turn off DMA clocks when idle for 100 msec - add dma support for sdcard - on SysTick IRQ, only process one DMA channel at a time - irq: add comment about SDIO priority being higher than DMA - irq: set all IRQ subpriorities to 0, since they aren't used - move flash storage idle tick handler from TIM3 to SysTick - in SysTick IRQ handler, make uwTick variable non-volatile - process storage idle tick handler in different slot to DMA - increase the priority of UART IRQ - add support for the STM32F429I-DISCO kit by STMicro - allow make DEBUG=1 to build - make stm.mem* support large integers - uart.any() function now returns number of bytes available - make uart.write() function correctly for timeout=0 - add board config files for PYBv1.1 and PYBLITEv1.0 - put all DMA channel & stream definitions in dma.h - add raise_irq_pri and restore_irq_pri functions - protect SD card DMA transactions against USB MSC contention - add rtc.init() method to force RTC to re-initialise - only use BASEPRI irq stuff if Cortex is M3 or higher - add option to free up TIM3 from USB VCP polling - fix uart off by 1 circular buffer size - execute boot.py and main.py when formatting the file system - print exception information in nlr_jump_failed - enable two USB phys to be supported together - timer: use mp_float_t instead of float - for SPI config, use HW_SPIx_SCK instead of HW_ENABLE_SPIx - make uart init use struct instead of array for parsing args - extend SPI support to fully support all SPI devices on STM32F429 - moduselect: implement "oneshot polling" flag - change PLL configuration for STM32F7DISC - add mem8/mem16/mem32 operations to machine module - add pyb.irq_stats() to get statistics about IRQ calls - add struct qstr to block of qstrs needed for MICROPY_PY_STRUCT - fix usbd_conf.c for devices which don't have USB_HS at all cc3200 port: - correct buffer offset in serial flash diskio module - add __get_BASEPRI and __set_BASEPRI inline function definitions esp8266 port: - modesp: implement flash_read(offset, size_bytes) function - mac() function belongs to network module per the latest API - modesp: allow to compile out proprietary espconn stuff docs: - library: add network server example - add discussion on interrupt handlers incl uPy specific techniques pic16bit: - use global MICROPY_NO_ALLOCA setting ports: - rename "machine" module to "umachine" ======== Mon, 23 Nov 2015 21:27:33 +0000 v1.5.1 LwIP support, and preliminary implementation of persistent bytecode This release includes the lwip network stack module with slip support. There is a preliminary implementation of persistent bytecode which allows to save compiled bytecode to a .mpy file, to be loaded at a later time by another MicroPython instance. Double precision floating-point formatting is now provided by the core, and the bundled upip module is no longer dependent on FFI. stmhal port has improved RTC startup. There are many bug fixes and improvements to the documentation. py core: - makeversionhdr.py works with backslashes in paths - in inline asm, vldr and vstr offsets now in bytes not words - modstruct: support repetition counters for all types, not just string - add py/mphal.h and use it in all ports - adjust object repr C (30-bit stuffed float) to reduce code size - clear finalizer flag when calling gc_free - objint_longlong: instead of assert, throw OverflowError - asmthumb: allow to compile with -Wsign-compare and -Wunused-parameter - emitinlinethumb: allow to compile with -Wsign-compare - reorganise bytecode layout so it's more structured, easier to edit - put all bytecode state (arg count, etc) in bytecode - add constant table to bytecode - add MICROPY_PERSISTENT_CODE so code can persist beyond the runtime - add MICROPY_PERSISTENT_CODE_LOAD/SAVE to load/save bytecode - allow to import compiled bytecode files - modmath: make expm1() be in MICROPY_PY_MATH_SPECIAL_FUNCTIONS - compile: don't unnecessarily save state when compiling param list - implement default and star args for lambdas - modmath: make log2, log10 and hyperbolic funcs be SPECIAL_FUNCTIONS - in mp_state_ctx_t, make mp_pending_exception volatile - store key/value in earliest possible slot in hash table - add Cygwin support to py/nlrx86.S - add mp_compile_to_raw_code() to return raw code object - emitglue: add mp_raw_code_load_mem to load raw-code from memory - emitglue: host definition of mp_verbose_flag - formatfloat: convert to fully portable implementation - formatfloat: fix incorrect rounding for %f format - formatfloat: handle calculation of integer digit for %f format properly - mpz: normalize xor operation result to fix bugs in comparisons - emitglue: add feature-flag header to .mpy to detect bytecode compat - emitglue: implement persistent saving and loading of const objects - check that second argument to hasattr is actually a string - do proper checking of * and ** in function definition extmod: - modlwip: initial commit of the lwip network stack module - modlwip: slip: Use stream protocol and be port-independent - modlwip: lwip_tcp_send(): Common subexpression elimination, use MIN() - modlwip: socket->incoming changed by async callbacks, must be volatile - modlwip: change void pointers to unions, include new mphal.h file - moductypes: implement buffer protocol - moductypes: when dealing with UINT64, use mp_obj_new_int_from_ull() - re1.5: update to 0.8, implements ?: and ??, as well as improved robustness - re1.5: workaround issue with mingw32-gcc 4.2.1 - modure: make sure that errors in regexps are caught early lib: - lwip: add LwIP stack as a submodule in the library directory - pyexec: for paste mode use "Ctrl" as the name of the key, not "CTRL" - memzip: factor out memzip from teensy/ into lib/memzip - mp-readline: make it easy to exit auto-indent mode by pressing enter - fatfs: unify fatfs configuration - pyexec: move header pyexec.h from stmhal directory - utils/printf: move from stmhal/ tools: - pyboard.py: make -c (inline Python code) option compatible with python2 - pyboard.py: don't add terminating \x04 character to stdout output - update to upip 0.6.2: removes FFI dependency tests: - jni: test for basic object operations - make sure test output has \r\n line-ends when running on Windows - base/struct1.py: add test for repetition counters - jni: add test for working with container of List interface - float/string_format: add testcase for incorrect rounding for %f - int_big_xor: test that xor result is normalized - int_big_*: add more tests for result normalization minimal port: - use mp_hal_ticks_ms() - add an explicit comment on the gchelper.s line in the Makefile unix port: - modjni: don't pass Java object to a method which doesn't expect it - modjni: actually check argument type when doing method resolution - gccollect: fallback to setjmp-based register fetching automatically - modjni: add missing get_jclass_name() function - allow to override MICROPY_PY_MATH_SPECIAL_FUNCTIONS from command-line - switch stderr printing from ANSI C to native POSIX - modos: add getenv() - modos: add mkdir() - modos: getenv(): Handle non-existing envvar correctly - input: switch to POSIX I/O for history reading/writing - add "uselect" module, with poll() function - modsocket: implement sockaddr() function to decode raw socket address - modsocket: use snprintf(), as defined by lib/utils/printf.c - use printf() implementation in terms of mp_printf() - main: get rid of perror() which uses stdio windows port: - do not use wildcards when looking in dirs containing optional features - add usleep() implementation for msvc port - REPL: erase pre-calc'd number of chars instead of clearing whole line - rename "time" module to "utime" for consistency with others - call _set_output_format() only on Visual Studio versions 2013 or lower - use write() instead of fwrite() to avoid out-of-order output - README: deprecate mingw32, suggest using mingw64 - update build instructions in the README - fix project file for Visual Studio 2015 - allow specifying the python executable to use for msvc builds - define ssize_t and use renamed mphal header stmhal port: - ffconf.h: include py/mpconfig.h - fix USB_VCP.recv so that it returns actual amount of bytes read - pyexec: use mp_hal_ticks_ms() - moduselect: use mp_hal_ticks_ms() - make accel AVDD pin configurable via mpconfigboard.h - enable sdcard on STM32F7DISC board - add define for UNIQUE_ID address (differs per MCU) - make RTC init skip startup if LTE is already enabled and ready - update PYBv3 and PYBv4 pin defs to include MMA pins, and others - pyexec.c is common module, move to lib/utils/ - add symbolic #defines for interrupt levels in irq.h - can: fix a bug in filter handling - rtc: lSx oscillator is only initialized upon initial power up - add missing regex property for parsing header comments - print more information at HardFault time - fatFS configuration moved to the library folder - moduselect: expose POLLIN/OUT/ERR/HUP constants - modmachine: initial attempt to add I2C & SPI classes cc3200 port: - add created sockets to the registry - enable WLAN irq on creation - allow to read pin value when in OPEN_DRAIN mode - update README to change pyb to machine - set pin direction first, then value - fix bug in FTP command buffer, and set listening backlog to 0 - actually allow to specify a custom build directory - switch from HAL_Delay() to mp_hal_delay_ms() - switch from HAL_GetTick() to mp_hal_ticks_ms() - use common pyexec.c - fix SPI clock divider calculation - make telnet server ignore NULL characters - force SSL method to be TLSV1 - fatFS configuration moved to the library folder - unmount all user file systems after a soft reset - appsign.sh: use md5 if running under Darwin teensy port: - switch from HAL_* to mp_hal_* functions - switch over to using frozen modules instead of memzip esp8266 port: - switch to standard mp_hal_*() functions examples: - add example of I2C usage, taking PyBoard accelerometer as subject docs: - add remark about ssl sockets and standard sockets - correct machine.RTC examples - explicitly specify behavior of UART stream protocol methods on timeout - USB_VCP: Always in non-blocking mode, clarify stream method returns - wipy: fix error in WLAN quickref - wipy: fix several typos and change some pyboard to WiPy - wipy: fix bug in example code and add note regarding OTA - select: Describe poll.poll() return value in detail - actually add unix port indexes, so docs for it could be generated - library/index.rst: minimally adapt for unix port - move instructions on generating the documentation to docs/README.md - add docs about REPL paste-mode and Control-C - select: document POLLIN/OUT/ERR/HUP - update docs for WiPy wlan.connect() - wipy: add warning about losing wlan connection when changing mode - wipy: make wifi/wlan naming consistent with tutorial.rst ======== Wed, 21 Oct 2015 16:58:52 +0100 v1.5 First-class REPL, ussl module, machine module for WiPy, stuffed-floats This release brings first-class REPL support, which now has tab completion, auto-indent, paste mode, history and _ to hold the last computed value. There is a new ussl module, and one can now build a standalone unix binary. The new machine API is implemented in cc3200, with the machine module and additions to time and os modules. stmhal contains the beginnings of this new API, while still retaining full backwards compatibility with the original pyb API. unix also includes the new time functions, sleep_ms, sleep_us, ticks_ms, ticks_us and ticks_diff. A new object representation is available which stores single-precision floats within a machine word (using 30-bit precision), and allows to use float objects without the heap (not enabled in any port). There are also bug fixes and general improvements. py core: - put compiler state on the C stack - objrange: bugfix for range_subscr() when index is a slice object - parsenum: provide detailed error for int parsing with escaped bytes - mpz: raise NotImplError instead of failing assertion - mpz: force rhs of mpz_shl_inpl/mpz_shr_inpl to be unsigned - mpz: fix bignum anding of large negative with smaller positive int - catch all cases of integer (big and small) division by zero - allocate parse nodes in chunks to reduce fragmentation and RAM use - allow to enable inline assembler without native emitter - fix edge case when constant-folding negation of integer - emitnative: raise ViperTypeError for unsupported unary ops - don't generate unnecessary parse nodes for assignment or kwargs - factor logic when creating parse node from and-rule - makeqstrdata.py: catch and report case of empty input file - rename MP_BOOL() to mp_obj_new_bool() for consistency in naming - add paste mode to friendly REPL, entered via CTRL-E - rename "Micro Python" to "MicroPython" in REPL, help, readme's and misc - objarray: allow to create array of void pointers, as extension to CPython - move constant folding from compiler to parser - make parser error handling cleaner, less spaghetti-like - allow to to build MicroPython as a static library - add support to call __init__ from a builtin module on first import - implement ptr32 load and store in viper emitter - fix calc of qstr memory usage, due to new qstr chunk allocation - remove dependency on printf/fwrite in mp_plat_print - fix with+for+return bug by popping for-iter when unwinding exc stack - add option for inline assembler to support ARMv7-M instructions - add support for _ in REPL to hold last computed value - stream: allow to reuse is_nonblocking_error() - add lsl/lsr/asr opcode support to inline Thumb2 assembler - add mp_obj_is_float function (macro) and use it where appropriate - move float e/pi consts to objfloat and make mp_obj_float_t private - make float representation configurable with object representation - add object repr "C", where 30-bit floats are stuffed in obj word - nlrthumb: make compatible with Cortex-M0 (ARMv6M instr set) extmod: - add modussl, an SSL socket wrapper module based on axTLS lib: - axtls: add axtls git submodule, dependency of modussl - libffi: add libffi as a submodule - mp-readline: add n_chars argument to mp_hal_erase_line_from_cursor - make netutils.h available to all ports by default drivers: - sdcard: allow up to 5 retries to initialise SD card tools: - upip: update to 0.5.9 - pyboard: add -c argument to run a program passed as a string tests: - wipy: improve robustness of time test - wipy: improve robustness of rtc_irq test - wipy: add machine module tests - test slicing a range that does not start at zero - add further tests for mpz code - allow tests to pass against CPython 3.5 - add test for evaluation order of dictionary key/value pairs - in pyb RTC tests, check wakeup register values - add more tests for viper 16/32-bit load/store, and ellipsis - jni: start adding modjni tests - extmod: add tests for sleep_ms/us(), ticks_ms/us/diff() unix port: - modjni: new_jobject(): Handle null reference - modjni: call_method(): If name doesn't match, cleanup via goto next_method - modjni: call_method: Better resource release - modjni: call_method: Delete done local references in loop - modjni: implement len() for objects with java.util.List interface - modjni: fix method argument matching - modjni: propagate Java exceptions on list access - modjni: convert Java's IndexOutOfBoundsException to Python's IndexError - modjni: jobject.__str__/__repr__: Return Java .toString() value - modjni: jclass.__str__/__repr__: Return Java .toString() value - add support for building axtls dependency lib - modjni: after Call*Method(), Java exception should always be checked - modjni: allow to access fields of objects - modjni: py2jvalue: Support bool and None values - modsocket: fix usage of pointers to locals outside scope - add exit and paste-mode hints to shell startup banner - modtermios: tcsetattr: if 0 passed for "when" param, treat as TCSANOW - modjni: call_method: check for Java exception after method return - modjni: add iteration support for Java List objects - allow to build against Android down to 1.5 - modos: add statvfs() function - unix_mphal: implement HAL_Delay() and HAL_GetTick() - modtime: implement sleep_ms(), sleep_us() - modtime: implement ticks_ms(), ticks_us() and ticks_diff() - modos: android Bionic lacks statvfs(), has BSD statfs() stmhal port: - in RTC.wakeup, fix setting of wucksel to get correct period - fix RTC.wakeup so it correctly calculates WUT for large periods - fix USB CDC-only mode under Windows - enable REPL auto indent; document paste mode in help() - allow to set bits resolution for DAC; 8 is default, can have 12 - make USB serial number actually be unique - early version of machine module for stmhal - add sleep_{ms,us} and ticks_{ms,us,cpu,diff} to time module - implement os.dupterm (was pyb.repl_uart) - uart: if char is not received within timeout, return EAGAIN error - bring Pin class close to new machine module specification - rtc: init uses YMD rather than backup register to detect powerup - enable "all special methods" configuration option cc3200 port: - new irq API, affects all classes that provide the irq method - new WLAN API including test - implement support for os.dupterm() - rename pyb module to machine - disable uheapq and uhashlib - make auth param positional in wlan.connect - always reset WLAN after setting the mode - wiPy SW v1.0.0 release - in scan results rename 'auth' field to 'sec' - create wipy module, remove HeartBeat class - increase stack sizes a bit - refactor network module to make the server a propper object - WLAN class can retrieve the existing instance - enable REPL autoindent - uart.read() returns EGAIN if no chars available - make socket.listen([backlog]) compliant with Python 3.5 - enable "all special methods" configuration option - bump version to 1.1.0 docs: - update esp8266 documentation to match the code - describe properly how MCU can be woken from pyb.standby() state - wipy: update all WiPy docs to reflect the new API - wipy: add wipy and network.server documentation - wipy: add wipy tutorials section - wipy: add usocket and ussl modules' documentation - wipy: several corrections to the classes in the machine module - wipy: remove remaining references to 'af', which is now 'alt' - wipy: add more tutorials and examples misc: - travis: build "deplibs" in unix port - README: document "Ctrl-D" shell exit - README: document how to enable/build external dependencies ======== Wed, 23 Sep 2015 17:16:22 +0100 v1.4.6 Auto-indent for REPL, jni module for unix, lots more tests py core: - make frozensets hashable - add MICROPY_PY_BUILTINS_FILTER to configure filter builtin - make slice attributes (start/stop/step) readable (enable via MICROPY_PY_BUILTINS_SLICE_ATTRS) - add support for array('q') and array('Q') - add stream_tell method, and use for unix and stmhal file tell - make string formatting 8-bit clean - treat escaped quotes correctly in REPL continuation - fix function args when a star-arg is followed by keyword args - properly classify floats that look like hex numbers (eg 0e0) - fix calculation of max digit storage for mpz; fix sys.maxsize - refine SyntaxError for repeated use of global/nonlocal - raise SyntaxError when unicode char point out of range - fix error reporting for unexpected end of modulo format str - fix error type for badly formatted format specifier (is now ValueError) - raise NotImplementedError for unicode name escape instead of assert - for str.endswith(s, start) raise NotImplementedError instead of assert - make str.rsplit(None,n) raise NotImplementedError instead of assert - handle 'raise X from Y' by issuing a warning that exception chaining is not supported - make it_iternext() recognize IndexError - only compile function annotations if really needed (for native emitter) - simplify dispatch of bool binary op - simplify printing of bytes objects when unicode enabled lib: - readline: add auto-indent support; 4 spaces are added at start of line to match previous indent, and if previous line ended in colon; backspace deletes 4 space if only spaces begin a line drivers: - nrf24l01: fix SPI phase setting to match specs of nRF chip tools: - upgrade upip to 0.5.8 (adds support for experimental ussl module) tests: - explain in README how tests get skipped - add feature_check dir to collect capability detection scripts - split byteorder-dependent tests to *_endian.py's - allow to skip byteorder-dependent tests - add escaped quotes tests for REPL - add tests for bool, bytearray, float, exceptions (to improve coverage) - add test for exception-chaining raise syntax - add test on set/frozenset equality - add tests for non-compliant behaviour (relative to CPython) - add test where __getitem__ raises IndexError to stop iteration - make io test cleanup after itself by removing 'testfile' - move int+unicode test to unicode-specific test directory - wipy: add I2C tests - wipy: additional tests for when the UART is un-initialized - wipy: improve UART tests with no pin assignment case - wipy: remove unneeded dependencies to pyb.Pin unix-cpy port: - port is removed (no longer needed), along with conditional code in core unix port: - bump default heap size to 1MB (2MB on 64-bit systems) - enable REPL auto-indent - allow to build libffi from source and link against it - add 'jni' module to interface to JNI-compliant JavaVM windows port: - make mpconfigport.h up-to-date with the unix port - make unistd.h more posix compatible stmhal port: - use polling, not DMA, for 1 byte SPI transfers - add 'opt' arg to pyb.main, to set mp_optimise_value - add option to query for the current usb mode - add support for STM32F411 Discovery Board (STM32F411E-DISCO) - enable I & D caches for Cortex-M7 - fix single precision float printing error cc3200 port: - implement new Pin API - implement new UART API - implement new I2C API - implement new SPI API - implement new ADC API - implement new WDT API - implement new SD and RTC API plus os and time modules' extensions - improve uniflash script and make it a bit more verbose - increase error led blynk period to 100ms - keep overwriting the same image on sequential updates - improve file system check routine - make sure to update sleep objects when registered - reduce servers cycle time to improve FTP transfer rate - remove unneeded loops in the FreeRTOS hooks - server side SSL socket requires both certfile and keyfile - don't clear the WDT special bit in the bootloader - disable some uPy features in debug mode to help code fit - change HeartBeat period from 5 to 4 seconds - add mphal error to raise hardware related exceptions esp8266 port: - add wifi_mode() to read and set WiFi operating mode - add wlan.isconnected() to maintain parity with other ports docs: - wipy: adapt ADC doc and quickref to the new API - wipy: update I2C and UART docs to match the new API - wipy: add pins to the I2C constructor ======== Tue, 11 Aug 2015 13:42:30 +0100 v1.4.5 Lots of additions and improvements; support for STM32F2 and F7 MCUs. py core: - make showbc decode UNPACK_EX, and use correct range for unop/binop - use wrapper to check self argument of builtin methods, to prevent seg faults - remove mp_load_const_str and replace uses with inlined version - remove mp_load_const_bytes and instead load precreated bytes object - improve mp_import_name() debug logging - catch case when relative import happens without active package - fix running package submodule with -m - add TimeoutError exception subclassed from OSError - allow to build with debugging and bytearray but no array - modstruct: Raise NotImplementedError for unsupported repeat specification - REPL: Fix case where shorter names are shadowed by longer names - prevent many extra vstr allocations by preallocating room for null byte - improve allocation policy of qstr data (saves RAM) - modbuiltins: Implement round() to precision - make qstr hash size configurable, defaults to 2 bytes - implement memoryview slice assignment, eg m1[0:3] = m2[2:5] - viper: allow functions to take up to 4 arguments - vipre: issue an error when compiling functions with more than 4 args - raise SyntaxError when str hex escape sequence is malformed - fix handling of parsing empty input so it raises an exception - viper: compile errors now have traceback with function and filename - REPL: don't look inside strings for unmatched brackets/quotes - give more precise line number for compile errors (incl viper functions) - make list += accept all arguments and add test - makeversionhdr.py: Fallback to using docs version if no git repo extmod: - ubinascii: add a2b_base64 and b2a_base64 functions - machine: implement physical memory access using /dev/mem (Linux, etc) lib: - readline: add emacs control chars for cursor movement (disabled by default) drivers: - onewire: fix ds18x20.read_temp so it works when no rom given tools: - update upip to 0.5.4: recognize and handle "package not found" error - make-frozen.py: make Python2 compatibile - pydfu.py: fix to work with old and new versions of PyUSB - pyboard.py: fix parsing of returned error so last chr is not lost - pyboard.py: make enter_raw_repl stricter and more reliable - pyboard.py: speed up reading of chars by decreasing sleep period - pyboard.py: add telnet support - pyboard.py: make Python2 compatible tests: - add testcase for open(..., "a") - adapt basics/memoryerror.py for ports with lower heap sizes - adapt misc/features.py tests for ports without floating point - add support for the WiPy in run-tests script (use --target to specify it) - split out json float tests to separate files - add test for relative import without package context - skip parser test if "compile" builtin is not available - use PTY when running REPL tests - add test for pyboard SPI in slave mode, recv with no master - test REPL emacs keys, but only if present - always use forward slashes for paths (for Windows tests) - fix exceptions when running cmdline tests on Windows - Remove over-specification of startup banner unix port: - add O_WRONLY | O_CREAT to open call when opening file for append ("a") - socket.getaddrinfo: accept family & socktype arguments - socket.getaddrinfo: port is unsigned value - modsocket: implement sendto(), recvfrom(), inet_pton() - set MICROPY_PY_SYS_PLATFORM to "darwin" if compiled on OSX stmhal port: - modify dma_init() to accept init struct as an argument, making it more generic - add config option for storage to use second flash segment (disable by default) - add I2S support to make-pins.py - add qstr definition for ifconfig when building for WizNet - move HAL Cube files to f4/ subdir, keeping only those we use - add STM32CubeF2 version 1.1.0, in hal/f2 directory - add CMSIS device header files for STM32F2xx series - allow DAC.write_timed to take Timer object in place of freq - allow ADC.read_timed to take Timer object in place of freq - check if user block device is mounted before accessing it - put fs_user_mount pointer in root ptr section of global state (fixes crash) - add hal and cmsis files from STM32Cube_FW_F7_V1.1.0 - add STM32F7DISC support - factor out USRSW boot-up code and support boards with 1 LED - factor GPIO clock enable logic into mp_hal_gpio_clock_enable - add capability to print out info about a hard fault (disabled by default) - fix make-pins.py to allow Port K - add better support for UART having Tx and Rx on different ports - add support for USART1 and conditional pins in make-pins.py - add STM32F7 support for USB serial and storage - enable I2C support for F7 MCUs - enable SPI support for F7 MCUs - fix hardfault when configured as a SPI slave - generate modstm constants per build cc3200 port: - in Timer.callback() only use value param if in edge count mode - create tools folder and add update-wipy.py script - add deploy target and improve robustness of update-wipy.py - enable more features to improve compatibility with stmhal - add `Pin.name()` method - adapt update-wipy.py timing to improve stability - correct socket settimeout time format - add CA, certificate and key files to the updater list - add socket.timeout and socket.error exceptions - raise an exception if trying to scan for networks in AP mode - optimize check for WLAN AP mode - set WLAN date/time via the rtc.datetime method() - add modussl, ssl sockets subclassed from normal sockets - time.sleep() now receives seconds, like CPython - fix socket recv and recvfrom return value type - enable base64 methods from modubinascii - increment interrupt stack size from 2K to 3K - create /flash/sys and /flash/lib directories while booting - translate simplelink's socket error numbers to POSIX values - use alternative HAL_Delay also when interrupts are disabled - correct udelay us to ticks calculation - increment telnet Tx retry delay on every try - add struct weak link for ustruct - set simplelink time and date when enabling WLAN - refactor and clean-up socket closing code - implement new OTA mechanism with 2 firmware update slots - create /flash/cert folder if it doesn't exist - make socket stream methods return POSIX error codes - add socket.sendall() (aliases to send()) - rename pins from GPIO to just GP - add socket.makefile() - switch to 1 byte hash for QSTRs - on ssl.read() or ssl.readall() ignore ssl layer closed error - append last 2 bytes of the MAC address to the default SSID - make I2C and SPI API the same as in stmhal - add nic.iwconfig() to set/get WLAN configuration - improve support for WEP security - enable bootloader safe boot on latest firmware - fix bug in ffconf regarding '/flash' string length - add script to program the WiPy via UniFlash (windows only...) - add factory smoke test as part of the tools - speed up file system checking during start-up - on the first boot, always make AP ssid='wipy-wlan' - make ADC API compatible with the pyboard esp8266 port: - move scan() from esp module to network - update the README.md to reflect what works - move status() from esp module to network - make pyb.RTC a type, and pyb.RTC() constructs an RTC object - allow to easily override programming baudrate docs: - add more documentation for the CC3200 in the pyb module - add "reference" directory for putting docs about the language - add reference for Thumb2 inline assembler - make index link point to "index.html" irrespective of port - fix duplicate label error for network.WLAN - update safe boot comments to match actual behaviour - update pyb.Accel doc to reflect changes and explain filtered_xyz - correct nic.ifconfig() quickref example - add i2c keywork arguments only indication ======== Mon, 15 Jun 2015 23:54:22 +0100 v1.4.4 Unix binary gets tab completion and builtin upip, and more. py core: - allow to compile without needing git to extract version - conform to CPython's way of printing nan/inf with padding - wrap qstr defs in quotes to protect from C preprocessor - add stack check to mp_iternext to catch nested iterators - implement implicit cast to obj for viper load/store index/value - implement native multiply operation in viper emitter - expose KeyboardInterrupt in builtins module - fallback to stack alloca for Python-stack if heap alloc fails - support unicode (utf-8 encoded) identifiers in Python source - implement second arg for math.log (optional value for base) - support mpz bignums in divmod builtin extmod: - add ubinascii.unhexlify - swap address and descriptor args in uctypes constructor lib: - fix some issues with dates prior to 1 Mar 2000 - implemente delete key in readline tools: - pyboard.py: allow pyboard constructor to take a baudrate parameter - pyboard.py: change logic for when raw ">" prompt is parsed - add codestats.sh to compute code statistics such as size, speed unix port: - add option to use uPy readline and enable by default (adds tab completion) - include upip as frozen module within standard uPy executable; standard way to use is: micropython -m upip install - allow to cat a script into stdin from the command line - make micropython -m work for frozen modules windows port: - implement mp_hal_xxx functions and enable uPy readline stmhal port: - raise error if disk is full when writing a file - implement sys.stdin.buffer, sys.stdout.buffer for raw byte mode - remove all PYBVxx defines and use general config vars instead - add support for UART5 if MCU has it - fix slow SPI DMA transfers by removing wfi from DMA wait loop - break immediately from USB CDC busy wait loop if IRQs disabled - make I2C transfers use DMA when possible (when IRQs are enabled) cc3200 port: - add os.rename() - add Timer module - add uhashlib with SHA1 and SHA256 - add ubinascii module - implement full set of wake-on-WLAN features - remove NIC abstraction layer - improve WDT - make peripheral API more similar to stmhal's - improve reliability of ftp and telnet servers - add antenna selection feature to WLAN - add sendbreak method to UART esp8266 port: - add uos module - allow to set CPU frequency to 160MHz using pyb.freq - add pyb.ADC class - to esp module add: mac, phy_mode, sleep_type, deepsleep, flash_id - update SDK to version 1.1.0 (MIT licensed) - fix lost chars when transfering large amounts of data over UART - add skeleton "network" module with bare WLAN() constructor - add WLAN.connect/disconnect functions - change esp_scan to keep the current WiFi operating mode docs: - document esp module - allow to generate separate docs for each port (using ..only directive) - add initial docs for the WiPy ======== Sat, 16 May 2015 21:26:43 +0100 v1.4.3 Tab autocompletion, and various improvements and bug fixes. py core: - add attrtuple for space efficient tuples with attr access - add sys.implementation, with uPy name and version number - fix printing of "inf" and "nan" values - native: fix stack adjustment when erroring on binary op - mpz: fix bug with shl not truncating zero digits correctly - modify "with" implementation so it doesn't use any heap - add sys.exc_info() - implement conversion of bignum to bytes - implement struct.pack with 'q' and 'Q' args on 32-bit archs - replace py-version.sh with makeversiohdr.py, written in Python - implement tab autocompletion for REPL - rename struct module to ustruct - add NotImplemented builtin constant - handle user instance hash based on Python adhoc rules - fix naming of function arguments when function is a closure - fix printing of complex numbers with nan/inf extmod: - add machine module, with mem8, mem16, mem32 objects lib: - move common mod_network_* functions to lib/netutils - move common time functions to lib/timeutils tools: - pyboard.py: add "--follow" option to wait for output indefinitely - add script to install "upip" package manager tests: - add more viper tests, including for ViperTypeError - coverage at 94% unix port: - modffi: support passing float/double args - add special function to coverage build to improve coverage - print unhandled exceptions to stderr stmhal port: - implement os.uname() - reset timer counter to zero after changing auto reload - properly disable unhandled timer interrupts - automatically reenable IRQs when code drops to the USB REPL - allow to configure UART pins completely via mpconfigboard.h - make raw REPL work with event-driven version of pyexec - add rtc.calibration() method to get/set RTC fine-tuning value - add os.rename() - add readinto() and readlines() methods to sys.stdin and pyb.USB_VCP cc3200 port: - add WiPy specific info to README.md - fix byte order in MAKE_SOCKADDR and UNPACK_SOCKADDR - select NIC when the socket is created - add delays to allow ftp and telnet servers to start/stop - make telnet login work with Tera Term - implement os.uname() - make WLAN scan results a list of attrtuples - make WLAN.isconnected() also work in AP mode - implement Sleep.wake_reason() - make WLAN.ifconfig() return an attrtuple - enable MICROPY_MODULE_WEAK_LINKS esp8266 port: - export station status() constants - add esp.socket class, with ESP-style socket functionality - add raw REPL support and working soft reset - fix garbage collector by hard-coding stack end address - add socket.onsent() callback support - add support for frozen modules - implement time functions - add utime and pyb.RTC - add module weak links docs: - document pyb.stop, pyb.standby, pyb.RTC.wakeup - document USB_VCP read* and write methods ======== Tue, 21 Apr 2015 12:51:14 +0000 v1.4.2 Improved native codegen, better printf, support for F401 and F411 MCUs. py core: - implement delete for property and descriptors - add option to disable "enumerate" and "reversed" builtins - can call functions with *args in native emitter - implement full function arg passing for native emitter - combine load_attr and store_attr internal type methods into one - fix formatting of floating point numbers near 1.0 - support assignment of bytes to bytearray slices - overhaul and simplify printf/pfenv mechanism - fix builtin ord so that it can handle bytes values >= 0x80 - inlinethumb: add support for core floating point instructions - make viper code generator raise ViperTypeError on error lib: - string0.c now in lib/libc/ (was in stmhal/) - fatfs code size reduced (by 768 bytes on Thumb2 archs) tests: - more tests for builtins - tests for lexer - coverage increased to 93% stmhal: - make LED object print LED(x) for consistency with constructor - in USB HID driver, make polling interval configurable - allow sending CAN messages with timeout=0 - add support for sending and receiving CAN RTR messages - make board parameters more configurable (HSE PLL, LED4, TIMs, etc) - add support for F401 and F411 MCUs - add support for Espruino Pico board - make raw REPL mode 8-bit clean cc3200 port: - enable pull-ups for stdio UART pins - enable long filename support in fatfs - add WLAN.config_ip(), to assign a static IP - add IPPROTO_SEC so secure sockets can be made tools: - make pyboard.py 8-bit clean, so it works with unicode chars docs: - document pyb.main() function ======== Sat, 4 Apr 2015 17:41:11 +0100 v1.4.1 Stackless support, new 16-bit PIC port. py core: - builtin round() accepts second arg - add more special methods: __pos__, __neg__, __invert__ - support for stackless Python calls in VM, strict and non-strict - support for object representation that suits 16-bit archs - implement closures in native code emitter - implement str.splitlines() method lib: - fatfs library upgraded to R0.11 (fixes bugs with unlink) pic16bit port: - new port to 16-bit PIC (reference MCU is dsPIC33J256GP506) - heap is 4600 bytes - implement basic pyb module with delay - implement basic LED and Switch classes docs: - initial docs for micropython module - additional example for Timer callback usage - document instantiating struct objects in uctypes ======== Sun, 29 Mar 2015 18:01:19 +0100 v1.4 More Python features, reduced code size, coverage testing at 91%. py core: - add builtin setattr function - optimise exceptions for out-of-memory scenario - add some special methods: __mul__, __floordiv__, __truediv__ - implement array slice assignment - add support for start/stop/step attrs in range object - make builtin abs work with bools and bignums - add basic implementation of collections.OrderedDict - add support for a function's __name__ - refactor compiler code to reduce code size by up to 2k - support for descriptors __get__ and __set__ inline Thumb2 assembler: - more robust syntax checking - general bug fixes - better error messages - add "it" instructions - add bl, bx instructions - add bcc_n, bcc_w instructions extmod: - modure: bug fixes for groups - modure: add named classes lib: - libm: add erf, erfc, lgamma, tgamma drivers: - add onewire driver in pure Python - add ds18x20 temp sensor driver, using onewire - cc3100 driver upgraded to v1.1.0 tests: - lots of new tests, including many for SyntaxError - automated covage testing using coveralls, at 91% coverage unix port: - support for readline history saving to file stmhal port: - usbdev code cleanup - add Python-configurable USB HID mode - add CDC only USB option - improve USB descriptors (untested on Windows and Mac) - add UART.sendbreak() method to send break condition - add support for CAN rx callbacks - raise error if UART can't do requested baudrate within 5% - fix timing init when callback is passed as argument to init - add support for quadrature encoder mode in TimerChannel - fix ADC.read_timed so buffer store respects element size - add RTC.wakeup method to set wakeup timer (preliminary) - add compile-time config option for RTC to use LSE or LSI - bug fix related to unhandled channel interrupts - improved support for stop and standby mode - expose all PYBv1.0 pins, including SD and USB pins - optimise ADC.read_timed so it can sample at up to 750kHz - make pybstdio code usable by other ports cc3200 port: - add I2C module - add ADC module - add SD module - support for connecting to WEP secured networks - add WDT support - add low power support - add SPi module esp8266 port: - add basic pyb.Pin class miscellaneous: - add list of Kickstarter backers in ACKNOWLEDGEMENTS file size difference in bytes to previous version (a negative value means binary is smaller in this version): - bare-arm: -2448 - minimal: -3028 - unix: +574 - stmhal: +7996 - cc3200: -2984 - teensy: -10560 - esp8266: -936 - qemu-arm: -844 ======== Fri, 13 Feb 2015 13:26:44 +0000 v1.3.10 Bug fixes, CC3200 port, improved inline assembler py core: - big-int bug fixes - support for floats in struct module - vstr no longer null-terminates buff by default - properly handle CR/LF in triple-quoted string - list.sort now has O(log(N)) stack usage - parse big-int/float constants directly in parser - allow to subclass native buffer objects - reduce stack size of VM by 8 bytes on stmhal, 16 on x86 - add ldrex, strex, push, pop, sdiv, udiv, clz, rbit to inline assembler - make inline assembler report line numbers on error extmod: - uzlib: raw deflate decoding support unix port: - add "coverage" makefile target for coverage testing stmhal port: - bug fixes in ADCAll object - bug fix in timer.deinit esp8266 port: - add esp module - add connect, disconnect, status functions cc3200 port: - new port to the CC3200 launchxl board ======== Sun, 25 Jan 2015 00:10:07 +0000 v1.3.9 Internal changes, RAM and ROM reductions, new minimal port py core: - lots of small optimisations, cleanups and code size reduction - move away from Plan 9 headers to traditional guarded ones - improved and optimised float to int conversion - fix right-shifting edge cases in mpz - namedtuple: use sequence of strings for init - namedtuple: allow keyword arguments in constructor - ability to issue compile/runtime warnings - str.format now has kwargs support - put all global state togther in a state structure - optimisation to cache map lookup results in bytecode - fix handling of "0" in some mpz functions - implement equality check for all types - add qstr cfg capability - can now configure qstr len storage; defaults to using 1 byte - allow code to compile with lots more warnings enabled - add LOAD_CONST_OBJ bytecode, to directly load Python objects - never intern data of large str/bytes objects - fix handling of default except in compiler - add extra pass to bytecode compiler to compute stack size - implement very simple frozen modules support - implement __reversed__ slot - implement proper re-raising in native codegen's finally handler lib: - move readline code from stmhal to lib/mp-readline/ - readline refactored to support event-driven usage - add frexp and modf to libm minimal port: - new port, intended to represent minimal working code stmhal port: - collect root pointers together; improves GC speed - add MICROPY_HW_USB_VBUS_DETECT_PIN option - add MICROPY_HW_USB_OTG_ID_PIN option - add support for FEZ Cerb40 II board - bug fixes in network module and usocket.accept, setsockopt qemu-arm port: - enable GC and native code-gen - add working tests - get tests running under Travis CI esp8266 port: - use dedicated heap allocated as static array - implement task-based, event-driven interface with UART - implement pyb.hard_reset() ======== Mon, 29 Dec 2014 00:51:24 +0200 v1.3.8 Feature additions to core, unix and stmhal; general improvements. py core: - implement +, +=, .extend for bytarray and array objs - add mem_info, qstr_info to micropython module - bytes/bytearray/array can be init'd by buffer protocol objs - optimised lexer by exposing lexer type; gives ROM savings - add sys.print_exception - allow builtins to be overridden - fixed all semantic issues with range optimisation - compiler gives proper SyntaxError exceptions for bad global/nonlocal - reduce VM exception stack size by 1 machine word per exception - make bytes objs work with more str methods - refactor and make mp_bytecode_print and friends more useful - start transition to guarded includes - lots of code cleanup - some ROM savings extmod: - add ubinascii module, with hexlify unix port: - add _os.unlink, _os.system functions - 64-bit clean in ffi module - time module renamed to utime stmhal port: - add USB_VCP.setinterrupt method, to disable CTRL-C - make pyb.[u]delay work when irqs are disabled - overhaul of internal network driver interface - bug fixes to CC3K and WIZNET5K network drivers - use DMA for SPI transfers (only if irqs enabled) - allow SPI.init to specify prescaler directly - enhance pyb.freq to configure bus frequencies - add more math functions (acosh, asinh, atanh, tan) - add execfile function - upgrade to latest FatFs driver (now in lib/) - add ability to mount custom block device esp8266 port: - put more rodata in irom section - add README.md docs: - basic docs for uhashlib, ubinascii, ure, uzlib - links to LCD and AMP skin schematics - general improvements ======== Fri, 28 Nov 2014 17:48:48 +0000 v1.3.7 Port to ESP8266, add uhashlib, improved CAN driver. py core: - support more ops for bytes/bytarray - support __hash__ for user-defined types - support for float/double arrays in array module - shorter error messages for TERSE message option - add seek via ioctl to stream protocol extmod: - add uhashlib with sha256 unix port: - heapsize can take w specifier for word adjustment stmhal port: - CAN init now takes sjw, bs1, bs2 args - add CAN filter management - fix HAL error raising bug esp8266 port: - new port to ESP8266 wifi chip docs: - minor additions ======== Tue, 4 Nov 2014 19:04:12 +0000 v1.3.6 Improved documentation, and other small changes. py core: - add builtin round function - gc.enable/disable still allows manual GC (as per CPython) - fix builtin callable for user-defined types - fix bug for right shift of small int by large amount unix port: - add "fast" version - improve uctypes, including sizeof function stmhal port: - support for extended CAN frames - USB_VCP works with select - experimental support for RTS/CTS in UART - make UART bits count number of data bits, not incl parity - pyb.freq now allows 8MHz and 16MHz docs: - revamp and merge all inline docs into Sphinx framework - add a few more tutorials ======== Sun, 26 Oct 2014 22:58:18 +0000 v1.3.5 RAM savings, memoryview, quick-ref and more. Improvements to core: - make better use of bytecode coding space - about 10% RAM savings in bytecode - add uheapq module - add memoryview builtin - add compile builtin - support in VM for KeyboardInterrupt - fix integer modulo with negative arguments - small GC fixes - add 2nd arg to readinto New features in unix port: - CTRL-C raises KeyboardInterrupt - heapsize option takes K and M - -m option to execute library module stmhal improvements: - make MMA_INT/PB2 pin available - add pyb.hard_reset() - cc3k recv improments - all HAL errors now raise OSError with POSIX error code - USB config improved for windows (CDC on Windows 10 without driver) - use different USB PID when in CDC+HID mode (so HID works in Windows) - boot.py and main.py use \r\n for newlines - change SPI phase from 1,2 to 0,1 to match industry conventions - allow DAC object to be init'd from pin - improved raw REPL control codes - improved pyboard.py script docs: - add quick reference page with pinout ======== Tue, 21 Oct 2014 22:15:20 +0100 v1.3.4 Add regex and CAN, improve UART, and more. py core: - add basic regex support using re1.5 library - replace zlibd with uzlib - compiler returns proper exception on SyntaxError - proper context saving for eval/exec - use mp_[u]int_t in most places instead of [u]int - better ARM support in native emitter - autodetect machine endianness - better big endian support - memory errors from locked gc can be reported - more robust lexer when out of memory - rename modules to begin with u-, and add module weak links - more native binops in viper emitter - native pointers with load+store in viper - fix GC realloc so that chunks are shrunk correctly - compiler optimisations for constant if/while conds - add kwargs for builtin open() and FileIO - enable unicode on windows stmhal port: - add basic CAN bus support - overhaul UART class to use read/write - add NRF24L01 driver (in pure Python) - pyb.freq can change SYSCLK - add pyb.stop and pyb.standby - can set Timer freq using float - Timer supports complementary channel and deadtime - add retry for SD card init ======== Thu, 2 Oct 2014 14:51:17 +0100 v1.3.3 Network support in stmhal, and improved viper compiler. Changes in core: - tidy up native emitter and assemblers - viper can compiler more binary ops - viper supports casting (int, ptr8, ptr16) - viper can compile native stores (eg p[1] = 42) - remove IOError (use OSError instead) stmhal port: - fix OSX mass storage issue, so pyboard can be left plugged in - add network and usocket modules with CC3000 and WIZnet5k support (disabled by default) - improved percent option in timer PWM - add pyb.elapsed_millis, pyb.elapsed_micros - internal flash is labelled as "pybflash" on creation - don't init NSS pin when initialising SPI bus with NSS_SOFT mode ======== Thu, 25 Sep 2014 19:42:27 +0100 v1.3.2 Changes in core: - bytecode prelude uses less RAM - free non-interned strings earlier - add builtins module - add ujson module with dumps and loads - mpz div changed so that mpz is more efficient - some compiler optimisations - some simplifications of the code - bug fix memcpy -> memmove - changed most instances of int/uint to mp_int_t/mp_uint_t - added ioctl method to stream protocol - divmod, % and // support for floating-point numbers Native emitter enhancements: - bug fixes - support for delete name and global - support for end finally - x86 support - x86-64 can use extended regs unix port: - MIPS compilation support stmhal port: - add generic select module - ability to select/poll on UART objects - proper SDHC support (cards > 4gb now work) - enhanced timer support (PWM, OC, IC) - big fix with miss-aligned stack pointer - more math functions implemented Added drivers subdirectory with WIZNet5200 support (disabled by default). Added docs subdirectory and moved to Sphinx docs. Improved teensy support. ======== Thu, 28 Aug 2014 23:37:02 +0100 v1.3.1 Bug fixes, viper improvements, and more New features in core: - min and max accept key= argument - accepts user defined ==, >, <=, >= - native support for ARM (non thumb) - cut RAM and ROM usage of zlibd - significant GC allocation speed up Viper improvements: - type annotations - store to global - call functions with native types - raise exceptions Bug fixes to core: - fix multiplication of a sequence by negative number - GC bug fix where native code was being collected - int(b'1234') now works - can now make strings longer than 64k unix port: - modtermios for unix - make install for unix stmhal port: - reduced code size by 35k - put some code into first 16k block - in safe mode SD card is still presented as MSD - SD card init fixes; should be more reliable - added time.mktime; enhanced time.localtime - new Pin functions: mode, pull, af - nestable enable_irq/disable_irq - added pyb.micros() - added USB_VCP.any() - STM32F4DISC accel support via staccel.py script ======== Tue, 12 Aug 2014 23:24:29 +0100 v1.3 v1.3: New features and many bug fixes. New features include: - file.flush, os.stat - unicode enabled by default on unix and stmhal ports - print function accepts file= argument - I2C object allows for 16-bit mem addr - emergency exception buffer for improved exception traceback - USB_VCP object - 0:/ and 1:/ changed to /flash and /sd - improved Pin object - can set pin alternate function from Python - builtin reversed, can len() and subscr range objects - added moductypes - added modzlibd for DEFLATE decompression Code improvements include: - more efficient line-number to bytecode mapping - new STM HAL driver v1.3.0 Bug fixes include: - mpz (bignum) fixes - accel startup improved - important bug fix in GC ======== Sun, 13 Jul 2014 23:34:35 +0300 v1.2 v1.2: Unicode support (disabled by default); bug fixes and minor features added. ======== Sun, 15 Jun 2014 09:47:27 +0100 v1.1.1 v1.1.1: Improved LCD driver, UART REPL and some bug fixes. Bumping version because this binary will be put on the next batch of pyboards. ======== Thu, 12 Jun 2014 19:50:17 +0100 v1.1 v1.1: Many bug fixes, enhancements and features. ======== Sun, 11 May 2014 22:50:27 +0300 v1.0.1 v1.0.1: mostly bug fixes for stmhal/, features for py/. Main bug fixes: flushing USB CDC correctly, setting RTC. Main features for stmhal: improved native and viper emitters. This version goes on the next batch of pyboards. ======== Sat, 3 May 2014 19:08:02 +0100 v1.0 Version 1.0! This is shipping with the next batch of pyboards.