{"id":13568589,"url":"https://github.com/micropython/micropython-esp32","last_synced_at":"2025-10-01T04:30:45.154Z","repository":{"id":58773528,"uuid":"76828539","full_name":"micropython/micropython-esp32","owner":"micropython","description":"Old port of MicroPython to the ESP32 -- new port is at https://github.com/micropython/micropython","archived":true,"fork":false,"pushed_at":"2019-02-28T07:03:02.000Z","size":31157,"stargazers_count":675,"open_issues_count":14,"forks_count":217,"subscribers_count":96,"default_branch":"esp32","last_synced_at":"2024-10-01T04:59:15.214Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/micropython.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-19T04:38:26.000Z","updated_at":"2024-09-24T00:17:31.000Z","dependencies_parsed_at":"2022-09-08T12:42:15.684Z","dependency_job_id":null,"html_url":"https://github.com/micropython/micropython-esp32","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micropython%2Fmicropython-esp32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micropython%2Fmicropython-esp32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micropython%2Fmicropython-esp32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micropython%2Fmicropython-esp32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micropython","download_url":"https://codeload.github.com/micropython/micropython-esp32/tar.gz/refs/heads/esp32","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234821068,"owners_count":18891975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T14:00:28.712Z","updated_at":"2025-10-01T04:30:39.067Z","avatar_url":"https://github.com/micropython.png","language":"C","readme":"The MicroPython project\n=======================\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/micropython/micropython/master/logo/upython-with-micro.jpg\" alt=\"MicroPython Logo\"/\u003e\n\u003c/p\u003e\n\nThis is the MicroPython project, which aims to put an implementation\nof Python 3.x on microcontrollers and small embedded systems.\nYou can find the official website at [micropython.org](http://www.micropython.org).\n\nA note about this ESP32 repository\n----------------------------------\n\n**The ESP32 port has now been merged back into the\n[main MicroPython repository](https://github.com/micropython/micropython/) \nand this repository is maintained for historical purposes.**\n\n**This repository is now getting out of date and new pull requests should\nbe made against the master branch of the main repository!**\n\nAbout MicroPython\n-----------------\n\nWARNING: this project is in beta stage and is subject to changes of the\ncode-base, including project-wide name changes and API changes.\n\nMicroPython implements the entire Python 3.4 syntax (including exceptions,\n`with`, `yield from`, etc., and additionally `async`/`await` keywords from\nPython 3.5). The following core datatypes are provided: `str` (including\nbasic Unicode support), `bytes`, `bytearray`, `tuple`, `list`, `dict`, `set`,\n`frozenset`, `array.array`, `collections.namedtuple`, classes and instances.\nBuiltin modules include `sys`, `time`, and `struct`, etc. Select ports have\nsupport for `_thread` module (multithreading). Note that only a subset of\nPython 3 functionality is implemented for the data types and modules.\n\nMicroPython can execute scripts in textual source form or from precompiled\nbytecode, in both cases either from an on-device filesystem or \"frozen\" into\nthe MicroPython executable.\n\nSee the repository http://github.com/micropython/pyboard for the MicroPython\nboard (PyBoard), the officially supported reference electronic circuit board.\n\nMajor components in this repository:\n- py/ -- the core Python implementation, including compiler, runtime, and\n  core library.\n- mpy-cross/ -- the MicroPython cross-compiler which is used to turn scripts\n  into precompiled bytecode.\n- ports/unix/ -- a version of MicroPython that runs on Unix.\n- ports/stm32/ -- a version of MicroPython that runs on the PyBoard and similar\n  STM32 boards (using ST's Cube HAL drivers).\n- ports/minimal/ -- a minimal MicroPython port. Start with this if you want\n  to port MicroPython to another microcontroller.\n- tests/ -- test framework and test scripts.\n- docs/ -- user documentation in Sphinx reStructuredText format. Rendered\n  HTML documentation is available at http://docs.micropython.org (be sure\n  to select needed board/port at the bottom left corner).\n\nAdditional components:\n- ports/bare-arm/ -- a bare minimum version of MicroPython for ARM MCUs. Used\n  mostly to control code size.\n- ports/teensy/ -- a version of MicroPython that runs on the Teensy 3.1\n  (preliminary but functional).\n- ports/pic16bit/ -- a version of MicroPython for 16-bit PIC microcontrollers.\n- ports/cc3200/ -- a version of MicroPython that runs on the CC3200 from TI.\n- ports/esp8266/ -- an experimental port for ESP8266 WiFi modules.\n- extmod/ -- additional (non-core) modules implemented in C.\n- tools/ -- various tools, including the pyboard.py module.\n- examples/ -- a few example Python scripts.\n\nThe subdirectories above may include READMEs with additional info.\n\n\"make\" is used to build the components, or \"gmake\" on BSD-based systems.\nYou will also need bash, gcc, and Python (at least 2.7 or 3.3).\n\nThe Unix version\n----------------\n\nThe \"unix\" port requires a standard Unix environment with gcc and GNU make.\nx86 and x64 architectures are supported (i.e. x86 32- and 64-bit), as well\nas ARM and MIPS. Making full-featured port to another architecture requires\nwriting some assembly code for the exception handling and garbage collection.\nAlternatively, fallback implementation based on setjmp/longjmp can be used.\n\nTo build (see section below for required dependencies):\n\n    $ git submodule update --init\n    $ cd ports/unix\n    $ make axtls\n    $ make\n\nThen to give it a try:\n\n    $ ./micropython\n    \u003e\u003e\u003e list(5 * x + y for x in range(10) for y in [4, 2, 1])\n\nUse `CTRL-D` (i.e. EOF) to exit the shell.\nLearn about command-line options (in particular, how to increase heap size\nwhich may be needed for larger applications):\n\n    $ ./micropython --help\n\nRun complete testsuite:\n\n    $ make test\n\nUnix version comes with a builtin package manager called upip, e.g.:\n\n    $ ./micropython -m upip install micropython-pystone\n    $ ./micropython -m pystone\n\nBrowse available modules on\n[PyPI](https://pypi.python.org/pypi?%3Aaction=search\u0026term=micropython).\nStandard library modules come from\n[micropython-lib](https://github.com/micropython/micropython-lib) project.\n\nExternal dependencies\n---------------------\n\nBuilding MicroPython ports may require some dependencies installed.\n\nFor Unix port, `libffi` library and `pkg-config` tool are required. On\nDebian/Ubuntu/Mint derivative Linux distros, install `build-essential`\n(includes toolchain and make), `libffi-dev`, and `pkg-config` packages.\n\nOther dependencies can be built together with MicroPython. This may\nbe required to enable extra features or capabilities, and in recent\nversions of MicroPython, these may be enabled by default. To build\nthese additional dependencies, first fetch git submodules for them:\n\n    $ git submodule update --init\n\nUse the same command to get the latest versions of dependencies, as\nthey are updated from time to time. After that, in the port directory\n(e.g. `ports/unix/`), execute:\n\n    $ make deplibs\n\nThis will build all available dependencies (regardless whether they\nare used or not). If you intend to build MicroPython with additional\noptions (like cross-compiling), the same set of options should be passed\nto `make deplibs`. To actually enable/disable use of dependencies, edit\n`ports/unix/mpconfigport.mk` file, which has inline descriptions of the options.\nFor example, to build SSL module (required for `upip` tool described above,\nand so enabled by dfeault), `MICROPY_PY_USSL` should be set to 1.\n\nFor some ports, building required dependences is transparent, and happens\nautomatically. They still need to be fetched with the git submodule command\nabove.\n\nThe STM32 version\n-----------------\n\nThe \"stm32\" port requires an ARM compiler, arm-none-eabi-gcc, and associated\nbin-utils.  For those using Arch Linux, you need arm-none-eabi-binutils,\narm-none-eabi-gcc and arm-none-eabi-newlib packages.  Otherwise, try here:\nhttps://launchpad.net/gcc-arm-embedded\n\nTo build:\n\n    $ git submodule update --init\n    $ cd ports/stm32\n    $ make\n\nYou then need to get your board into DFU mode.  On the pyboard, connect the\n3V3 pin to the P1/DFU pin with a wire (on PYBv1.0 they are next to each other\non the bottom left of the board, second row from the bottom).\n\nThen to flash the code via USB DFU to your device:\n\n    $ make deploy\n\nThis will use the included `tools/pydfu.py` script.  If flashing the firmware\ndoes not work it may be because you don't have the correct permissions, and\nneed to use `sudo make deploy`.\nSee the README.md file in the ports/stm32/ directory for further details.\n\nContributing\n------------\n\nMicroPython is an open-source project and welcomes contributions. To be\nproductive, please be sure to follow the\n[Contributors' Guidelines](https://github.com/micropython/micropython/wiki/ContributorGuidelines)\nand the [Code Conventions](https://github.com/micropython/micropython/blob/master/CODECONVENTIONS.md).\nNote that MicroPython is licenced under the MIT license, and all contributions\nshould follow this license.\n","funding_links":[],"categories":["Prototyping","硬件"],"sub_categories":["ESP32"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicropython%2Fmicropython-esp32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicropython%2Fmicropython-esp32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicropython%2Fmicropython-esp32/lists"}