Skip to content

update instructions on simulation by Wokwi #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "esp32_c3_lcdkit - Wokwi GDB",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build.esp32_c3_lcdkit/esp32-sdl3-swift-example.elf",
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"miDebuggerPath": "${command:espIdf.getToolchainGdb}",
"miDebuggerServerAddress": "localhost:3333"
},
{
"name": "esp32_c6_devkit - Wokwi GDB",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build.esp32_c6_devkit/esp32-sdl3-swift-example.elf",
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"miDebuggerPath": "${command:espIdf.getToolchainGdb}",
"miDebuggerServerAddress": "localhost:3333"
},
{
"name": "esp32_p4_function_ev_board - Wokwi GDB",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build.esp32_p4_function_ev_board/esp32-sdl3-swift-example.elf",
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"miDebuggerPath": "${command:espIdf.getToolchainGdb}",
"miDebuggerServerAddress": "localhost:3333"
},
]
}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ idf.py @boards/esp32_c6_devkit.cfg menuconfig
idf.py @boards/esp32_c6_devkit.cfg flash monitor
```

### Run simulation in VS Code

- Build the project, to get binaries for simulation.
- Install [Wokwi for VS Code](https://docs.wokwi.com/vscode/getting-started/).
- Open file `boards/esp32_.../diagram.json`.
- Click Play button to start simulation.
- Click Pause button to freeze simulation and display states of GPIOs.

## Credits

- Graphical assets: https://opengameart.org/content/platformer-tiles
Expand Down
6 changes: 3 additions & 3 deletions boards/esp32_c3_lcdkit/wokwi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Reference: https://docs.wokwi.com/vscode/project-config
[wokwi]
version = 1
firmware = 'build.esp32_c3_lcdkit/flasher_args.json'
elf = 'build.esp32_c3_lcdkit/esp32-sdl3-swift-example.elf'
gdbServerPort=3333
firmware = '../../build.esp32_c3_lcdkit/flasher_args.json'
elf = '../../build.esp32_c3_lcdkit/esp32-sdl3-swift-example.elf'
# gdbServerPort=3333
60 changes: 28 additions & 32 deletions boards/esp32_c6_devkit/diagram.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
{
"version": 1,
"author": "Juraj Michálek",
"editor": "wokwi",
"parts": [
{
"type": "board-esp32-c6-devkitc-1",
"id": "esp",
"top": -494.32,
"left": -455.03
},
{
"type": "wokwi-ili9341",
"id": "lcd1",
"top": -546.22,
"left": -134.92
}
],
"connections": [
[ "esp:TX", "$serialMonitor:RX", "", [] ],
[ "esp:RX", "$serialMonitor:TX", "", [] ],
[ "esp:3V3", "lcd1:VCC", "green", [] ],
[ "esp:GND.1", "lcd1:GND", "black", [] ],
[ "esp:6", "lcd1:SCK", "blue", [] ],
[ "esp:7", "lcd1:MOSI", "orange", [] ],
[ "esp:20", "lcd1:CS", "red", [] ],
[ "esp:21", "lcd1:D/C", "magenta", [] ],
[ "esp:3", "lcd1:RST", "yellow", [] ],
[ "lcd1:LED", "esp:3V3", "white", [] ]
],
"serialMonitor": { "display": "terminal" },
"dependencies": {}
}
"version": 1,
"author": "Juraj Michálek",
"editor": "wokwi",
"parts": [
{
"type": "board-esp32-c6-devkitc-1",
"id": "esp",
"top": -494.32,
"left": -455.03,
"attrs": {}
},
{ "type": "wokwi-ili9341", "id": "lcd1", "top": -546.22, "left": -134.92, "attrs": {} }
],
"connections": [
[ "esp:TX", "$serialMonitor:RX", "", [] ],
[ "esp:RX", "$serialMonitor:TX", "", [] ],
[ "esp:3V3", "lcd1:VCC", "green", [ "v221.21", "h362.93" ] ],
[ "esp:GND.1", "lcd1:GND", "black", [ "h-11.25", "v86.81", "h383.78" ] ],
[ "esp:6", "lcd1:SCK", "blue", [ "h-40.05", "v240.41", "h460.59" ] ],
[ "esp:7", "lcd1:MOSI", "orange", [ "h-30.45", "v221.21", "h441.39" ] ],
[ "esp:20", "lcd1:CS", "red", [ "h16.45", "v173.21", "h278.18" ] ],
[ "esp:21", "lcd1:D/C", "magenta", [ "h26.05", "v202.01", "h287.78" ] ],
[ "esp:3", "lcd1:RST", "yellow", [ "h-20.85", "v134.81", "h412.58" ] ],
[ "lcd1:LED", "esp:3V3", "white", [ "v86.22", "h-479.79", "v-288.41" ] ]
],
"serialMonitor": { "display": "terminal" },
"dependencies": {}
}
6 changes: 3 additions & 3 deletions boards/esp32_c6_devkit/wokwi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Reference: https://docs.wokwi.com/vscode/project-config
[wokwi]
version = 1
firmware = 'build.esp32_c6_devkit/flasher_args.json'
elf = 'build.esp32_c6_devkit/esp32-sdl3-swift-example.elf'
gdbServerPort=3333
firmware = '../../build.esp32_c6_devkit/flasher_args.json'
elf = '../../build.esp32_c6_devkit/esp32-sdl3-swift-example.elf'
# gdbServerPort=3333
6 changes: 3 additions & 3 deletions boards/esp32_p4_function_ev_board/wokwi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Reference: https://docs.wokwi.com/vscode/project-config
[wokwi]
version = 1
firmware = 'build.esp32_p4_function_ev_board/flasher_args.json'
elf = 'build.esp32_p4_function_ev_board/esp32-sdl3-swift-example.elf'
gdbServerPort=3333
firmware = '../../build.esp32_p4_function_ev_board/flasher_args.json'
elf = '../../build.esp32_p4_function_ev_board/esp32-sdl3-swift-example.elf'
# gdbServerPort=3333
17 changes: 0 additions & 17 deletions diagram.json

This file was deleted.

7 changes: 0 additions & 7 deletions wokwi.toml

This file was deleted.