You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an experimental port of MicroPython to the Espressif ESP32
5
-
microcontroller. It uses the ESP-IDF framework and MicroPython runs as
4
+
This is a port of MicroPython to the Espressif ESP32 series of
5
+
microcontrollers. It uses the ESP-IDF framework and MicroPython runs as
6
6
a task under FreeRTOS.
7
7
8
8
Supported features include:
9
9
- REPL (Python prompt) over UART0.
10
-
- 16k stack for the MicroPython task and 96k Python heap.
10
+
- 16k stack for the MicroPython task and approximately 100k Python heap.
11
11
- Many of MicroPython's features are enabled: unicode, arbitrary-precision
12
12
integers, single-precision floats, complex numbers, frozen bytecode, as
13
13
well as many of the internal modules.
14
14
- Internal filesystem using the flash (currently 2M in size).
15
15
- The machine module with GPIO, UART, SPI, software I2C, ADC, DAC, PWM,
16
16
TouchPad, WDT and Timer.
17
17
- The network module with WLAN (WiFi) support.
18
+
- Bluetooth low-energy (BLE) support via the bluetooth module.
18
19
19
-
Development of this ESP32 port was sponsored in part by Microbric Pty Ltd.
20
+
Initial development of this ESP32 port was sponsored in part by Microbric Pty Ltd.
20
21
21
-
Setting up the toolchain and ESP-IDF
22
-
------------------------------------
22
+
Setting up ESP-IDF and the build environment
23
+
--------------------------------------------
23
24
24
-
There are two main components that are needed to build the firmware:
25
-
- the Xtensa cross-compiler that targets the CPU in the ESP32 (this is
26
-
different to the compiler used by the ESP8266)
27
-
- the Espressif IDF (IoT development framework, aka SDK)
25
+
MicroPython on ESP32 requires the Espressif IDF version 4 (IoT development
26
+
framework, aka SDK). The ESP-IDF includes the libraries and RTOS needed to
27
+
manage the ESP32 microcontroller, as well as a way to manage the required
28
+
build environment and toolchains needed to build the firmware.
29
+
30
+
The ESP-IDF changes quickly and MicroPython only supports certain versions.
31
+
Currently MicroPython supports v4.0.2, although other IDF v4 versions may also
32
+
work.
33
+
34
+
To install the ESP-IDF the full instructions can be found at the
35
+
[Espressif Getting Started guide](https://docs.espressif.com/projects/esp-idf/en/v4.0.2/get-started/index.html#installation-step-by-step).
28
36
29
37
If you are on a Windows machine then the [Windows Subsystem for
30
38
Linux](https://msdn.microsoft.com/en-au/commandline/wsl/install_guide) is the
31
39
most efficient way to install the ESP32 toolchain and build the project. If
32
40
you use WSL then follow the Linux instructions rather than the Windows
33
41
instructions.
34
42
35
-
The ESP-IDF changes quickly and MicroPython only supports certain versions.
36
-
The git hash of these versions (one for 3.x, one for 4.x) can be found by
37
-
running `make` without a configured `ESPIDF`. Then you can fetch the
38
-
required IDF using the following command:
39
-
40
-
```bash
41
-
$ cd ports/esp32
42
-
$ make ESPIDF= # This will print the supported hashes, copy the one you want.
43
-
$ export ESPIDF=$HOME/src/github.com/espressif/esp-idf # Or any path you like.
Follow the steps at the [Espressif Getting Started guide](https://docs.espressif.com/projects/esp-idf/en/v4.0/get-started/index.html#step-3-set-up-the-tools).
93
-
94
-
This will guide you through using the `install.sh` (or `install.bat`) script
95
-
to download the toolchain and add it to your `PATH`. The steps are summarised
96
-
below:
97
-
98
-
After you've cloned and checked out the IDF to the correct version (see
99
-
above), run the `install.sh` script:
100
-
101
-
```bash
102
-
$ cd$ESPIDF
103
-
$ ./install.sh # (or install.bat on Windows)
104
-
```
53
+
(You don't need a full recursive clone; see the `ci_esp32_setup` function in
54
+
`tools/ci.sh` in this repository for more detailed set-up commands.)
105
55
106
-
Then in the `ports/esp32` directory, source the `export.sh` script to set the
107
-
`PATH`.
56
+
After you've cloned and checked out the IDF to the correct version, run the
57
+
`install.sh` script:
108
58
109
59
```bash
110
-
$ cdmicropython/ports/esp32
111
-
$ source$ESPIDF/export.sh # (or path\to\esp-idf\export.bat on Windows)
112
-
$ # Run make etc, see below.
60
+
$ cdesp-idf
61
+
$ ./install.sh # (or install.bat on Windows)
62
+
$ source export.sh # (or export.bat on Windows)
113
63
```
114
64
115
65
The `install.sh` step only needs to be done once. You will need to source
116
66
`export.sh` for every new session.
117
67
118
-
Note: If you get an error about `--no-site-packages`, then modify
119
-
`$ESPIDF/tools/idf_tools.py` and make the same change as [this
0 commit comments