QEMU Integration
When you create a project using this extension’s commands, a Dockerfile is included for use with the Dev Containers. You can open any project inside a container with the Dev Containers: Open Folder in Container command.
The ESP-IDF setup can include a fork of the Espressif QEMU for Espressif devices, which is used for emulated development. Ensure it is installed by running python $IDF_PATH/tools/idf_tools.py install qemu-xtensa qemu-riscv32 in the ESP-IDF: Open ESP-IDF Terminal terminal.
Note
The ESP-IDF: Add Docker Container Configuration command can be used to add these files to the current project directory.
Development steps:
Prepare a project folder in a container based on the Dockerfile in the template’s
.devcontainerdirectory in this repository. For this you can:Create a project using the
ESP-IDF: New Projectcommand, which includes the.devcontainerdirectory.Use the
ESP-IDF: Add Docker Container Configurationcommand to add the.devcontainerfiles to the currently opened project directory.
Use the
Dev Containers: Open Folder in Containercommand to open the folder within the container.The Dev Containers will build the container from the Dockerfile (if it has not been created before) and install this extension on the container.
The extension should be self-configured; otherwise, run the setup wizard.
Write your code and build the project with the
ESP-IDF: Build your Projectcommand.Use the
ESP-IDF: Launch QEMU Servercommand or the [QEMU Server] link in the activity bar to launch QEMU with the binaries from the build directory.Use the
ESP-IDF: Monitor QEMU Devicecommand to launch a terminal running IDF Monitor on QEMU.To launch a QEMU debug session, use the
ESP-IDF: Launch QEMU Debug Sessioncommmand, which will stop any existing QEMU server and launch a new QEMU server for debugging.
Set the idf.qemuDebugMonitor configuration option to start the monitor after the QEMU debug session is launched. To pass additional arguments, set the idf.qemuExtraArgs configuration option.
An example of "idf.qemuExtraArgs": ["--qemu-extra-args"] can be used to pass additional arguments to QEMU directly, while --flash-file or --efuse-file are idf.py specific arguments as described in the ESP-IDF QEMU Emulator documentation.
Note
The extension assumes that qemu-system-xtensa or qemu-system-riscv32 is available in the environment variable PATH to run ESP-IDF: Monitor QEMU Device and ESP-IDF: Launch QEMU Debug Session.