4

I'm very new to microcontrollers. I'd like to start developing for the esp32, as it has integrated wifi & bluetooth for quite cheap. This being said, i don't have a board yet. Is there a way i can emulate an esp32 board, so i can start programming and debugging my code?

As i'm very new, any advice is welcome.

Thanks

3
  • I don't think there are a lot of websites or software that allow you to emulate a microcontroller, to my knowledge I know a site called circuito.io that has a lot of options for components and code but does not actually emulate, or you could try tinkercad.com and it supports emulation of a few boards, but I'm not too sure about esp32
    – Coder9390
    Commented May 14, 2021 at 11:02
  • I see. I will make sure to check them out. Thanks for the hint :)
    – user76979
    Commented May 14, 2021 at 12:53
  • stackoverflow.com/questions/67330695/… similar question which can be merged
    – Sonder
    Commented Oct 11, 2021 at 14:39

2 Answers 2

3

Welcome to Arduino Stack exchange. There are a lot of discussions and half-completed, or project-specific models available for the ESP32 simulator. My sincere advice is to go ahead and buy real hardware. By the time you take to set up the simulators (download the repo, set environment variables, connect GDB debugger or other), you would have received the ESP32 hardware itself.

Why you should go for real hardware?

  • An emulator can never match the timing of real ESP32 hardware. if you have any timing-related issue, you cannot fix it using an ESP32 emulator
  • Real issues in hardware (bounce/debounce of switches, surge current and brownout voltages, rise time and reflections etc - won't appear in the ESP32 simulators
  • EMC issues due to floating inputs, Port pin current limits or even self-heating of components are not considered in most the simulators
  • A code running on the emulator can't always run on the real hardware without modifications, especially when it involved multiple threads and priorities

Still, other options are available online but it depends on your comfort

  • ESP32 Simulator by Wokwi - The ESP32 Simulator is currently in preview (affiliation disclosure)

  • ESP32 simulator from mireq - ESP-IDF contains a small amount of hardware-specific code, FreeRTOS and few multi-platform libraries. This project uses FreeRTOS port for POSIX, LWIP for TCP/IP layer and mbedtls for cryptography functions. In addition, several useful APIs from esp-idf are implemented eg. logging. With this project, you can write a program, which will be runnable and testable on Linux.

  • ESP32 machine emulator - The purpose of this package is to enable you to test-drive (TDD) your MicroPython code in an IDE running on your computer. It seems a lot of people are test-driving python, but not many are test-driving MicroPython. That’s understandable, since many MicroPython projects are simple, and emulating real hardware in a test environment is difficult.

  • Bridges - Pretend your PC a Raspberry Pi or an ESP32 to connect I2C / SPI / GPIO / UART peripherals.

Note You should also check when is the last time the projects were updated. The latest ones and active ones are always a better choice as they are expected to have better usability, and stable simulations.


A few screenshots from Wokwi ESP32 Simulator

enter image description here
enter image description here

0

If you are new to microcontrollers then start with basic arduino code and components. Since the esp chips can be coded with the Arduino framework it will be an almost seemless transition from Arduino board to ESP board. Build some circuits on tinkercad.com, write some code, and simulate them. Once you have those basics down hopefully your esp board will have arrived and you can start building your project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.