I’ve been looking into this space recently while exploring ESP32 emulation.
I came across this repo: https://github.com/lcgamboa/qemu/
which is quite interesting, but it’s not really a JavaScript/browser-based simulation. It relies on QEMU and actual hardware emulation rather than running in a JS/WebAssembly environment.
From what I can tell, it handles the Xtensa architecture at a much lower level, which makes sense for accuracy, but also makes it harder to bring into the browser.
It made me wonder whether a higher-level approach (similar to how AVR emulators work in JS) could be viable for ESP32, or if the complexity of peripherals (WiFi, BLE, etc.) makes that impractical.
Curious if anyone has explored alternative approaches here.
Has anyone explored this or knows of existing approaches/tools?
Is there a reason for Javascript Specifically? My team has recently been using https://renode.io/ for this kind of task and it's working exceptionally well. Though they don't yet support ESP32, depending on your needs/goals working with them to get ESP32 support may be the most effective path.
Thanks, I didn’t know about Renode.I’ll definitely take a look.
The reason I’m specifically exploring JavaScript is because of a project I’m working on (velxio.dev), where everything runs in the browser, so having a JS/WASM-based approach would make integration much simpler
Right now I’m experimenting with a QEMU based setup and exposing it through WebSockets, but the performance isn’t great and the emulation tends to be unstable (I’ve been hitting crashes under certain workloads).
That’s partly why I’m looking into alternative approaches , either pushing more into the browser, or finding a more robust backend model.
One thing that’s been particularly frustrating is trying to find complete documentation for Xtensa. I’ve looked around quite a bit, and it feels like there isn’t a fully open, detailed spec available. Most of what exists is either partial, behind NDA, or spread across different sources.
I’ve been looking into this space recently while exploring ESP32 emulation.
I came across this repo: https://github.com/lcgamboa/qemu/ which is quite interesting, but it’s not really a JavaScript/browser-based simulation. It relies on QEMU and actual hardware emulation rather than running in a JS/WebAssembly environment.
From what I can tell, it handles the Xtensa architecture at a much lower level, which makes sense for accuracy, but also makes it harder to bring into the browser.
It made me wonder whether a higher-level approach (similar to how AVR emulators work in JS) could be viable for ESP32, or if the complexity of peripherals (WiFi, BLE, etc.) makes that impractical.
Curious if anyone has explored alternative approaches here.
Has anyone explored this or knows of existing approaches/tools?
Is there a reason for Javascript Specifically? My team has recently been using https://renode.io/ for this kind of task and it's working exceptionally well. Though they don't yet support ESP32, depending on your needs/goals working with them to get ESP32 support may be the most effective path.
Thanks, I didn’t know about Renode.I’ll definitely take a look.
The reason I’m specifically exploring JavaScript is because of a project I’m working on (velxio.dev), where everything runs in the browser, so having a JS/WASM-based approach would make integration much simpler
Right now I’m experimenting with a QEMU based setup and exposing it through WebSockets, but the performance isn’t great and the emulation tends to be unstable (I’ve been hitting crashes under certain workloads).
That’s partly why I’m looking into alternative approaches , either pushing more into the browser, or finding a more robust backend model.
Appreciate the suggestion!
The main issue is that ESP32 uses the Xtensa architecture, which is significantly more complex than something like an ATmega328
One thing that’s been particularly frustrating is trying to find complete documentation for Xtensa. I’ve looked around quite a bit, and it feels like there isn’t a fully open, detailed spec available. Most of what exists is either partial, behind NDA, or spread across different sources.
68K and x86 emulators in JS/WASM exist so ESP32 is totally possible.