Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump mpremote from 1.22.0 to 1.23.0 #162

Merged
merged 1 commit into from
Jun 3, 2024

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jun 3, 2024

Bumps mpremote from 1.22.0 to 1.23.0.

Release notes

Sourced from mpremote's releases.

Dynamic USB devices, revamped webassembly port, openamp, tls, vfs modules

This release of MicroPython adds support for dynamic USB devices defined in Python, adds new openamp, tls and vfs modules, completely revamps the webassembly port to add proxying between JavaScript and Python, and implements significant code size optimisations for frozen modules. There are also many other enhancements and bug fixes. Keep reading for a more detailed summary of the main changes.

After a lot of design, development and testing, MicroPython now has full support for user-defined USB devices. The interface is via a new machine.USBDevice class, and this allows the user to specify the USB descriptors and implement Python callbacks for USB endpoint transfers. With this, any USB device can be implemented in pure Python. While the machine.USBDevice interface is low-level and complete, there is a higher-level USB library in micropython-lib that allows easier implementation of devices, with examples for keyboard, mouse, MIDI and serial CDC. This feature is currently available on rp2 and samd ports, and other ports will follow in the future.

Support for the OpenAMP (asymmetric multiprocessing) protocol has been added through the new openamp module. This allows MicroPython to control other CPU cores in the system, to load and start processes and communicate with them through endpoints. This feature is currently available on the mimxrt and stm32 ports.

Two other new modules have been added: vfs and tls. The vfs module contains all VFS (virtual filesystem) related functions and classes, such as mount, umount and VfsFat. These were originally in the os module but having them there is not compatible with CPython, so they have been moved to their own dedicated module. They still exist in the os module for now but will eventually be removed from there, so it's recommended to start using the vfs module from now on. Similarly the new tls module is an evolution of the ssl module, whereby all the existing functionality in ssl has been moved to the tls module. This is done because MicroPython's SSL interface is becoming increasingly different to CPython's and moving this SSL/TLS functionality to a new tls module gives it room to grow and obtain new features that are useful for embedded applications. And compatibility with normal Python is still retained via a pure Python implementation of the ssl module. One new feature in the new tls module is the ability to register a certificate verification callback.

Other additions include more methods on the deque object so it is doubly-ended and supports iteration, and support for half-float 'e' format in struct.pack/struct.unpack. Dynamic native modules have had some additional runtime methods exposed, and the .mpy sub-version has been increased from v6.2 to v6.3 (native code in .mpy files will need to be recompiled, but bytecode does not and is still compatible).

There has also been significant code size optimisations for frozen modules. A new internal mp_proto_fun_t type has been defined which allows the common case of bytecode functions (as opposed to native code) to be stored in frozen code without any additional overhead of the mp_raw_code_t descriptor structure. All firmware builds using frozen modules will see a significant decrease in size. Code size has also improved further for very small targets by adding an option to remove the qstr hash bytes.

Internally in the source code the "STATIC" macro definition has been removed. Code should now just use "static" instead. If you have C/C++ code that uses "STATIC" then either replace it with "static", or provide your own #define to define "STATIC" as "static". See commit decf8e6a8bb940d5829ca3296790631fcece7b21 for details.

Mbedtls has been updated to version 3.5.1. And network interface constants, such as IF_STA and SEC_WPA2, have now been consolidated across ports so they all live at the WLAN class level, for example network.WLAN.SEC_WPA2 (existing constants at the network module level have been retained for backwards compatibility, but the new ones should be preferred from now on).

The esp32 port has seen some important bug fixes in the BLE component, to deinitialise without crashing, and increase the BLE task stack size. This port also uses the new I2S IDF driver, and supports IDF 5.0.5 and 5.2. There is support to enter the bootloader via machine.bootloader() and a new esp32.mcu_temperature(), for ESP32-C3/S2/S3 devices.

The rp2 port has added the new machine.USBDevice dynamic USB driver, and has had firmware performance optimisations applied to critical parts of the runtime and VM, giving about a 10% performance boost. There is now direct memory access to PIO and SPI FIFOs via proxy arrays, and bugs have been fixed with threads, lightsleep and UART IRQ latency.

The stm32 port has integrated support for the new openamp module, which is enabled on all Arduino boards. And firmware for Arduino boards now freeze in additional Arduino-specific library code. There have been fixes for internal flash writes on STM32H5 and STM32H7 MCUs (bank selection and flashing of the last word in a buffer), an important fix to a SPI DMA caching bug, an I2C clock enable fix for I2C4 on STM32F7 MCUs, and a fix for the FDCAN source clock frequency on STM32G4 MCUs. Mboot has added support for a new raw filesystem, to allow simpler and more robust firmware updates.

The webassembly port has seen a significant overhaul in its structure, and is now built as a JavaScript .mjs module that exports a user-friendly JavaScript-level API which is inspired by the API provided by Pyodide (which is a version of CPython that runs in the browser). This change is motivated by the need to use MicroPython as an engine within Pyscript, which is a platform for Python in the browser. New features in the webassembly port include proxying of objects between Python and JavaScript, a js module to interface with the JavaScript namespace, a jsffi module for miscellaneous proxy helpers, top-level async code, JavaScript driven asyncio support, automatic growing of the Python heap, integration of JavaScript and Python finalisation for global memory management, more time module functions, and support for build variants (following the unix port).

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

   bare-arm:   -220  -0.383%
minimal x86:   -341  -0.184%
   unix x64: +20168  +2.527%
      stm32:  -1692  -0.430%
     cc3200:   +256  +0.139%
    esp8266:  -8880  -1.260%
      esp32:  -3328  -0.194%
     mimxrt:   -408  -0.112%
 renesas-ra:   -464  -0.074%
        nrf:   -640  -0.341%
        rp2:  +5380  +1.626%
       samd:  +3224  +1.229%

The leading causes of these changes in code size are:

  • bare-arm, minimal: disabling qstr hashing
  • unix: updating mbedtls to version 3.5.1
  • stm32: optimising size of frozen modules
  • cc3200: addition of new vfs module, and bug fixes in the VM and array type
  • esp8266: disabling unused MICROPY_DEBUG_PRINTERS and optimising frozen modules
  • esp32, mimxrt, renesas-ra, nrf: optimising frozen modules
  • rp2: addition of machine.USBDevice, enabling -O2 optimisations
  • samd: addition of machine.USBDevice

... (truncated)

Commits
  • a61c446 all: Bump version to 1.23.0.
  • 30a9ccf tests/basics: Move str/bytes tests that give SyntaxWarning to sep file.
  • dd4767a tests/basics: Add .exp file for slice_op test.
  • ad6750b tests/float: Use "not" instead of ~ to invert bool value.
  • 5f6e689 LICENSE,docs: Update copyright year range to include 2024.
  • 8a8c65f lib/micropython-lib: Update submodule to latest.
  • 03cf4d4 rp2/boards/W5500_EVB_PICO: Update incorrect url in board.json.
  • a34b5d1 tests/net_inet/tls_text_errors.py: Tweak test for newer CPython version.
  • e1111d8 tests/net_hosted/ssl_verify_callback.py: Make exp match actual output.
  • 1a2fdca tests/basics: Split out generator.throw tests that pass multiple args.
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [mpremote](https://github.com/micropython/micropython) from 1.22.0 to 1.23.0.
- [Release notes](https://github.com/micropython/micropython/releases)
- [Commits](micropython/micropython@v1.22.0...v1.23.0)

---
updated-dependencies:
- dependency-name: mpremote
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jun 3, 2024
@BrianPugh BrianPugh merged commit 9ee0524 into main Jun 3, 2024
69 checks passed
@BrianPugh BrianPugh deleted the dependabot/pip/mpremote-1.23.0 branch June 3, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant