23 Star 47 Fork 2

Gitee 极速下载/micropython

标签名
描述
提交信息
操作

ROMFS, alif port, RISCV inline assembler, DTLS, mpremote recursive remove

After more than three years in development, the "ROMFS" feature has been
finalised, its filesystem format specified, and the VFS driver and
supporting code are included in this release of MicroPython. This feature
builds on bytecode version 6 (available for many years now), which supports
executing bytecode in-place, that is, without the need to copy it to RAM.
ROMFS defines a read-only, memory-mappable, extensible filesystem that can
contain arbitrary resources, including precompiled mpy files, and allows
executing bytecode directly from the filesystem. This makes importing
significantly faster and use a lot less memory. Also, data resources such
as fonts can be used in-place on a ROMFS without loading into RAM.

ROMFS is currently enabled only on selected boards: PYBD-SFx, all alif-port
boards, a new ESP8266_GENERIC variant called FLASH_2M_ROMFS, and all stm32
Arduino boards. Other boards will have ROMFS enabled in the future, or it
can be manually enabled on user-defined boards.

To build and deploy a ROMFS, mpremote has a new mpremote romfs command,
with "query", "build", and "deploy" sub-commands, which can build and
deploy a directory structure to a ROMFS partition on a target device.
These initial ROMFS features will be extended in the future, but for now
they provide a way to try out this long-anticipated feature.

This release also introduces a brand new "alif" port supporting Alif
Ensemble MCUs. These MCUs offer multiple ARM cores, including Ethos-U55
machine-learning processors, and a comprehensive set of peripherals.
Current features of the MicroPython alif port include USB support via
TinyUSB, dual-core support using OpenAMP, octal SPI flash with XIP, the
machine classes Pin, UART, SPI and I2C, and cyw43 WiFi and BLE support.
Two alif board definitions are currently available: ALIF_ENSEMBLE for the
official Alif Ensemble E7 DevKit, and OPENMV_AE3 for OpenMV's upcoming
AE3-based camera board.

MicroPython's inline assembler now supports 32-bit RISC-V assembly code via
the newly implemented @micropython.asm_rv32 decorator. This allows
writing small snippets of RISC-V machine code that can be called directly
from Python code. It is enabled on the rp2 port when the RP2350 is running
in RISC-V mode.

Datagram TLS (DTLS) is now supported by the tls module and enabled on the
alif, mimxrt, renesas-ra, rp2, stm32 and unix ports. An SSLContext can
be created in DTLS mode using tls.PROTOCOL_DTLS_CLIENT or
tls.PROTOCOL_DTLS_SERVER as the mode option, and this context can then be
used to wrap a normal UDP socket to get a secure UDP connection.

The mpremote command-line tool now supports recursive remove via the new
rm -r option; for example, mpremote rm -rv : can be used to remove all
files and directories in the current working directory of the target
device. mpremote also now supports relative URLs in the package.json
file, installing from the local filesystem, and has optimised readline
support in mpremote mount.

Improvements to the core interpreter include: full support for tuples and
start/end arguments in the str.startswith() and str.endswith() methods;
enabling of the two-argument version of the built-in next() function on
most of the ports; a new sys.implementation._build entry which holds the
build name of the target; and vfs.mount() with no arguments now returns a
list of mounted filesystems.

The marshal module has been added with dumps() and loads() functions,
which currently support code objects and, in combination with
function.__code__, allow converting functions to/from a bytes object.
This module is not enabled by default but can be used in custom build
configurations.

The MicroPython native linker mpy_ld.py now includes support for linking
in static libraries automatically. This allows the native-module build
scripts to look for required symbols from libraries such as libgcc and
libm that are provided by the compiler. This now makes it possible to
use standard C functions like exp() in native modules. Also, native
modules now support 32-bit RISC-V code.

The esp32 port now supports IDF v5.3 and v5.4, and support for versions
below v5.2.0 has been dropped. Dynamic USB device support is now enabled
on ESP32-S2 and ESP32-S3 MCUs, allowing configuration of the USB device at
runtime. I2S has been enabled on all ESP32-C3 boards, the Pin.toggle()
method has been added, and the I2C bus identifier is now an optional
argument (by default, bus 0 is used). Additionally, memory management has
been improved for the allocation of TLS sockets to attempt to automatically
free any existing unused TLS memory when needed.

The mimxrt port now enables exFAT filesystem support and the PPP driver for
boards with lwIP networking, and has support for a UF2 bootloader, making
it easier to deploy firmware. The machine.RTC.now() method has been
dropped (use datetime() instead), ADC.read_uv() has been added, and
machine.I2C has support for the timeout keyword argument. The I2C, SPI
and UART classes now support default buses, so the first argument to these
constructors is no longer needed if the default bus is used. Some
inconsistencies with PWM output have been fixed, along with an allocation
bug for the UART RX and TX buffers.

The rp2 port sees the introduction of many new RP2350 boards, including the
Pico 2 W, as well as support for PSRAM with size autodetection. The PIO
interface now supports side_pindir selection, and SPI allows the MISO pin
to be unspecified. Both the I2C and SPI classes now have the bus
identifier as an optional argument with a default based on the board
configuration. WPA3 is now supported on the Pico W and Pico 2 W in both AP
and STA modes. Lost WiFi events due to code executing on the second core
have now been fixed, mDNS has been fixed, and rp2.bootsel_button() and
USB sleep now work on RP2350. ROMFS support has been added but is not
enabled on any board by default; see commit
50a7362b3eff211a5051eeaecc88bdde045c90d1 for information on how to enable
it manually.

The samd port has added full support for 9-bit data in the UART peripheral
and supports default buses and pins for I2C, SPI and UART. DAC for two
channels has been fixed on SAMD51, and UART buffering has had a few bug
fixes.

The stm32 port now deinitialises I2C and SPI buses on soft-reset, which may
be a breaking change for certain applications; be sure to always initialise
I2C and SPI instances when creating them. The CAN code has been
refactored, and a few minor bugs have been fixed there. Corrupt littlefs
filesystems are now handled properly at startup: instead of a failed mount
leading to a hard fault, the code attempts to mount again with default
block device parameters, and if that also fails, it prints a message and
continues the boot process. ROMFS is enabled on PYBD-SFx boards and all
Arduino boards and can be enabled on other boards by manual configuration;
see commit bea7645b2e55881c4f42e6cfbe2a6433c5986794 for details. The
PYBD-SF6 firmware now supports both original boards and new boards with
larger SPI flash. WPA3 is now supported on boards using the cyw43-driver.
mboot now includes a version string which is placed at the very end of the
flash section allocated for this bootloader (usually 32k); this version can
be retrieved using the fwupdate.get_mboot_version() function.

The zephyr port has had machine.Timer and machine.WDT implemented.

New boards added in this release are: ALIF_ENSEMBLE and OPENMV_AE3 (alif
port), MAKERDIARY_RT1011_NANO_KIT (mimxrt port), MACHDYNE_WERKZEUG,
RPI_PICO2_W, SEEED_XIAO_RP2350, SPARKFUN_IOTNODE_LORAWAN_RP2350,
SPARKFUN_IOTREDBOARD_RP2350, SPARKFUN_PROMICRO_RP2350,
SPARKFUN_THINGPLUS_RP2350, SPARKFUN_XRP_CONTROLLER,
SPARKFUN_XRP_CONTROLLER_BETA and WEACTSTUDIO_RP2350B_CORE (rp2 port),
ADAFRUIT_NEOKEY_TRINKEY, ADAFRUIT_QTPY_SAMD21, SAMD_GENERIC_D21X18,
SAMD_GENERIC_D51X19 and SAMD_GENERIC_D51X2 (samd port),
WEACT_F411_BLACKPILL (stm32 port).

The change in code size since the previous release for select builds of
various ports is (absolute and percentage change in the text section):

   bare-arm:     +4  +0.007%
minimal x86:    -90  -0.049%
   unix x64: +16941  +2.046%
      stm32:    -96  -0.025%
     cc3200:   +280  +0.152%
    esp8266:   +964  +0.138%
      esp32: +10956  +0.654%
     mimxrt:  +7508  +2.065%
 renesas-ra:   -160  -0.026%
        nrf:   +168  +0.090%
        rp2:  +7944  +0.872%
       samd:  +1112  +0.418%

The leading causes of these changes in code size are:

  • minimal, stm32, renesas-ra: various small code-size optimisations
  • unix: enable VfsRom, update mbedTLS to v3.6.2, enable DTLS
  • cc3200: implement Pin.toggle() method
  • esp8266: enable function attributes, implement Pin.toggle(), allow
    enumerating connected stations in AP mode, update requests package
  • esp32: lots of small fixes and improvements
  • mimxrt: enable exFAT, add function.__code__ and function constructor
  • nrf: various small features such as sys.implementation._build,
    two-argument built-in next(), no-argument vfs.mount()
  • rp2: update mbedTLS to v3.6.2, enable DTLS, update cyw43-driver to 1.1.0
  • samd: support UART 9-bit data, add function.__code__ and function
    constructor, provide default IDs for UART, I2C and SPI

Performance of the VM and runtime is effectively unchanged since the
previous release.

Thanks to everyone who contributed to this release: Alessandro Gatti, Alex
Brudner, Amirreza Hamzavi, Andrew Leech, Angus Gratton, Anson Mansfield,
Carl Pottle, Christian Clauss, chuangjinglu, Corran Webster, Damien George,
danicampora, Daniël van de Giessen, Dryw Wade, eggfly, Garry W, garywill,
Glenn Moloney, Glenn Strauss, Graeme Winter, Hans Maerki, Herwin Grobben,
I. Tomita, iabdalkader, IhorNehrutsa, Jan Klusáček, Jan Sturm, Jared
Hancock, Jeff Epler, Jon Nordby, Jos Verlinde, Karl Palsson, Keenan
Johnson, Kwabena W. Agyeman, Lesords, machdyne, Malcolm McKellips, Mark
Seminatore, Markus Gyger, Matt Trentini, Mike Bell, Neil Ludban, Peter
Harper, peterhinch, Phil Howard, robert-hh, Ronald Weber, rufusclark,
Sebastian Romero, Steve Holden, stijn, StrayCat, Thomas Watson, Victor
Rajewski, Volodymyr Shymanskyy, Yoctopuce.

MicroPython is a global Open Source project, and contributions were made
from the following timezones: -0800, -0700, -0600, -0500, -0400, +0000,
+0100, +0200, +0300, +0330, +0700, +0800, +1000, +1100, +1300.

The work done in this release was funded in part through GitHub Sponsors,
and in part by George Robotics, Espressif, Arduino, LEGO Education, OpenMV
and Planet Innovation.

What follows is a detailed list of changes, generated from the git commit
history, and organised into sections.

Main components

py core:

  • objdeque: fix buffer overflow in deque_subscr
  • py.mk: add check that any specified USER_C_MODULES folder exists
  • usermod.cmake: add check that any specified USER_C_MODULES exists
  • usermod.cmake: if USER_C_MODULES is a folder add micropython.cmake
  • objfloat: workaround non-constant NAN definition on Windows MSVC
  • misc: fix msvc and C++ compatibility
  • emitglue: fix clear cache builtin warning on Clang for AArch32
  • mkrules.mk: use partial clone for submodules if available
  • dynruntime.mk: delete compiled module file on clean
  • qstr: add qstr_from_strn_static() helper function
  • reader: provide mp_reader_try_read_rom() function
  • persistentcode: add support for loading .mpy files from a ROM reader
  • misc: add a popcount(uint32_t) implementation
  • emitinlinerv32: add inline assembler support for RV32
  • obj: cast float literals to 64-bit to prevent overflow warning
  • obj: make literals unsigned in float get/new functions
  • asmarm: fix asm_arm_ldrh_reg_reg_offset to emit correct machine code
  • asmarm: allow function state to be larger than 255
  • asmarm: fix locals address loading code generation with large imm
  • asmarm: fix halfword loads with larger offsets
  • mkrules.mk: move comment about partial clones outside make rule
  • persistentcode: initialize prelude_ptr to prevent compiler warning
  • parsenum: throw an exception for invalid int literals like "01"
  • emitnative: optimise Viper register offset load/stores on Xtensa
  • emitnative: emit shorter exception handler entry code on RV32
  • emitnative: optimise Viper immediate offset load/stores on Xtensa
  • mkrules: add GIT_SUBMODULES_FAIL_IF_EMPTY flag for CMake ports
  • parsenumbase: favor clarity of code over manual optimisation
  • gc: split out running finalizers to a separate pass
  • gc: allow gc_free from inside a gc_sweep finalizer
  • add optional support for recursive mutexes, use for gc mutex
  • gc: reorder static functions for clarity
  • mkrules.mk: reset USER_C_MODULES when building mpy-cross dependency
  • emitnative: mark condition code tables as const
  • emitnative: load and store words just once for Viper code
  • objcode: factor code object out into its own file
  • objfun: implement function.code and function constructor
  • persistentcode: add mp_raw_code_save_fun_to_bytes
  • mkrules.cmake: support passing CFLAGS_EXTRA in environment variable
  • emitinlinerv32: fix compilation with ESP-IDF v5.2 and later
  • emitinlinerv32: reduce the footprint of compiled code
  • emitinlinextensa: simplify register name lookup
  • parsenum: reduce code footprint of mp_parse_num_float
  • objstr: support tuples and start/end args in startswith and endswith
  • modsys: add sys.implementation._build entry
  • makeqstrdata.py: implement MicroPython compatibility
  • objarray: add MP_DEFINE_MEMORYVIEW_OBJ convenience macro
  • runtime: automatically mount ROMFS as part of mp_init
  • mpconfig: enable 2-argument built-in next() at basic feature level
  • dynruntime: make malloc functions raise MemoryError on failure
  • emitinlinerv32: move include of asmrv32.h to within feature guard

extmod:

  • modlwip: fix IGMP address type when IPv6 is enabled
  • nimble: remove asserts of ediv_rand_present and adjust comments
  • modlwip: don't allow writing to a TCP socket that is connecting
  • network_ppp: add stream config parameter
  • network_ppp: allow stream=None to suspend PPP
  • vfs_blockdev: support bool return from Python read/write blocks
  • network_cyw43: fix isconnected() result on AP interface
  • network_cyw43: fix uninitialised variable in status('stations')
  • network_cyw43: allow configuring active AP interface
  • modframebuf: fix 0 radius bug in FrameBuffer.ellipse
  • modplatform: distinguish AArch64 from AArch32
  • modplatform: add Clang to the known compilers list
  • modplatform: add Android to the recognised platforms list
  • extmod.mk: fix libmetal build prefix
  • modplatform: distinguish RISC-V 64 from RISC-V 32
  • moductypes: fix large return values of addressof and INT_MAYBE
  • vfs: guard mutating fs functions with MICROPY_VFS_WRITABLE
  • vfs_rom: add VfsRom filesystem object
  • vfs_reader: add support for opening a memory-mappable file
  • modsocket: add missing static in private function definitions
  • moddeflate: add missing size_t cast
  • modlwip: fix incorrect peer address for IPv6
  • lwip-include: factor common lwIP config into lwipopts_common.h
  • mbedtls: try GC before failing to setup socket on esp32, unix
  • modmarshal: add new marshal module
  • vfs_rom: remove ability to create VfsRom from an address
  • lwip-include: increase number of lwIP timers when mDNS enabled
  • modtls_mbedtls: wire in support for DTLS
  • vfs_rom: add bounds checking for all filesystem accesses
  • modvfs: add vfs.rom_ioctl function and its ioctl constants
  • vfs: add mp_vfs_mount_romfs_protected() helper
  • network_cyw43: add WPA3 security constants
  • moddeflate: keep DeflateIO state consistent on window alloc fail
  • vfs: refactor mp_vfs_mount to enable no-args mount overload
  • vfs: return mount table from no-args vfs.mount call
  • vfs_rom: implement minimal VfsRom.getcwd() method
  • implement UPDATE_SUBMODULES in CMake
  • extmod.mk: add cyw43_spi.c to list of sources
  • extmod.mk: switch from drivers/cyw43/cywbt to lib/cyw43-drivers

shared:

  • tinyusb: set MSC max endpoint size based on device speed
  • runtime/gchelper_generic: fix AArch32 build on Clang
  • timeutils: add missing mp_uint_t casts
  • runtime/pyexec: add helper function to execute a vstr

drivers:

  • memory/spiflash: add a config option to soft-reset SPI flash
  • add MP_QSPI_IOCTL_MEMORY_MODIFIED to indicate flash changed
  • memory/spiflash: allow a board/port to configure chip params
  • memory/spiflash: allow a board/port to detect SPI flash
  • bus/qspi: make num_dummy configurable for quad reads

mpy-cross: no changes specific to this component/port

lib:

  • micropython-lib: update submodule to latest
  • pico-sdk: update to version 2.1.0
  • mbedtls: update to mbedtls v3.6.2
  • pico-sdk: update to version 2.1.1
  • cyw43-driver: update driver to latest version v1.1.0
  • alif_ensemble-cmsis-dfp: add new submodule for Alif SDK v1.3.2
  • alif-security-toolkit: add new submodule for Alif Security Toolkit

Support components

docs:

  • reference/packages: fix description of --target option in mip
  • specify the recommended network.WLAN.IF_[AP|STA] constants
  • add a "Reset and Boot Sequence" reference page
  • rp2: add a small factory reset page
  • esp32: add a factory reset page
  • library: note link between machine.soft_reset() and sys.exit()
  • change copyright line to mention "authors and contributors"
  • update machine.TouchPad docs for ESP32-S2 and ESP32-S3
  • fix some comments and error messages with doubled-up words
  • library/binascii: add docs for binascii.crc32 method
  • fix the quickref documentation of rtc.datetime()
  • reference/isr_rules: describe issue with hard ISRs and globals
  • esp32: update tutorial flashing steps to match deploy.md
  • esp32: defer to the download page for flashing steps
  • update copyright year range to include 2025
  • samd/pinout: add pinout for Adafruit NeoKey Trinkey and QT Py
  • samd/pinout: add pinout for the Generic SAMD board types
  • esp32: add documentation for SPI Ethernet devices on esp32 port
  • note which ports have default or optional network.PPP support
  • reference: add strings vs bytes to speed optimisation tips
  • library/espnow: clarify usage of the "rate" configuration key
  • library/marshal: document the marshal module
  • fix double 'the' in documentation
  • library/machine.Pin: show availability of low, high and toggle
  • samd: update the SAMD documentation describing default IDs/pins
  • rp2: add network information to the rp2 quickref
  • library/vfs: document no-args mount output
  • reference/mpremote: update docs for mpremote rm -r
  • note that machine.USBDevice is now available on esp32 port

examples:

  • natmod/re: fix build on RV32 with alloca

tests:

  • basics/deque2.py: add tests for deque subscript-from-end
  • run-tests.py: simplify the way target-specific tests are given
  • run-tests.py: change --target/--device options to --test-instance
  • run-tests.py: add mimxrt and samd platforms
  • use the recommended network.WLAN.IF_[AP|STA] constants
  • cpydiff: fix test case for modules_json_nonserializable
  • net_hosted: improve and simplify non-block-xfer test
  • multi_espnow: add channel setting test, add some docs
  • add basic wlan test
  • misc/sys_settrace_features.py: add note about CPython 3.12 issue
  • extmod: workaround CPython warning in asyncio_new_event_loop test
  • run-tests.py: add support for tests to use unittest
  • run-tests.py: print .out file when there is no .exp file
  • ports/stm32_hardware: convert DMA test to use unittest
  • net_hosted: convert connect-nonblock-xfer test to use unittest
  • extmod: convert machine1.py test to use unittest
  • extmod_hardware: add a test for machine.PWM freq and duty
  • extmod: add test for uctypes.addressof function
  • run-tests.py: set name of injected test module to 'main'
  • fix all file ioctl's to support only MP_STREAM_CLOSE
  • extmod: add VfsRom test
  • inlineasm: make room for RV32IMC inline asm tests
  • run-tests.py: detect inlineasm support and add tests if needed
  • run-tests.py: set main module to __injected_test
  • run-tests.py: implement getcwd on __FS hook filesystem
  • extmod/vfs_rom.py: import errno for test
  • README: update TLS certificate generation instructions
  • multi_net: update TLS test certificates and keys
  • extmod/re_sub.py: fix test execution on Python 3.13
  • basics/nanbox_smallint.py: fix incorrect use of int() in test
  • add a test for SSL socket memory leaks
  • ports/rp2: add test for SLEEP_ENx registers over lightsleep
  • multi_wlan: remove esp8266 port workaround
  • run-natmodtests.py: autodetect the test target architecture
  • run-tests.py: give more information when CPython crashes
  • multi_net: add test for DTLS server and client
  • four typos in tests directory
  • run-tests: remove any 'expected' file from a unittest run
  • multi_pyb_can: add multitests for pyboard CAN controller
  • cpydiff: remove builtin_next_arg2.py difference
  • extmod/vfs_mountinfo.py: add test for no-args mount output
  • cpydiff: update CPy diff for assign expr in nested comprehensions
  • cpydiff: remove types_str_endswith
  • ports/alif_hardware: add flash testing script
  • update UART and SPI tests to work on Alif boards
  • run-tests: print a note if it looks like unittest.main() missing

tools:

  • mpremote: fix UnboundLocalError in Transport.fs_writefile()
  • ci.sh: fix commit msg checking when PR branch HEAD behind master
  • ci.sh: fix reference commit for code size comparison
  • mpremote: make sure stdout and stderr output appear in order
  • mpremote: add test for forced copy
  • mpremote: support trailing slash on dest for non-recursive copy
  • ci.sh: remove explicit macOS pkg-config install
  • ci.sh: re-enable vfs_posix tests on unix qemu MIPS CI
  • boardgen.py: provide macro defns for number of cpu/board pins
  • mpy_ld.py: add native modules support for RV32 code
  • verifygitlog.py: show invalid commit subjects in quotes
  • ci.sh: run test_full for qemu port CI
  • autobuild: don't allow a board to change its ID
  • pyboard.py: wait a bit before accessing the PTY serial port
  • autobuild: template the generation of esp32 port deploy.md
  • mpremote: avoid initial blocking read in read_until()
  • mpremote: introduce timeout_overall for read_until()
  • ci.sh: add natmod tests for QEMU/Arm
  • ci.sh: build MIMXRT1060_EVK with MSC enabled as part of mimxrt CI
  • mpremote: support mip install from package.json on local fs
  • pyboard.py: make get_time use machine.RTC instead of pyb.RTC
  • ci.sh: build the W5100S_EVB_PICO board with no threads
  • mpremote: add support for relative urls in package.json files
  • mpremote: optimise readline support in mount
  • mpremote/tests: add test for RemoteFile.readline
  • mpy-tool.py: add support for self-hosting of mpy-tool
  • mpy-tool.py: support calling main() from an external script
  • mpremote: add romfs query, build and deploy commands
  • mpy_ld.py: allow linking static libraries
  • ci.sh: build Xtensa natmods as part of the CI process
  • ci.sh: do not assume the Python interpreter is called "python"
  • mpremote: make mip install skip /rom*/lib directories
  • mpy_ld.py: give better error for unsupported ARM absolute relocs
  • ci.sh: manually install picotool for rp2 builds
  • gen-cpydiff.py: fail CPython diff generation if output matches
  • mpremote: allow .img for ROMFS file and validate ROMFS image
  • mpremote: add recursive remove functionality to filesystem cmds
  • mpremote/tests: add tests for mpremote rm -r

CI:

  • upgrade codespell to v2.4.1
  • upgrade to ruff v0.9.6
  • workflows: workaround using CPython 3.12 in MSYS2 builds
  • workflows: bump codecov/codecov-action from 4 to 5
  • workflows: use Python 3.11 for unix settrace jobs
  • workflows: use ubuntu-22.04 for unix qemu CI
  • workflows: stop using ubuntu-20.04
  • workflows: include the Python version in the ESP-IDF cache key
  • workflows: add Alif port to CI
  • cache Zephyr workspace installation
  • pull the Zephyr CI docker image from GitHub container reg
  • add caching of ccache for Zephyr

The ports

all ports:

  • make PWM duty_u16 have an upper value of 65535 across all ports
  • fix some comments and error messages with doubled-up words
  • fix machine.RTC.init() method so argument order matches the docs

alif port:

  • tinyusb_port: add Alif TinyUSB DCD driver
  • tinyusb_port: disable USB IRQ on deinit
  • tinyusb_port: implement SOF event
  • add initial port to Alif Ensemble MCUs
  • system_tick: use a UTIMER for system ticks and timing
  • mphalport: enable efficient events and implement quiet timing
  • system_tick: integrate soft timer
  • modmachine: enable machine.Timer
  • se_services: add SE services interface
  • mpconfigport: enable os.urandom()
  • mpconfigport: enable MICROPY_PY_RANDOM_SEED_INIT_FUNC
  • modalif: add alif.info() function
  • modmachine: implement machine.unique_id(), fix machine.reset()
  • usbd: implement proper USB serial number
  • machine_adc: add basic ADC support
  • mcu: add ToC config for dual images
  • support building the port for HE or HP or both cores
  • support running the port on the HE core
  • implement Open-AMP port backend
  • irq: define more IRQ priorities
  • system_tick: implement optional LPTIMER support for systick
  • system_tick: implement optional ARM SysTick support for systick
  • mpconfigport: select SysTick on HE core
  • mpu: add custom MPU_Load_Regions function
  • ospi_flash: generalise flash driver to support MX chips
  • ospi_flash: enter XIP mode when flash is idle
  • mpu: define constants for MPU regions
  • mpmetalport: add Open-AMP MPU region
  • ospi_flash: fix XIP for 8-bit instructions (ISSI)
  • ospi_flash: support flash device auto-detection in runtime
  • ospi_flash: configure dummy cycles
  • ospi_flash: add negative clock pin
  • ospi_flash: enable pull-up IO2/WP
  • ospi_ext: optimize XIP speed
  • ospi_flash: use OSPI in XIP mode only
  • ospi_flash: add 16-bit words swap flash setting
  • se_services: use EUI extension for unique id
  • modmachine: implement proper low-power modes
  • add support for pin alternate function selection
  • machine_i2c: add machine.I2C peripheral support
  • machine_spi: add machine.SPI peripheral support
  • machine_rtc: add basic machine.RTC support
  • ospi_flash: use mp_hal_pin_config to configure OSPI pins
  • se_services: add a secondary MHU channel
  • mpmetalport: use MHU to notify remote cores
  • link with libnosys
  • mpmetalport: only notify after metal subsystem is init'd
  • mpuart: use mp_hal_pin_config for TX/RX configuration
  • alif_flash: distinguish between total flash size and FS size
  • alif_flash: make flash respond to the buffer protocol
  • mpu: add function to set read-only bit on MRAM MPU region
  • vfs_rom_ioctl: add vfs_rom_ioctl with support for OSPI and MRAM
  • modules: make HE core set /rom as current dir
  • mphalport: add mp_hal_pin_config_irq_falling helper
  • mpuart: generalise UART driver to suppot all UART instances
  • integrate lwIP and mbedTLS
  • integrate cyw43 WLAN driver
  • integrate cyw43 Bluetooth with NimBLE
  • mcu: remove json config files
  • mcu: pre-process Alif ToC config file
  • mpuart: enhance UART to support bits/parity/stop and more IRQs
  • machine_uart: add machine.UART peripheral support
  • support more fine-grained pin alternate function selection
  • ospi_flash: don't invalidate cache after erasing/writing
  • ospi_flash_settings: use 8-bit DFS for XIP
  • ospi_flash: restore XIP settings after erase and write
  • mpu: add MPU region for OSPI1 XIP memory range
  • boards/ALIF_ENSEMBLE: add Alif Ensemble board config
  • boards/OPENMV_AE3: add OpenMV AE3 board definition

bare-arm port: no changes specific to this component/port

cc3200 port:

  • mods/pybpin: implement Pin.toggle() method

embed port: no changes specific to this component/port

esp8266 port:

  • use the recommended network.WLAN.IF_[AP|STA] constants
  • mpconfigport: enable function attributes
  • Makefile: fix local toolchain builds on recent Linux systems
  • network_wlan: make WLAN.config('channel') use wifi_get_channel
  • network_wlan: make WLAN.config(channel=x) use wifi_set_channel
  • machine_pin: implement Pin.toggle() method
  • network_wlan: allow enumerating connected stations in AP mode
  • implement vfs.rom_ioctl with support for external flash
  • boards: add FLASH_2M_ROMFS variant with 320k ROM partition
  • rename ROMFS partition config variables to include "part0"

esp32 port:

  • move the linker wrap options out of the project CMakeLists
  • add some notes about the different CMake files
  • machine_hw_spi: reject invalid number of bits in constructor
  • machine_pwm: use IDF functions to calculate resolution correctly
  • network_wlan: add missing WLAN security constants
  • machine_pwm: restore PWM support for ESP-IDF v5.0.x and v5.1.x
  • workaround native code execution crash on ESP32-S2
  • use the recommended network.WLAN.IF_[AP|STA] constants
  • modsocket: fix getaddrinfo hints to set AI_CANONNAME
  • fix setting WLAN channel in AP mode
  • use hardware version for touchpad macro defines
  • fix machine.TouchPad startup on ESP32-S2 and S3
  • update machine.TouchPad docs for ESP32-S2 and ESP32-S3
  • add missing network.STAT_CONNECT_FAIL constant
  • fix link failure due to link library order
  • add basic espressif IDF v5.3 compatibility
  • fix machine_touchpad compiling on IDFv5.3
  • pass V=1 or BUILD_VERBOSE through to idf.py when building
  • use capability defines to configure features
  • mpconfigport: use the appropriate wait-for-interrupt opcode
  • drop support for ESP-IDF below V5.2.0
  • remove IDF-version-specific sdkconfig
  • simplify thread cleanup
  • enable machine.USBDevice to configure USB at runtime
  • machine_timer: restrict timer numbers for ESP32C6 to 0 and 1
  • boards: remove remaining "id" entries from board.json
  • template the generation of esp32 port deploy.md
  • boards: update the product name for some UM boards
  • add support for IDF v5.4
  • disable component manager when running 'make submodules'
  • don't add TinyUSB files to an ECHO_SUBMODULES build
  • README: fix board in octal-SPIRAM example make command
  • boards: enable I2S on ESP32C3 boards
  • machine_sdcard: fix invalid result of SDCard.read/writeblocks
  • remove unneeded "memory.h" header file
  • machine_i2c: make I2C bus ID arg optional with default
  • README: make some minor improvements to the README
  • esp32_common.cmake: allow overriding linker.lf
  • machine_pin: implement Pin.toggle() method
  • implement vfs.rom_ioctl with support for external flash
  • merge the per-SoC "main" components back together
  • remove the ESP32 ringbuffer linker workaround
  • machine_sdcard: add SDCard pin assignments for ESP32-S3 support
  • machine_sdcard: add SDCard SPI mode support for ESP32-S2,C3,C6
  • boards: enable machine.SDCard on all boards
  • machine_pwm: correctly stop LEDC timer
  • machine_pin: fix logic clearing USB_SERIAL_JTAG_USB_PAD_ENABLE
  • machine_pin: fix availability of USB Serial/JTAG pins on ESP32-C6
  • implement UPDATE_SUBMODULES in CMake
  • Makefile: use $(Q) prefix on all commands
  • esp32_common.cmake: use native gchelper for RISC-V
  • esp32_common.cmake: clean up RISC-V directives
  • esp32_common.cmake: remove obsolete definition

mimxrt port:

  • machine_pwm: fix a few inconsistencies with PWM output
  • switch to shared TinyUSB descriptor
  • mpconfigport: update FATFS config to align with other ports
  • machine_rtc: deprecate RTC.cancel in MicroPython v2
  • machine_rtc: drop machine.RTC.now() method
  • irq: add CSI IRQ
  • machine_rtc: fix build with new SDKs
  • mpconfigport: remove hard-coded CMSIS header
  • add support for a UF2 bootloader
  • hal: update the LUT and re-enable PAGEPROGRAM_QUAD
  • flash: swap the order of disabling IRQ and disabling the cache
  • boards: update the deploy instructions for the UF2 bootloader
  • boards: add flash configuration constants to mpconfigboard.mk
  • hal: set the flexspi flash CLK frequency on boot
  • add optional MSC support
  • boards: reduce stack size for 1011 and 1015 MCUs
  • boards/ADAFRUIT_METRO_M7: reduce flash freq to 100MHz
  • hal/flexspi_nor_flash: fix typo in comment about frequency
  • boards/MAKERDIARY_RT1011_NANO_KIT: add new Makerdiary board
  • machine_adc: add ADC.read_uv() method
  • mpconfigport: enable support for exFAT
  • mpconfigport: enable PPP for boards with lwIP
  • machine_uart: remove duplicate init and make IRQ optional
  • hal/qspi_nor_flash_config: use a safe common CS timing
  • machine_uart: fix rx/tx buffer allocation bug
  • machine_i2c: support the timeout keyword argument
  • enable default devices for I2C, SPI and UART
  • boards: update deploy instructions
  • Makefile: fix dependencies for generation of flexram_config.s

minimal port: no changes specific to this component/port

nrf port:

  • drivers/ticker: reset slow ticker callback count on soft reboot
  • boards/ARDUINO_NANO_33_BLE_SENSE: update LED and timer config
  • modules: fix access of read-only buffer in Flash.writeblocks

pic16bit port:

  • make it build with recent XC16 versions

powerpc port: no changes specific to this component/port

qemu port:

  • Makefile: include unittest in firmware
  • mpconfigport: enable VFS reader, loading .mpy files and io.IOBase
  • add test_natmod target for RV32 and use as part of CI pipeline
  • mpconfigport: enable VfsRom
  • main: make GC heap size configurable on a per-arch basis
  • boards: exclude Thumb2 tests and tests failing with native emitter
  • Makefile: add test_full target to run a comprehensive test suite
  • mcu/arm: dump exception cause and registers on machine error
  • disable native emitter for the MICROBIT board
  • Makefile: increase GC heap size to 140KiB
  • boards/SABRELITE.mk: remove exception for omitted tests
  • boards: change boards to use a subdirectory like other ports
  • Makefile: fix shell interpolation for automated natmod tests
  • boards/SABRELITE: increase MicroPython heap to 160k

renesas-ra port:

  • mpconfigport: switch FATFS LFN to type 2
  • Makefile: remove id_code section from binary file generation
  • modrenesas: expose the Flash block device to Python code

rp2 port:

  • README: remove redundant global statement from example code
  • mpconfigport: switch FATFS LFN to type 2
  • pass V=1 or BUILD_VERBOSE to rp2 build
  • modmachine: fix USB sleep on RP2350 MCUs
  • CMakeLists.txt: add components required by bootrom.h
  • cyw43_configport: define cyw43 pins
  • mphalport: add mp_hal_is_pin_reserved() function
  • boards/RPI_PICO2_W: add new Pico 2 W board definition
  • boards/RPI_PICO2_W: add RISCV variant for Pico 2 W
  • boards/SPARKFUN_PROMICRO: fix SparkFun Pro Micro RP2040 image
  • mpconfigport: enable RV32 inline assembly support
  • mphalport: fix mp_hal_pin_low/high() for pin>=32
  • machine_bitstream: tweak MP_HAL_BITSTREAM_NS_OVERHEAD for RP2350
  • boards/SPARKFUN_PROMICRO_RP2350: add SparkFun Pro Micro RP2350
  • boards/SPARKFUN_THINGPLUS_RP2350: add SparkFun Thing Plus RP2350
  • migrate to the new mp_thread_recursive_mutex_t
  • modmachine: make lightsleep preserve SLEEP_EN0 and SLEEP_EN1
  • rp2_flash: workaround multicore lockout not being reset
  • rp2_pio: add side_pindir support for PIO
  • boards: add SparkFun IoT Node LoRaWAN board
  • modules: fix memory leak and logic bug in handling of _pio_funcs
  • fix build failure if threads are disabled
  • boards/MACHDYNE_WERKZEUG: add support for Machdyne Werkzeug
  • boards/SPARKFUN_XRP_CONTROLLER_BETA: add SparkFun XRP Controller
  • machine_i2c: make I2C bus ID arg optional with default
  • implement vfs.rom_ioctl with support for external flash
  • modrp2: fix rp2.bootsel_button() function for RP2350
  • boards/SPARKFUN_IOTREDBOARD_RP2350: add support for IoT RedBoard
  • boards/WEACTSTUDIO_RP2350B_CORE: add WeAct Studio RP2350B Core
  • boards/SPARKFUN_XRP_CONTROLLER: add SparkFun XRP Controller
  • boards/SPARKFUN_XRP_CONTROLLER_BETA: fix XRP Controller Beta URL
  • boards/SEEED_XIAO_RP2350: add new Seeed XIAO board definition
  • boards: fix SparkFun vendor name
  • boards/SPARKFUN_IOTNODE_LORAWAN_RP2350: add SD card support
  • machine_i2c: require an I2C bus ID when no default is available
  • machine_spi: make SPI ID optional
  • machine_spi: allow MISO to be unspecified
  • mpnetworkport: fix lost CYW43 WiFi events when using both cores
  • mpnetworkport: refactor out cyw43_has_pending global variable
  • pendsv: account for PendSV running on both cores, and without CYW43
  • machine_uart: fix unintended UART buffer allocation on init()
  • implement UPDATE_SUBMODULES in CMake
  • print an error message if pico-sdk submodule is missing
  • Makefile: use $(Q) prefix on all commands
  • cyw43_configport: fix cyw43 mDNS by properly starting mDNS on netif
  • add support for PSRAM with auto-detection
  • mpconfigport: configure heap for PSRAM
  • rp2_flash: support flash writes from PSRAM
  • rp2_flash: configure optimal flash timings

samd port:

  • machine_uart: add full support for 9-bit data
  • boards/SAMD21_XPLAINED_PRO: add specific deploy instructions
  • mboot: provide a UF2 bootloader for SAMD21 Xplained Pro
  • boards/SAMD21_XPLAINED_PRO: use the SPI flash for the file system
  • samd_flash: make flash read/write methods access self parameters
  • mboot/README.md: add information about the bootloader source
  • machine_dac: fix SAMD51 DAC for two channels
  • samd_qspiflash: correct QSPI baud calculation
  • boards: add generic SAMD21x18 board definitions
  • boards: add generic SAMD51x19 board definitions
  • boards: add generic SAMD51x20 board definitions
  • Makefile: add support for board variants
  • boards: add support for the Adafruit QT Py board
  • boards: add support for the Adafruit NeoKey Trinkey board
  • machine_i2c: support default instance and SCL/SDA pin values
  • machine_spi: support default instance and SCK/MOSI/MISO pin values
  • machine_uart: support default instance and TX/RX pin values
  • boards: add missing TX/RX, SCL/SDA and SCK/MOSI/MISO pin names
  • boards: provide default IDs for UART, I2C and SPI
  • machine_uart: fix unintended UART buffer allocation on init()
  • machine_uart: fix lock-up in loopback mode if read buffer is full

stm32 port:

  • boards: update Arduino board configs for SPI reset and bootloader
  • boards: rename SDRAM frequency config option to make units clear
  • sdram: make SDRAM refresh count configurable by a board
  • spi: add spi_deinit_all function
  • pyb_i2c: add pyb_i2c_deinit_all function
  • main: deinitialize SPI and I2C on soft-reset
  • mpconfigport: switch FATFS LFN to type 2
  • boards/STM32F429DISC: fix SDRAM configuration
  • pin: add option to exclude legacy Pin methods and constants
  • pin: add config option to exclude Pin alternate function
  • pin: exclude Pin.cpu/Pin.board if they contain no entries
  • extint: fix EXTI IRQ handlers for H5 MCUs
  • boards/WEACT_F411_BLACKPILL: add WeAct F411 'blackpill' boards
  • generate PLL tables from pre-processed headers
  • fix extraction of hse/hsi/pllm values from preprocessed source
  • mboot: add mboot version string
  • mpconfigboard_common: add MICROPY_HW_SPI_IS_STATIC macro
  • spi: retain the state of special SPI buses on soft reboot
  • boards: reserve SPI bus when it's used for external flash storage
  • boards: support 'FDCAN' in board pin CSVs
  • pyb_can: fix CAN-FD BRS baud initialisation
  • pyb_can: make pyb.CAN baud calculation a little more forgiving
  • pyb_can: include requested CAN baudrate in matching error
  • can: fix clearing filters on CAN3 (bxCAN)
  • fdcan: fix extended CAN ID filtering for stm32g4
  • boards/ARDUINO_NICLA_VISION: fix CAN pin assignment
  • boards: update Arduino boards to reserve timers and fix USB PID
  • eth: make ETH DMA buffer attributes configurable
  • sdcard: fix unchecked uint32_t overflow in SD card driver
  • sdcard: drop the pyb.SDCard timeout from 60 to 30 seconds
  • implement vfs.rom_ioctl with support for internal/external flash
  • boards: enable ROMFS partitions on PYBD_SFx boards
  • rename ROMFS partition config variables to start at index 0
  • boards/ARDUINO_GIGA: enable 4MiB ROMFS partition in ext flash
  • boards/ARDUINO_NICLA_VISION: enable 4MiB ROMFS part in ext flash
  • boards/ARDUINO_PORTENTA_H7: enable 4MiB ROMFS part in ext flash
  • can: refactor can.h API to not depend on pyboard can types
  • qspi: implement MP_QSPI_IOCTL_MEMORY_MODIFIED ioctl
  • main: catch and report corrupted lfs filesystem at startup
  • boards: add F427 AF CSV file
  • stm32_it: add handler for timer 20 interrupt
  • timer: use APB2 to calculate timer 20 source frequency
  • timer: add support for STM32H5 Timer 1
  • qspi: add qspi_memory_map_exit and restart
  • boards/PYBD_SF2: restart qspi memory-mapped mode during startup
  • vfs_rom_ioctl: allow ROMFS configuration to be dynamic
  • qspi: allow SPI flash size to be decided at runtime
  • mboot: allow USB strings to be dynamic
  • modmachine: add SPI flash size to machine.info dump
  • boards/PYBD_SF6: support boards with larger SPI flash

unix port:

  • force _FILE_OFFSET_BITS=64 to fix 32-bit file ABI
  • enable VfsRom on standard and coverage variants
  • use the bare metal mbedTLS config in the coverage buiid
  • add recursive mutex support
  • main: add coverage test for mounting ROMFS filesystem at startup

webassembly port: no changes specific to this component/port

windows port:

  • force _FILE_OFFSET_BITS=64 to fix 32-bit file ABI

zephyr port:

  • machine_wdt: add watchdog timer implementation
  • machine_timer: add machine.Timer class implementation
2025-04-15 22:28

Patch release for mpremote, rp2 IGMP, esp32 PWM, SDCard, and AP channel

This is a patch release containing the following commits:

  • tools/mpremote: fix UnboundLocalError in Transport.fs_writefile()
  • esp32/machine_pwm: use IDF functions to calculate resolution correctly
  • pic16bit: make it build with recent XC16 versions
  • py/objdeque: fix buffer overflow in deque_subscr
  • extmod/modlwip: fix IGMP address type when IPv6 is enabled
  • esp32/machine_pwm: restore PWM support for ESP-IDF v5.0.x and v5.1.x
  • esp32: workaround native code execution crash on ESP32-S2
  • tools/mpremote: make sure stdout and stderr output appear in order
  • tools/mpremote: add test for forced copy
  • tools/mpremote: support trailing slash on dest for non-recursive copy
  • esp32/modsocket: fix getaddrinfo hints to set AI_CANONNAME
  • extmod/vfs_blockdev: support bool return from Python read/write blocks
  • extmod/network_cyw43: fix isconnected() result on AP interface
  • extmod/network_cyw43: fix uninitialised variable in status('stations')
  • extmod/network_cyw43: allow configuring active AP interface
  • esp32: fix setting WLAN channel in AP mode
  • esp32: use hardware version for touchpad macro defines
  • esp32: fix machine.TouchPad startup on ESP32-S2 and S3
  • extmod/modframebuf: fix 0 radius bug in FrameBuffer.ellipse
  • nrf/drivers/ticker: reset slow ticker callback count on soft reboot
  • py/objfloat: workaround non-constant NAN definition on Windows MSVC
2024-11-29 20:53

内容可能含有违规信息

2024-10-25 22:43
2024-05-31 12:19

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
2024-02-20 19:59

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.

2024-01-05 09:33

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

2023-12-27 12:35

内容可能含有违规信息

2023-10-06 07:32
2023-04-26 13:42

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.

2022-06-17 10:57
2022-06-16 13:11

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
2022-01-17 06:50

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
2021-09-01 22:07

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
2021-06-18 14:38

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()
2021-04-18 22:11
1
https://gitee.com/mirrors/micropython.git
git@gitee.com:mirrors/micropython.git
mirrors
micropython
micropython

搜索帮助