-
Notifications
You must be signed in to change notification settings - Fork 388
Open
Description
Hi,
Firstly, a big THANK YOU for the amazing project! Glad to see that @platformio users found it useful.
See initial platformio/platformio-core#3965 posted by @adbancroft.
There is a problem with data buffering on the SimAVR/Windows side. Possible solutions:
- https://stackoverflow.com/questions/12450066/flushing-buffers-in-c
- https://stackoverflow.com/questions/7876660/how-to-turn-off-buffering-of-stdout-in-c
Please note that it works great on Unix.
How to reproduce?
I've just created a simple Python script and tried to redirect standard streams to the PIPE. Subsequent reading of 1 byte hangs Python script. See code
simavr.py
import sys
import subprocess
if __name__ == "__main__":
with subprocess.Popen(
sys.argv[1:],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
bufsize=0,
) as proc:
print("reading...")
proc.stdout.read(1)
print("reading is done.")
Call SimAVR using Python bridge/script:
python simavr.py bin/simavr -m atmega328p -f 16000000L firmware.elf
Metadata
Metadata
Assignees
Labels
No labels