Description
I've successfully used the emulator for running some PlatformIO/Arduino sketches. PlatformIO used IDF v3.3.5.
Recently I switched to IDF v4.4 and ever since the application doesn't run in the emulator anymore. It does run fine when I flash it to the actual hardware, so it looks like the code that's generated runs fine, generally speaking.
I'm running qemu with the following options:
bin/qemu-system-xtensa -nographic -machine esp32 -drive file=../flash_image.bin,if=mtd,format=raw -global driver=esp32.gpio,property=strap_mode,value=0x12 -drive file=../efuse/qemu_efuse.bin,if=none,format=raw,id=efuse -global driver=nvram.esp32.efuse,property=drive,value=efuse
The output I'm getting is
==22289==WARNING: ASan doesn't fully support makecontext/swapcontext functions and may produce false positives in some cases!
Adding SPI flash device
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1284
load:0x40078000,len:12808
load:0x40080400,len:3032
entry 0x400805e4
ets ets Jul 29 2019 12:21:46
rst:0x7 (TG0WDT_SYS_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1284
load:0x40078000,len:12808
load:0x40080400,len:3032
entry 0x400805e4
It basically runs into a watchdog timeout. If I disable the watchdog, nothing happens at all.
Please let me know what other useful information I can provide to debug the problem. I upload the firmware through esptool.py and setting the esp32.gpio.property value to 0x01 and writing to the socket:
esptool.py v3.1
Serial port socket://localhost:5555
Connecting...
Device PID identification is only supported on COM and /dev/ serial ports.
Chip is ESP32-D0WDQ6-V3 (revision 3)
Features: WiFi, BT, Dual Core, Coding Scheme None
Crystal is 40MHz
MAC: 00:00:00:00:00:00
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x000bafff...
Compressed 17216 bytes to 11867...
Writing at 0x00001000... (100 %)
Wrote 17216 bytes (11867 compressed) at 0x00001000 in 0.6 seconds (effective 229.0 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 611.6 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 627.1 kbit/s)...
Hash of data verified.
Compressed 698432 bytes to 445097...
Writing at 0x00010000... (3 %)
Writing at 0x0001d172... (7 %)
Writing at 0x0002a21e... (10 %)
[...]
Writing at 0x000b3f48... (96 %)
Writing at 0x000b9890... (100 %)
Wrote 698432 bytes (445097 compressed) at 0x00010000 in 21.0 seconds (effective 266.5 kbit/s)...
Hash of data verified.
Leaving...