|
| 1 | +.. _micropython2_migration: |
| 2 | + |
| 3 | +MicroPython 2.0 Migration Guide |
| 4 | +=============================== |
| 5 | + |
| 6 | +MicroPython 2.0 is the (currently in development, not yet available) next major |
| 7 | +release of MicroPython. |
| 8 | + |
| 9 | +After maintaining API compatibility for almost a decade with the ``1.x`` series, in |
| 10 | +order to unblock some project-wide improvements MicroPython 2.0 will introduce a |
| 11 | +small number of breaking API changes that will require some programs to be |
| 12 | +updated. This guide explains how to update your Python code to accommodate these |
| 13 | +changes. |
| 14 | + |
| 15 | +This document is a work-in-progress. As more work is done on MicroPython 2.0, |
| 16 | +more items will be added to the lists below. |
| 17 | + |
| 18 | +**Note:** There are currently no MicroPython 2.0 firmware builds available for |
| 19 | +download. You can build it yourself by enabling the ``MICROPY_PREVIEW_VERSION_2`` |
| 20 | +config option. As it gets closer to being ready for release, builds will be |
| 21 | +provided for both ``1.x.y`` and ``2.0.0-preview``. |
| 22 | + |
| 23 | +Hardware and peripherals |
| 24 | +------------------------ |
| 25 | + |
| 26 | +Overview |
| 27 | +~~~~~~~~ |
| 28 | + |
| 29 | +The goal is to improve consistency in the :mod:`machine` APIs across different |
| 30 | +ports, making it easier to write code, documentation, and tutorials that work on |
| 31 | +any supported microcontroller. |
| 32 | + |
| 33 | +This means that some ports' APIs need to change to match other ports. |
| 34 | + |
| 35 | +Changes |
| 36 | +~~~~~~~ |
| 37 | + |
| 38 | +*None yet* |
| 39 | + |
| 40 | +OS & filesystem |
| 41 | +--------------- |
| 42 | + |
| 43 | +Overview |
| 44 | +~~~~~~~~ |
| 45 | + |
| 46 | +The primary goal is to support the ability to execute :term:`.mpy files <.mpy |
| 47 | +file>` directly from the filesystem without first copying them into RAM. This |
| 48 | +improves code deployment time and reduces memory overhead and fragmentation. |
| 49 | + |
| 50 | +Additionally, a further goal is to support a more flexible way of configuring |
| 51 | +partitions, filesystem types, and options like USB mass storage. |
| 52 | + |
| 53 | +Changes |
| 54 | +~~~~~~~ |
| 55 | + |
| 56 | +*None yet* |
| 57 | + |
| 58 | +CPython compatibility |
| 59 | +--------------------- |
| 60 | + |
| 61 | +Overview |
| 62 | +~~~~~~~~ |
| 63 | + |
| 64 | +The goal is to improve compatibility with CPython by removing MicroPython |
| 65 | +extensions from CPython APIs. In most cases this means moving existing |
| 66 | +MicroPython-specific functions or classes to new modules. |
| 67 | + |
| 68 | +This makes it easier to write code that works on both CPython and MicroPython, |
| 69 | +which is useful for development and testing. |
| 70 | + |
| 71 | +Changes |
| 72 | +~~~~~~~ |
| 73 | + |
| 74 | +*None yet* |
0 commit comments