是否有用于测试在 Arduino IDE 上编写的代码的 esp8266 模拟器?

amb*_*llo 6 esp8266 arduino-esp8266

有没有好的esp8266模拟器软件可以用来自动化测试?是否可以让在 Arduino IDE 上编写的代码在这些模拟器上运行?

小智 5

我认为您可以使用https://github.com/OSLL/qemu-xtensa/tree/xtensa-esp8266模拟 esp8266 不幸的是,您必须自己编译 qemu-xtensa。编译后的二进制文件可以这样调用:qemu-system-xtensa -machine esp8266 -nographic -kernel <your-project>/sketch/app.out -S -s


Nic*_*ton 2

截至 2023 年 1 月...

RIOT OS(物联网操作系统)的文档解释了如何为 Xtensa 编译和使用 ESP8266 版本的 QEMU。该文档包含编译说明:

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
Run Code Online (Sandbox Code Playgroud)

实际上,该gschorcht/qemu-xtensa存储库(最后更新于 2018 年)是原始OSLL/qemu-xtensa项目的一个分支,因此您可以使用原始存储库:

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
Run Code Online (Sandbox Code Playgroud)

不幸的是,该分支自 2019 年以来一直没有更新,因此它可能无法在最新的操作系统版本上编译。例如,我error: expected unqualified-id在 macOS 12.14 上尝试编译时遇到错误。因此,有人可能需要修复这些编译错误。

  • 我使用以下配置命令成功在 Linux Mint 20.2、内核版本 5.4.0-137 上构建 gschorcht 克隆:`configure --disable-werror --target-list=xtensa-softmmu --python=python2.7 --前缀=$QEMU`。 (2认同)