Skip to content

Commit f85c8e5

Browse files
committed
fix: make elf file optional
1 parent 6e449a2 commit f85c8e5

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.0.4 - 2025-07-06
4+
5+
- feat: make `elf` parameter optional in `start_simulation()`
6+
37
## 0.0.3 - 2025-07-01
48

59
- feat: add MicroPython + ESP32 example

docs/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ async def main():
4141
await client.connect()
4242
await client.upload_file("diagram.json")
4343
await client.upload_file("firmware.bin")
44-
await client.upload_file("firmware.elf")
45-
await client.start_simulation(firmware="firmware.bin", elf="firmware.elf")
44+
await client.start_simulation(firmware="firmware.bin")
4645
serial_task = asyncio.create_task(
4746
client.serial_monitor_cat()
4847
) # Stream serial output

examples/micropython_esp32/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ async def main() -> None:
9393
await client.upload(FIRMWARE_NAME, bytes(firmware_data))
9494

9595
# Start the simulation
96-
await client.start_simulation(firmware=FIRMWARE_NAME, elf=FIRMWARE_NAME)
96+
await client.start_simulation(firmware=FIRMWARE_NAME)
9797

9898
# Stream serial output for a few seconds
9999
serial_task = asyncio.create_task(client.serial_monitor_cat())

src/wokwi_client/client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,17 @@ async def upload_file(
8787
async def start_simulation(
8888
self,
8989
firmware: str,
90-
elf: str,
90+
elf: Optional[str] = None,
9191
pause: bool = False,
9292
chips: list[str] = [],
9393
) -> ResponseMessage:
9494
"""
9595
Start a new simulation with the given parameters.
9696
9797
The firmware and ELF files must be uploaded to the simulator first using the
98-
`upload()` or `upload_file()` methods. The firmware and ELF files are required
99-
for the simulation to run.
98+
`upload()` or `upload_file()` methods.
99+
The firmware file is required for the simulation to run.
100+
The ELF file is optional and can speed up the simulation in some cases.
100101
101102
The optional `chips` parameter can be used to load custom chips into the simulation.
102103
For each custom chip, you need to upload two files:
@@ -109,7 +110,7 @@ async def start_simulation(
109110
110111
Args:
111112
firmware: The firmware binary filename.
112-
elf: The ELF file filename.
113+
elf: The ELF file filename (optional).
113114
pause: Whether to start the simulation paused (default: False).
114115
chips: List of custom chips to load into the simulation (default: empty list).
115116

src/wokwi_client/simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ async def start(
1212
transport: Transport,
1313
*,
1414
firmware: str,
15-
elf: str,
15+
elf: Optional[str] = None,
1616
pause: bool = False,
1717
chips: list[str] = [],
1818
) -> ResponseMessage:

0 commit comments

Comments
 (0)