summaryrefslogtreecommitdiff
path: root/tools/pyboard.py
AgeCommit message (Collapse)Author
2017-07-22tools/pyboard: Add license header.Paul Sokolovsky
2017-05-29various: Spelling fixesVille Skyttä
2017-04-07tools/pyboard: Provide more details when expected reply not received.Paul Sokolovsky
When trying to execute a command via raw REPL and expected "OK" reply not received, show what was received instead.
2017-04-05tools/pyboard: ProcessPtyToTerminal: Add workaround for PySerial bug.Paul Sokolovsky
When working with a "virtual" port, like PTY. The issue described in http://stackoverflow.com/questions/34831131/pyserial-does-not-play-well-with-virtual-port
2017-04-05tools/pyboard: execpty: Use shell=False to workaround some curdir issues.Paul Sokolovsky
Without this, Zephyr's port "make test" doesn't work.
2017-04-04tools/pyboard: Add "exec" and "execpty" pseudo-devices support.Paul Sokolovsky
This allows to execute a command and communicate with its stdin/stdout via pipes ("exec") or with command-created pseudo-terminal ("execpty"), to emulate serial access. Immediate usecase is controlling a QEMU process which emulates board's serial via normal console, but it could be used e.g. with helper binaries to access real board over other hadware protocols, etc. An example of device specification for these cases is: --device exec:../zephyr/qemu.sh --device execpty:../zephyr/qemu2.sh Where qemu.sh contains long-long qemu startup line, or calls another command. There's a special support in this patch for running the command in a new terminal session, to support shell wrappers like that (without new terminal session, only wrapper script would be terminated, but its child processes would continue to run).
2017-04-02tools/pyboard: Tighten up Pyboard object closure on errors.Paul Sokolovsky
Some "device" implementations may be sensitive to this.
2016-12-15tools/pyboard.py: Refactor so target is not reset between scripts/cmd.Damien George
Previous to this patch pyboard.py would open a new serial connection to the target for each script that was run, and for any command that was run. Apart from being inefficient, this meant that the board was soft-reset between scripts/commands, which precludes scripts from accessing variables set in a previous one. This patch changes the behaviour of pyboard.py so that the connection to the target is created only once, and it's not reset between scripts or any command that is sent with the -c option.
2015-12-08tools: Fix pyboard.py to work under Python 3.Damien George
2015-12-08tools: Add option to pyboard.py to wait for serial device to be ready.Peter Hinch
Also prints a nicer error message if the serial connection could not be established.
2015-12-06tools: Allow pyboard.py to work when boot.py prints things.Dave Hylands
2015-11-07tools/pyboard.py: Don't add terminating \x04 character to stdout output.Paul Sokolovsky
2015-11-07tools/pyboard.py: Make -c (inline Python code) option compatible with python2.Paul Sokolovsky
2015-10-19tools/pyboard: Add -c argument to run a program passed as a string.Tom Soulanille
2015-08-08tools: Make pyboard.py Python2 compatible.Damien George
2015-07-29tools/pyboard.py: Fix read timeout calc to work with shorter sleep.Damien George
2015-07-26tools: Add telnet support to pyboard.py.Daniel Campora
The adapter class "TelnetToSerial" is used to access the Telnet connection using the same API as with the serial connection. The function pyboard.run-test() has been removed to made the module generic and because this small test is no longer needed.
2015-07-25tools/pyboard.py: Speed up reading of chars by decreasing sleep period.Damien George
2015-07-25tools/pyboard.py: Make enter_raw_repl stricter and more reliable.Damien George
When looking for chars to indicate raw repl is active, look for the full string of chars to improve reliability of entering raw repl correctly. Previous to this patch there was the possibility that raw repl was entered in a dirty state, where not all input chars from previous invocation were drained.
2015-07-25tools/pyboard.py: Fix parsing of returned error so last chr is not lost.Damien George
2015-06-15tools/pyboard.py: Change logic for when raw ">" prompt is parsed.Damien George
In raw REPL ">" indicates the prompt. We originally read this character upon entering the raw REPL, and after reading the last bit of the output. This patch changes the logic so the ">" is read only just before trying to send the next command. To make this work (and as an added feature) the input buffer is now flushed upon entering raw REPL. The main reason for this change is so that pyboard.py recognises the EOF when sys.exit() is called on the pyboard. Ie, if you run pyboard.py with a script that calls sys.exit(), then pyboard.py will exit after the sys.exit() is called.
2015-05-27tools: Allow pyboard constructor to take a baudrate parameter.Dave Hylands
This allows pyboard.py to be used over a UART interface rather than just over a USB serial interface.
2015-05-18tools: Add exec_raw_no_follow to pyboard.py.Dave Hylands
2015-05-07tools/pyboard.py: Add "--follow" option to wait for output indefinitely.Damien George
Also flush stdout so you can see output as it comes.
2015-04-19tools/pyboard.py: Make it 8-bit clean, so it works with unicode chars.Damien George
Addresses issue #1190.
2014-12-20tools, pyboard.py: Write data to pyboard in chunks of 256 bytes.Damien George
This speeds up writes significantly.
2014-11-30tools: Make pyboard.py have infinite timeout when running script.Damien George
This makes pyboard.py much more useful for long running scripts. When running a script via pyboard.py, it now waits until the script finishes, with no timeout. CTRL-C can be used to break out of the waiting if needed.
2014-10-26stmhal: Improve REPL control codes; improve pyboard.py script.Damien George
Improvements are: 2 ctrl-C's are now needed to truly kill running script on pyboard, so make CDC interface allow multiple ctrl-C's through at once (ie sending b'\x03\x03' to pyboard now counts as 2 ctrl-C's). ctrl-C in friendly-repl can now stop multi-line input. In raw-repl mode, use ctrl-D to indicate end of running script, and also end of any error message. Thus, output of raw-repl is always at least 2 ctrl-D's and it's much easier to parse. pyboard.py is now a bit faster, handles exceptions from pyboard better (prints them and exits with exit code 1), prints out the pyboard output while the script is running (instead of waiting till the end), and allows to follow the output of a previous script when run with no arguments.
2014-10-19tools, pyboard.py: Allow exec argument to be bytes or str.Damien George
2014-10-01Enable device keyword option when running pyboard.py --tests and run-tests ↵blmorris
--pyboard
2014-05-03tools: pyboard.py now acts as a command-line program to run scripts.Damien George
You can run a local script on the pyboard using: python pyboard.py test.py where test.py is the local script you want to run.
2014-05-03Merge pull request #543 from lurch/patch-4Damien George
Make pyboard.enter_raw_repl more robust
2014-05-02Fix pyboard.py tests.Craig Barnes
2014-05-01Make pyboard.enter_raw_repl more robustAndrew Scheller
In case there's a program in the microcontroller's main.py running in an infinite loop
2014-04-21tools: Update pyboard.py to work with latest changes to RTC.Damien George
2014-04-14tools: Improve timout/reading of pyboard.py.Damien George
2014-04-13Make pyboard.py have its own exception; update run-tests for pyboard.Damien George
2014-04-03tools: Improve reading back from pyboard.Damien George
2014-04-03tools: pyboard.py can now execute a file remotely!Damien George
2014-03-24Add tools/pyboard.py, a simple module to communicate with the pyboard.Damien George
Using pyboard.py you can use Python running on your PC to execute commands on the connected pyboard. See examples in that file.