Skip to content

Commit 07be0b1

Browse files
Modify ESP32 build instructions
1 parent 9567e82 commit 07be0b1

File tree

3 files changed

+24
-44
lines changed

3 files changed

+24
-44
lines changed

docs/os-development/building-for-esp32.md

Lines changed: 23 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,32 @@
22

33
Build MicroPythonOS for ESP32 microcontrollers, such as [supported hardware](../getting-started/supported-hardware.md).
44

5-
## Prerequisites
5+
## Get the prerequisites
66

7-
Clone the required repositories:
7+
Clone the repositories:
88

99
```
10-
mkdir ~/MicroPythonOS
11-
cd ~/MicroPythonOS
12-
13-
git clone https://github.com/MicroPythonOS/MicroPythonOS.git
14-
git clone https://github.com/MicroPythonOS/freezeFS
15-
git clone https://github.com/MicroPythonOS/secp256k1-embedded-ecdh
16-
git clone https://github.com/MicroPythonOS/lvgl_micropython
17-
18-
mkdir -p lvgl_micropython/lib/micropython/ports/esp32/main/
19-
echo " espressif/esp32-camera:
20-
git: https://github.com/MicroPythonOS/esp32-camera" >> lvgl_micropython/lib/micropython/ports/esp32/main/idf_component.yml
21-
22-
mkdir -p lvgl_micropython/lib/micropython/ports/unix/variants
23-
echo 'include("$(MPY_DIR)/extmod/asyncio") # This is needed to have asyncio, which is used by aiohttp, which has used by websockets' >> lvgl_micropython/lib/micropython/ports/unix/variants/manifest.py
24-
25-
# Unix builds need these symlinks because they don't handle USER_C_MODULE properly:
26-
ln -s ../../secp256k1-embedded-ecdh lvgl_micropython/ext_mod/secp256k1-embedded-ecdh
27-
ln -s ../../MicroPythonOS/c_mpos lvgl_micropython/ext_mod/c_mpos
28-
29-
git clone https://github.com/cnadler86/micropython-camera-API
30-
pushd micropython-camera-API/
31-
git checkout v0.4.0
32-
echo 'include("~/MicroPythonOS/lvgl_micropython/build/manifest.py")' >> src/manifest.py
33-
popd
10+
git clone --recurse-submodules https://github.com/MicroPythonOS/MicroPythonOS.git
3411
```
3512

36-
## Build Process
13+
That will take a while, because it recursively clones MicroPython, LVGL, ESP-IDF and all their dependencies.
3714

38-
1. **Navigate to the main repository**:
15+
While that's going on, make sure you have everything installed to compile code:
3916

40-
```
41-
cd ~/MicroPythonOS/MicroPythonOS
42-
```
17+
```
18+
sudo apt update
19+
sudo apt-get install -y build-essential libffi-dev pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev libpipewire-0.3-dev libwayland-dev libdecor-0-dev libv4l-dev
20+
```
4321

44-
2. **Build for Production** (includes preinstalled files):
22+
## Compile the code
4523

46-
```
47-
./scripts/build_lvgl_micropython.sh esp32 prod waveshare-esp32-s3-touch-lcd-2
48-
```
49-
50-
or, depending on the device you're building for:
24+
1. **Navigate to the main repository**:
5125

5226
```
53-
./scripts/build_lvgl_micropython.sh esp32 prod fri3d-2024
27+
cd ~/MicroPythonOS
5428
```
5529
56-
3. **Build for Development** (no preinstalled/frozen files):
30+
2. **Start the Compilation**
5731
5832
```
5933
./scripts/build_lvgl_micropython.sh esp32 dev fri3d-2024
@@ -65,17 +39,23 @@ popd
6539
./scripts/build_lvgl_micropython.sh esp32 dev waveshare-esp32-s3-touch-lcd-2
6640
```
6741
68-
## Flashing to ESP32
42+
## Install it on an ESP32
6943
70-
1. Put your ESP32 in bootloader mode (long-press the BOOT button if running MicroPythonOS).
44+
1. Put your ESP32 in bootloader
45+
46+
If you're already in MicroPythonOS: go to Settings - Restart to Bootloader - Bootloader - Save.
47+
48+
Otherwise, physically keep the "BOOT" (sometimes labeled "START") button pressed while briefly pressing the "RESET" button.
7149
7250
2. Flash the firmware:
7351
7452
```
7553
./scripts/flash_over_usb.sh
7654
```
7755
78-
3. For a development build, fill the filesystem with files manually:
56+
After reset, you should find a MicroPython REPL shell on the serial line.
57+
58+
3. Run this script to copy the files to the device manually:
7959
8060
```
8161
./scripts/install.sh
@@ -84,5 +64,5 @@ popd
8464
## Notes
8565
8666
- A "dev" build without frozen files is quite a bit slower when starting apps because all the libraries need to be compiled at runtime.
87-
- Ensure your ESP32 is compatible (see [Supported Hardware](../getting-started/supported-hardware.md)).
67+
- Ensure your ESP32 is compatible (see [Supported Hardware](../getting-started/supported-hardware.md)). If it's not, then you might need the [Porting Guide](../os-development/porting-guide.md).
8868
- Refer to [Release Checklist](release-checklist.md) for creating a production release.
File renamed without changes.

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ nav:
5252
- Building for Linux: os-development/building-for-linux.md
5353
- Building for MacOS: os-development/building-for-macos.md
5454
- Building for ESP32: os-development/building-for-esp32.md
55-
- Porting Guide: os-development/porting.md
55+
- Porting Guide: os-development/porting-guide.md
5656
- Other:
5757
- Release Process: other/release-checklist.md
5858
extra:

0 commit comments

Comments
 (0)