@@ -489,7 +489,7 @@ install Espressif's precompiled versions of the following tools:
489
489
- ESP32 vendor toolchain (for ESP8266, ESP32, ESP32-S2, ESP32-S3 and ESP32-C3)
490
490
- GDB for ESP32x SoCs based on Xtensa or RISC-V
491
491
- OpenOCD for ESP32 (for ESP32, ESP32-S2, ESP32-S3 and ESP32-C3)
492
- - QEMU for ESP32 (for ESP32, ESP32-S3 and ESP32-C3)
492
+ - QEMU for ESP32x SoCs (for ESP32, ESP32-S3 and ESP32-C3)
493
493
494
494
`$RIOTBASE` defines the root directory of the RIOT repository. The shell
495
495
script takes an argument that specifies which tools to download and install:
@@ -530,7 +530,7 @@ $ . dist/tools/esptools/export.sh
530
530
Usage: export.sh <tool>
531
531
export.sh gdb <platform>
532
532
export.sh qemu <platform>
533
- <tool> = all | esp32 | esp32c3 | esp32s2 | esp32s3 | gdb | openocd | qemu
533
+ <tool> = all | esp8266 | esp32 | esp32c3 | esp32s2 | esp32s3 | gdb | openocd | qemu
534
534
<platform> = xtensa | riscv
535
535
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
536
536
@@ -2108,42 +2108,56 @@ ESP32x SoC variant (family) can be found in ESP-IDF Programming Guide:
2108
2108
2109
2109
RIOT applications that do not require interaction with real hardware such as
2110
2110
GPIOs, I2C or SPI devices, WiFi interface, etc. can also be debugged using
2111
- QEMU for ESP32 . For this purpose, either QEMU for ESP32 must be installed,
2111
+ QEMU. For this purpose, either QEMU for ESP32x SoCs must be installed,
2112
2112
see section [Local Toolchain Installation](#esp32_local_toolchain_installation)
2113
- or the RIOT Docker build image has to be used in which QEMU for ESP32 is already
2113
+ or the RIOT Docker build image has to be used in which QEMU for ESP32x SoCs is already
2114
2114
installed.
2115
2115
2116
- To use QEMU for ESP32 , an application has to be built with `esp_qemu` module
2116
+ To use QEMU for ESP32x SoCs , an application has to be built with `esp_qemu` module
2117
2117
enabled, for example with local toolchain installation
2118
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2118
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.bash
2119
2119
$ USEMODULE=esp_qemu make flash BOARD=esp32-wroom-32 -C tests/sys/shell/
2120
2120
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2121
2121
or with RIOT Docker build image
2122
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2122
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.bash
2123
2123
$ BUILD_IN_DOCKER=1 DOCKER="sudo docker" \
2124
2124
USEMODULE=esp_qemu make flash BOARD=esp32-wroom-32 -C tests/sys/shell/
2125
2125
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2126
2126
2127
2127
Instead of flashing the image to the target hardware, a binary image named
2128
2128
`qemu_flash_image.bin` is created in the target directory. In addition, two ROM
2129
2129
files `rom.bin` and `rom1.bin` are copied to the target directory. These
2130
- files can then be used with QEMU for ESP32 to debug the application in GDB
2130
+ files can then be used with QEMU for ESP32x SoCs to debug the application in GDB
2131
2131
without having the hardware. The binary image `qemu_flash_image.bin`
2132
2132
represents a 4 MByte Flash image.
2133
2133
2134
- QEMU for ESP32 can then be started with command:
2134
+ To start QEMU for ESP32x SoCs, the following command has to be used.
2135
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.bash
2136
+ $ qemu-system-<arch> \
2137
+ -s -machine <esp32x_variant> \
2138
+ -display none \
2139
+ -drive file=<path_to_image>/qemu_flash_image.bin,if=mtd,format=raw \
2140
+ -serial tcp::5555,server,nowait
2135
2141
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2142
+ with
2143
+
2144
+ - `arch` = `xtensa` | `riscv32` and
2145
+ - `esp32x_variant` = `esp32` | `esp32s3` | `esp32c3`.
2146
+
2147
+ For example, for an ESP32, QEMU can be started with command:
2148
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.bash
2136
2149
$ qemu-system-xtensa \
2137
2150
-s -machine esp32 \
2138
- -drive file=tests/sys/shell//bin/esp32-wroom-32/qemu_flash_image.bin,if=mtd,format=raw \
2151
+ -display none \
2152
+ -drive file=tests/sys/shell/bin/esp32-wroom-32/qemu_flash_image.bin,if=mtd,format=raw \
2139
2153
-serial tcp::5555,server,nowait
2140
2154
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2141
2155
2142
- To interact with the application on the emulated ESP32 in QEMU, a second
2156
+ To interact with the application on the emulated ESP32x SoC in QEMU, a second
2143
2157
terminal is required in which the `telnet` command is used to communicate
2144
2158
with the application on `localhost` using TCP port 5555:
2145
2159
2146
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2160
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.bash
2147
2161
$ telnet localhost 5555
2148
2162
2149
2163
Trying 127.0.0.1...
@@ -2162,8 +2176,9 @@ start_test starts a test
2162
2176
...
2163
2177
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2164
2178
2165
- To debug the application in QEMU for ESP32, another terminal is required:
2166
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2179
+ To debug the application in QEMU for a ESP32x SoC, another terminal is required
2180
+ in which the corresponding GDB hast to be started:
2181
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.bash
2167
2182
$ xtensa-esp32-elf-gdb tests/sys/shell//bin/esp32-wroom-32/tests_shell.elf
2168
2183
2169
2184
GNU gdb (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a5) 7.10
@@ -2178,23 +2193,24 @@ pm_set (mode=2) at cpu/esp32/periph/pm.c:117
2178
2193
(gdb)
2179
2194
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2180
2195
2181
- QEMU for ESP32 can also be used in RIOT Docker build image. For that purpose
2182
- QEMU has to be started in the Docker container.
2183
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2196
+ QEMU for ESP32x SoCs can also be used in RIOT Docker build image. For that purpose
2197
+ QEMU has to be started in the Docker container, for example:
2198
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.bash
2184
2199
$ sudo docker run --rm -i -t -u $UID -v $(pwd):/data/riotbuild riot/riotbuild
2185
2200
riotbuild@container-id:~$ USEMODULE=esp_qemu make flash BOARD=esp32-wroom-32 -C tests/sys/shell/
2186
2201
riotbuild@container-id:~$ qemu-system-xtensa \
2187
2202
-s -machine esp32 \
2188
- -drive file=tests/sys/shell//bin/esp32-wroom-32/qemu_flash_image.bin,if=mtd,format=raw \
2203
+ -display none \
2204
+ -drive file=tests/sys/shell/bin/esp32-wroom-32/qemu_flash_image.bin,if=mtd,format=raw \
2189
2205
-serial tcp::5555,server,nowait
2190
2206
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2191
2207
2192
2208
In a second and a third terminal, you need to execute a shell in the same RIOT
2193
- Docker container where QEMU for ESP32 was started. The required container ID
2194
- `<container-id>` is shown in the prompt of the terminal in which QEMU for ESP32
2209
+ Docker container where QEMU was started. The required container ID
2210
+ `<container-id>` is shown in the prompt of the terminal in which QEMU
2195
2211
was started.
2196
2212
2197
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2213
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.bash
2198
2214
$ sudo docker docker exec -it <container-id> bash
2199
2215
riotbuild@container-id:~$telnet localhost 5555
2200
2216
@@ -2207,7 +2223,7 @@ test_shell.
2207
2223
>
2208
2224
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2209
2225
2210
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2226
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.bash
2211
2227
$ sudo docker docker exec -it <container-id> bash
2212
2228
riotbuild@container-id:~$ xtensa-esp32-elf-gdb tests/sys/shell//bin/esp32-wroom-32/tests_shell.elf
2213
2229
0 commit comments