Skip to content

Instantly share code, notes, and snippets.

@raspiduino
Last active June 22, 2024 04:36
Show Gist options
  • Save raspiduino/aaa093da7fa56344cd6d7f590cad13fc to your computer and use it in GitHub Desktop.
Save raspiduino/aaa093da7fa56344cd6d7f590cad13fc to your computer and use it in GitHub Desktop.
How to build QEMU ESP32 for Windows

How to build QEMU ESP32 for Windows

QEMU ESP32 is a fork of QEMU with Espressif patches for emulating ESP32 microcontroller series. Normally there is prebuilt files in Releases tab, but for some reasons if you want to (or have to) build yourself, then you can follow this guide.

I would recommend Windows environment with MSYS2 for building this. This guide aims at building for x64 architecture, but probably you can do the same for x86 by replacing x86_64 packages with x86 ones.

  • Step 1: Install MSYS2.
  • Step 2: Open MSYS2 MINGW64 prompts.
  • Step 3: Install required packages
pacman -Sy mingw-w64-x86_64-toolchain mingw-w64-x86_64-glib2 mingw-w64-x86_64-dtc mingw-w64-x86_64-pixman mingw-w64-x86_64-ninja mingw-w64-x86_64-meson mingw-w64-x86_64-libgcrypt mingw-w64-x86_64-SDL2 git diffutils
  • Step 4: Clone the source code
git clone https://github.com/espressif/qemu --depth=1 -b esp-develop --single-branch
cd qemu
  • Step 5: Configure
mkdir qemu-esp32-windows-x86_64
./configure --target-list=xtensa-softmmu \
    --enable-gcrypt \
    --enable-slirp \
    --enable-sdl \
    --disable-strip --disable-user \
    --disable-capstone --disable-vnc \
    --disable-gtk \
    --prefix=$PWD/qemu-esp32-windows-x86_64
  • Step 6: Build
ninja -C build
  • Step 7: Install
ninja -C build install

Your built files will be in qemu-esp32-windows-x86_64 directory. Remember that for a standalone version, you need to copy some required DLLs (usually from C:\msys64\mingw64\bin)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment