@@ -7,12 +7,14 @@ 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 64k Python heap.
10
+ - 16k stack for the MicroPython task and 96k 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
- - Internal filesystem using the flash (currently 256k in size).
15
- - The machine module with basic GPIO and bit-banging I2C, SPI support.
14
+ - Internal filesystem using the flash (currently 2M in size).
15
+ - The machine module with GPIO, UART, SPI, software I2C, ADC, DAC, PWM,
16
+ TouchPad, WDT and Timer.
17
+ - The network module with WLAN (WiFi) support.
16
18
17
19
Development of this ESP32 port was sponsored in part by Microbric Pty Ltd.
18
20
@@ -30,20 +32,36 @@ Follow the guide "Setting Up ESP-IDF", for Windows, Mac or Linux. You
30
32
only need to perform up to "Step 2" of the guide, by which stage you
31
33
should have installed the cross-compile and cloned the ESP-IDF repository.
32
34
35
+ If you are on a Windows machine then the
36
+ [ Windows Subsystem for Linux] ( https://msdn.microsoft.com/en-au/commandline/wsl/install_guide )
37
+ is the most efficient way to install the ESP32 toolchain and build the project.
38
+ If you use WSL then follow the
39
+ [ Linux guidelines] ( http://esp-idf.readthedocs.io/en/latest/get-started/linux-setup.html )
40
+ for the ESP-IDF instead of the Windows ones.
41
+
33
42
Be advised that the ESP-IDF is still undergoing changes and only some
34
43
versions are supported. To find which build is compatible refer to the line
35
44
in the makefile containing the following:
36
45
```
37
46
ESPIDF_SUPHASH := <Current supported ESP-IDF commit hash>
38
47
```
39
48
After finishing "Step 2" you can roll back your current build of
40
- the ESP-IDF using:
49
+ the ESP-IDF (and update the submodules accordingly) using:
41
50
```
42
51
$ git checkout <Current supported ESP-IDF commit hash>
52
+ $ git submodule update --recursive
43
53
```
44
54
Note that you will get a warning when building the code if the ESP-IDF
45
55
version is incorrect.
46
56
57
+ The Espressif ESP-IDF instructions above only install pyserial for Python 2,
58
+ so if you're running Python 3 or a non-system Python you'll also need to
59
+ install ` pyserial ` (or ` esptool ` ) so that the Makefile can flash the board
60
+ and set parameters:
61
+ ``` bash
62
+ $ pip install pyserial
63
+ ```
64
+
47
65
Once everything is set up you should have a functioning toolchain with
48
66
prefix xtensa-esp32-elf- (or otherwise if you configured it differently)
49
67
as well as a copy of the ESP-IDF repository.
@@ -83,9 +101,17 @@ this repository):
83
101
$ make -C mpy-cross
84
102
```
85
103
104
+ The ESP32 port has a dependency on Berkeley DB, which is an external
105
+ dependency (git submodule). You'll need to have git initialize that
106
+ module using the commands:
107
+ ``` bash
108
+ $ git submodule init lib/berkeley-db-1.xx
109
+ $ git submodule update
110
+ ```
111
+
86
112
Then to build MicroPython for the ESP32 run:
87
113
``` bash
88
- $ cd esp32
114
+ $ cd ports/ esp32
89
115
$ make
90
116
```
91
117
This will produce binary firmware images in the ` build/ ` subdirectory
@@ -97,6 +123,13 @@ for your particular ESP32 module for how to do this. The serial port and
97
123
flash settings are set in the ` Makefile ` , and can be overridden in your
98
124
local ` makefile ` ; see above for more details.
99
125
126
+ You will also need to have user permissions to access the /dev/ttyUSB0 device.
127
+ On Linux, you can enable this by adding your user to the ` dialout ` group,
128
+ and rebooting or logging out and in again.
129
+ ``` bash
130
+ $ sudo adduser < username> dialout
131
+ ```
132
+
100
133
If you are installing MicroPython to your module for the first time, or
101
134
after installing any other firmware, you should first erase the flash
102
135
completely:
@@ -118,7 +151,7 @@ You can get a prompt via the serial port, via UART0, which is the same UART
118
151
that is used for programming the firmware. The baudrate for the REPL is
119
152
115200 and you can use a command such as:
120
153
``` bash
121
- $ picocom /dev/ttyUSB0
154
+ $ picocom -b 115200 /dev/ttyUSB0
122
155
```
123
156
124
157
Configuring the WiFi and using the board
@@ -160,9 +193,9 @@ import machine
160
193
antenna = machine.Pin(16 , machine.Pin.OUT , value = 0 )
161
194
```
162
195
163
-
164
196
Troubleshooting
165
197
---------------
166
198
167
- * Continuous reboots after programming: Ensure FLASH_MODE is correct for your board (e.g. ESP-WROOM-32 should be DIO). Perform a ` make clean ` , rebuild, redeploy.
168
-
199
+ * Continuous reboots after programming: Ensure FLASH_MODE is correct for your
200
+ board (e.g. ESP-WROOM-32 should be DIO). Then perform a ` make clean ` , rebuild,
201
+ redeploy.
0 commit comments