Is there a good esp8266 simulator software that can be used to automate testing? Is it possible to get code written on Arduino IDE to run on these simulators?
As of Jan 2023...
The docs for the RIOT OS (an IoT OS) explain how to compile and use an ESP8266 version of QEMU for Xtensa. The docs contain the compile instructions:
cd /my/source/dir
git clone https://github.com/gschorcht/qemu-xtensa
cd qemu-xtensa/
git checkout xtensa-esp8266
export QEMU=/path/to/esp/qemu
./configure --prefix=$QEMU --target-list=xtensa-softmmu --disable-werror
make
make install
Actually, the gschorcht/qemu-xtensa
repo (last updated 2018) is a fork of the original OSLL/qemu-xtensa
project, so you could use the original repo:
cd /my/source/dir
git clone https://github.com/OSLL/qemu-xtensa
cd qemu-xtensa/
git checkout xtensa-esp8266
export QEMU=/path/to/esp/qemu
./configure --prefix=$QEMU --target-list=xtensa-softmmu --disable-werror
make
make install
Unfortunately, that branch hasn't been updated since 2019 so it may not compile on very recent OS versions. For instance, I got an error: expected unqualified-id
error while trying to compile on macOS 12.14. So, someone probably needs to fix those compile errors.
configure --disable-werror --target-list=xtensa-softmmu --python=python2.7 --prefix=$QEMU
. –
Ruche error: expected unqualified-id
is a result of the case-insensitive file system that Mac OS uses by default. During compilation the version
header file from the standard library should be included, but the VERSION
file from the repo is in the way -.-. You can find a fix in a separate answer below. –
Coincide I think that you could simulate esp8266 using the xtensa-esp8266 branch of OSLL/qemu-xtensa which you have to compile yourself.
Compiled binary can be called with the command:
qemu-system-xtensa -machine esp8266 -nographic -kernel <your-project>/sketch/app.out -S -s
As of Jan 2023...
The docs for the RIOT OS (an IoT OS) explain how to compile and use an ESP8266 version of QEMU for Xtensa. The docs contain the compile instructions:
cd /my/source/dir
git clone https://github.com/gschorcht/qemu-xtensa
cd qemu-xtensa/
git checkout xtensa-esp8266
export QEMU=/path/to/esp/qemu
./configure --prefix=$QEMU --target-list=xtensa-softmmu --disable-werror
make
make install
Actually, the gschorcht/qemu-xtensa
repo (last updated 2018) is a fork of the original OSLL/qemu-xtensa
project, so you could use the original repo:
cd /my/source/dir
git clone https://github.com/OSLL/qemu-xtensa
cd qemu-xtensa/
git checkout xtensa-esp8266
export QEMU=/path/to/esp/qemu
./configure --prefix=$QEMU --target-list=xtensa-softmmu --disable-werror
make
make install
Unfortunately, that branch hasn't been updated since 2019 so it may not compile on very recent OS versions. For instance, I got an error: expected unqualified-id
error while trying to compile on macOS 12.14. So, someone probably needs to fix those compile errors.
configure --disable-werror --target-list=xtensa-softmmu --python=python2.7 --prefix=$QEMU
. –
Ruche error: expected unqualified-id
is a result of the case-insensitive file system that Mac OS uses by default. During compilation the version
header file from the standard library should be included, but the VERSION
file from the repo is in the way -.-. You can find a fix in a separate answer below. –
Coincide For those who like me came here and failed to install QEMU for ESP2866 on MacOS... I found the reason for error: expected unqualified-id
and fixed it in my fork of the OSLL/qemu-xtensa
repo. Simply follow the steps below:
# IMPORTANT:
# Make sure you have Python2.7 for Mac OS installed, downloadable from here:
# https://www.python.org/downloads/release/python-2718/
git clone http://github.com/weese/qemu-xtensa -b xtensa-esp8266 --depth 1
cd qemu-xtensa
export QEMU=/usr/local/qemu-esp8266
git submodule init dtc
git submodule update dtc
./configure --prefix=$QEMU --target-list=xtensa-softmmu --disable-werror --python=python2.7
make -j 8
sudo make install
Then you should be able to run:
/usr/local/qemu-esp8266/bin/qemu-system-xtensa
© 2022 - 2024 — McMap. All rights reserved.