@@ -489,7 +489,7 @@ install Espressif's precompiled versions of the following tools:
489489- ESP32 vendor toolchain (for ESP8266, ESP32, ESP32-S2, ESP32-S3 and ESP32-C3)
490490- GDB for ESP32x SoCs based on Xtensa or RISC-V
491491- 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)
493493
494494`$RIOTBASE` defines the root directory of the RIOT repository. The shell
495495script takes an argument that specifies which tools to download and install:
@@ -530,7 +530,7 @@ $ . dist/tools/esptools/export.sh
530530Usage: export.sh <tool>
531531 export.sh gdb <platform>
532532 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
534534<platform> = xtensa | riscv
535535~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
536536
@@ -2108,42 +2108,56 @@ ESP32x SoC variant (family) can be found in ESP-IDF Programming Guide:
21082108
21092109RIOT applications that do not require interaction with real hardware such as
21102110GPIOs, 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,
21122112see 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
21142114installed.
21152115
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
21172117enabled, for example with local toolchain installation
2118- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2118+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.bash
21192119$ USEMODULE=esp_qemu make flash BOARD=esp32-wroom-32 -C tests/sys/shell/
21202120~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21212121or with RIOT Docker build image
2122- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2122+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.bash
21232123$ BUILD_IN_DOCKER=1 DOCKER="sudo docker" \
21242124 USEMODULE=esp_qemu make flash BOARD=esp32-wroom-32 -C tests/sys/shell/
21252125~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21262126
21272127Instead of flashing the image to the target hardware, a binary image named
21282128`qemu_flash_image.bin` is created in the target directory. In addition, two ROM
21292129files `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
21312131without having the hardware. The binary image `qemu_flash_image.bin`
21322132represents a 4 MByte Flash image.
21332133
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
21352141~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
21362149$ qemu-system-xtensa \
21372150 -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 \
21392153 -serial tcp::5555,server,nowait
21402154~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21412155
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
21432157terminal is required in which the `telnet` command is used to communicate
21442158with the application on `localhost` using TCP port 5555:
21452159
2146- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2160+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.bash
21472161$ telnet localhost 5555
21482162
21492163Trying 127.0.0.1...
@@ -2162,8 +2176,9 @@ start_test starts a test
21622176...
21632177~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21642178
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
21672182$ xtensa-esp32-elf-gdb tests/sys/shell//bin/esp32-wroom-32/tests_shell.elf
21682183
21692184GNU 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
21782193(gdb)
21792194~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21802195
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
21842199$ sudo docker run --rm -i -t -u $UID -v $(pwd):/data/riotbuild riot/riotbuild
21852200riotbuild@container-id:~$ USEMODULE=esp_qemu make flash BOARD=esp32-wroom-32 -C tests/sys/shell/
21862201riotbuild@container-id:~$ qemu-system-xtensa \
21872202 -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 \
21892205 -serial tcp::5555,server,nowait
21902206~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21912207
21922208In 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
21952211was started.
21962212
2197- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2213+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.bash
21982214$ sudo docker docker exec -it <container-id> bash
21992215riotbuild@container-id:~$telnet localhost 5555
22002216
@@ -2207,7 +2223,7 @@ test_shell.
22072223>
22082224~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22092225
2210- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2226+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.bash
22112227$ sudo docker docker exec -it <container-id> bash
22122228riotbuild@container-id:~$ xtensa-esp32-elf-gdb tests/sys/shell//bin/esp32-wroom-32/tests_shell.elf
22132229
0 commit comments