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
Copy file name to clipboardExpand all lines: docs/os-development/emulating-esp32-on-desktop.md
+25-14Lines changed: 25 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,15 +21,19 @@ To this end, we're using the amazing a159x36 QEMU emulator, which can emulate th
21
21
22
22
To get it running, follow these steps:
23
23
24
-
1. Compile QEMU (or get a precompiled build)
24
+
1. Compile the ESP32 QEMU
25
25
2. Pad a MicroPythonOS release image to 16MB (otherwise QEMU refuses it)
26
26
3. Start QEMU with the padded MicroPython release image
27
27
28
+
There are also [GitHub workflows](https://github.com/MicroPythonOS/qemu/tree/esp-develop-9.2/.github/workflows) that compile the ESP32 QEMU for Linux, Windows, MacOS (intel) and MacOS (arm) so you might be able to download a prebuilt version from the [GitHub actions](https://github.com/MicroPythonOS/qemu/actions) artifacts. You need to be logged in to download them.
@@ -70,30 +80,31 @@ Also these are forwarded, although currently unused:
70
80
-`127.0.0.1:10080 to 192.168.4.15:80` when the ESP32 is in Station (WiFi client) mode
71
81
-`127.0.0.1:10081 to 192.168.4.1:80` when the ESP32 is in Access Point (Hotspot) mode
72
82
73
-
**Note**: QEMU will only log to stdout if you start it from a normal shell, with stdin set. If you're starting it from a script or other tool, consider adding "unbuffer" as a prefix to make sure stdin is set, otherwise you won't see much logging.
83
+
**Note**: QEMU will only log to stdout if you start it from a normal shell because then stdin is be set. If you're starting it from a script or other tool that doesn't set stdin, consider adding the `unbuffer` tool as a prefix at the start of the command to make sure stdin is set, otherwise you won't see much logging.
74
84
75
85
## Controls
76
86
77
87
To navigate around in the emulated T-Display S3:
78
88
79
-
- press "r" for the reset button
80
-
- press "1" for the GPIO0 button - "previous"
81
-
- press "2" for the GPIO14 button - "next"
89
+
- press `r` for the reset button
90
+
- press `1` for the GPIO0 button - mapped to the "previous" action
91
+
- press `2` for the GPIO14 button - mapped to the "next" action
82
92
- press both for the "enter" action
83
-
- long press "1" for the "back" action
93
+
- long press `1` for the "back" action
84
94
85
95
You can also click the buttons on the picture of the board if you like.
86
96
87
-
Also, currently unused but:
97
+
Also, currently unused:
98
+
88
99
- 7, 8, 9 and 0 are bound to capacitive touch input pins 0, 1, 11 and 12 which correspond to GPIO01, GPIO02, GPIO12 and GPIO13
89
100
90
101
The code for these controls is in QEMU's `hw/xtensa/esp32s3.c` and `hw/display/st7789v.c`.
91
102
92
103
## Building an image with a filesystem
93
104
94
-
For quick development, rather than doing a full rebuild, you could also just rebuild the filesystem based on internal_filesystem/ and bundle that filesystem in an image.
105
+
For quick development, rather than doing a full rebuild, you could also just rebuild the filesystem based on `internal_filesystem/` and bundle that as a LittleFS2 filesystem in the image.
95
106
96
-
Run `scripts/make_image.sh` from the [MicroPythonOS repo](https://github.com/MicroPythonOS/MicroPythonOS) to do so.
107
+
Run `./scripts/make_image.sh` from the [MicroPythonOS repo](https://github.com/MicroPythonOS/MicroPythonOS) to do so.
97
108
98
-
It will call `scripts/mklittlefs.sh` to build the filesystem and bundle it with all the other requisites, giving you a bootable image in one second.
109
+
It will call `./scripts/mklittlefs.sh` to build the filesystem and bundle it with all the other requisites, giving you a bootable image in one second.
0 commit comments