lcgamboa / qemu

This fork contains a modified version of the Espressif QEMU used by the PICSimLab simulator. This version has been altered to compile QEMU as a dynamic library. Additionally, this fork adds support for WIFI to the Espressif QEMU.

Home Page:http://www.qemu.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QEMU for use with PICSimLab

This fork contains a modified version of the Espressif QEMU used by the PICSimLab simulator. This version has been altered to compile QEMU as a dynamic library using the build_libqemu-esp32.sh script.

Additionally, this fork adds support for WIFI from the a159x36 QEMU fork to the Espressif QEMU.

Official QEMU README

Differences from the Espressif QEMU fork

  • Support for compiling as a dynamic library
  • WIFI support (Station and SoftAP modes) for ESP32 and ESP32C3
  • ESP-NOW protocol support for ESP32 and ESP32C3
  • ESP32 an ESP32C3 IOMUX

Using WIFI support

To enable WIFI support, pass the following option in the command line:

For ESP32: "-nic user,model=esp32_wifi":

qemu-system-xtensa -M esp32-picsimlab -drive file=flash_file.bin,if=mtd,format=raw \
  -drive file=esp32_file.efuse,if=none,format=raw,id=efuse \
  -global driver=nvram.esp32.efuse,property=drive,value=efuse \
  -serial stdio -gdb tcp::1234 -global driver=timer.esp32.timg,property=wdt_disable,value=true \
  -nic user,model=esp32_wifi,net=192.168.4.0/24,hostfwd=tcp::16555-192.168.4.15:80 

For ESP32C3 -nic user,model=esp32c3_wifi:

./qemu-system-riscv32 -M esp32c3-picsimlab -drive file=flash_file.bin,if=mtd,format=raw \
  -drive file=esp32c3.efuse,if=none,format=raw,id=efuse \
  -global driver=nvram.esp32c3.efuse,property=drive,value=efuse \
  -serial stdio -gdb tcp::1234 -icount shift=3,align=off,sleep=on \
  -global driver=timer.esp32c3.timg,property=wdt_disable,value=true \
  -nic user,model=esp32c3_wifi,net=192.168.4.0/24,hostfwd=tcp::16555-192.168.4.15:80

In Station mode, you must use one of the hardcoded SSIDs (PICSimLabWifi, Espressif, or MasseyWifi) without a password.

The MAC address is defined for for ESP32C3 in bytes from offset 0x18 to 0x1D in the efuse file. For ESP32 in bytes from offset 0x4 to 0x9 and the MAC CRC inf offset 0xA in the efuse file.

For use with ESP-NOW, configure the WIFI interface as socket mcast and ensure each device has a different MAC address in the .efuse file.

-nic socket,model=esp32_wifi,id=u1,mcast=230.0.0.1:1234

About

This fork contains a modified version of the Espressif QEMU used by the PICSimLab simulator. This version has been altered to compile QEMU as a dynamic library. Additionally, this fork adds support for WIFI to the Espressif QEMU.

http://www.qemu.org

License:Other


Languages

Language:C 80.9%Language:C++ 11.5%Language:Python 3.9%Language:Shell 1.5%Language:Assembly 0.5%Language:Meson 0.5%Language:Haxe 0.4%Language:Perl 0.2%Language:Objective-C 0.1%Language:Makefile 0.1%Language:SourcePawn 0.1%Language:POV-Ray SDL 0.1%Language:Yacc 0.0%Language:Pawn 0.0%Language:SmPL 0.0%Language:Lex 0.0%Language:NASL 0.0%Language:NSIS 0.0%Language:Dockerfile 0.0%Language:GLSL 0.0%Language:GDB 0.0%Language:Vim Script 0.0%Language:Emacs Lisp 0.0%