swift-embedded-examples icon indicating copy to clipboard operation
swift-embedded-examples copied to clipboard

ESP32-C6 - Add Wokwi Simulation

Open georgik opened this issue 7 months ago • 1 comments

The PR adds ESP32-C6 simulation to ESP32 projects. A developer can experience the simulation of the project directly in browser or a developer can work with Swift even without having real HW.

The following files were added to root of ESP projects:

  • wokwi.toml - points to UF2 binary within the project, so the simulator knows where to find the binary
  • diagram.json - contains description of HW connections for simulator to visualize it

A developer should build an UF2 binary image for the simulator using command:

idf.py uf2

A developer can open VS Code, Espressif IDE or CLion/JetBrains with Wokwi plugin and run the simulation.

Another option is to open the link directly from README which is pointing to release of the image and a developer can see the result in browser, including serial console output.

Example of the link: https://wokwi.com/experimental/viewer?diagram=https://raw.githubusercontent.com/georgik/swift-embedded-examples/feature/wokwi/esp32-led-blink-sdk/diagram.json&firmware=https://github.com/georgik/swift-embedded-examples/releases/download/v0.1/embedded-swift-esp32-c6-led-blink-sdk.uf2.bin

Topics to discuss before merging:

  • Binaries were uploaded to forked repo Releases. Do you prefere to upload it into official repo and change the links?
  • The same text about the simulation was added to both ESP32 projects. Would you recommend other method to share the simulator specific instructions?
  • The rgb lights in the simulator are not very visible, since Swift code is setting values from 0-16, I've created a request to change the baseline for simulation of those values, since it's perfectly visible on real HW.

I would appreciate your comments @rauhul, @kubamracek, @urish

georgik avatar Jul 22 '24 12:07 georgik