aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2018-11-27tools/pydfu.py: Improve DFU reset, and auto-detect USB transfer size.Damien George
A DFU device must be in the idle state before it can be programmed, and this requires either clearing the status or aborting, depending on its current state. Code is added to do this. And the USB transfer size is now automatically detected so devices with a size less than 2048 bytes work correctly.
2018-10-19tools/pyboard.py: In TelnetToSerial.close replace try/except with if.Martin Dybdal
Some Python linters don't like unconditional except clauses because they catch SystemExit and KeyboardInterrupt, which usually is not the intended behaviour.
2018-09-21tools/pydfu: Workaround stdio flush error on Windows with Python 3.6.Andrew Leech
There appears to be an issue on Windows with CPython >= 3.6, sys.stdout.flush() raises an exception: OSError: [WinError 87] The parameter is incorrect It works fine to just catch and ignore the error on the flush line. Tested on Windows 10 x64 1803 (Build 17134.228), Python 3.6.4 amd64.
2018-08-10tools/pyboard.py: Change base class of PyboardError to Exception.Martin Dybdal
Following standard practice for defining custom exceptions.
2018-08-04tools/pyboard: Run exec: command as a string.Ayke van Laethem
The Python documentation recommends to pass the command as a string when using Popen(..., shell=True). This is because "sh -c <string>" is used to execute the command and additional arguments after the command string are passed to the shell itself (not the executing command). https://docs.python.org/3.5/library/subprocess.html#subprocess.Popen
2018-08-01tools/mpy-tool: Set sane initial dynamic qstr pool size with frozen modsRich Barlow
The first dynamic qstr pool is double the size of the 'alloc' field of the last const qstr pool. The built in const qstr pool (mp_qstr_const_pool) has a hardcoded alloc size of 10, meaning that the first dynamic pool is allocated space for 20 entries. The alloc size must be less than or equal to the actual number of qstrs in the pool (the 'len' field) to ensure that the first dynamically created qstr triggers the creation of a new pool. When modules are frozen a second const pool is created (generally mp_qstr_frozen_const_pool) and linked to the built in pool. However, this second const pool had its 'alloc' field set to the number of qstrs in the pool. When freezing a large quantity of modules this can result in thousands of qstrs being in the pool. This means that the first dynamically created qstr results in a massive allocation. This commit sets the alloc size of the frozen qstr pool to 10 or less (if the number of qstrs in the pool is less than 10). The result of this is that the allocation behaviour when a dynamic qstr is created is identical with an without frozen code. Note that there is the potential for a slight memory inefficiency if the frozen modules have less than 10 qstrs, as the first few dynamic allocations will have quite a large overhead, but the geometric growth soon deals with this.
2018-07-27tools/pydfu.py: Make the DFU tool work again with Python 2.roland
This patch will work for both Python 2 and 3.
2018-07-20tools/pydfu.py: Use getfullargspec instead of getargspec for newer pyusbroland
pyusb v1.0.2 warns about `getargspec` as being deprecated.
2018-07-20tools/dfu.py: Pad image data to 8 byte alignment to support L476.roland
Thanks to @dhylands for this patch to pad the image to 8-byte boundaries.
2018-07-09tools/mpy-tool.py: Put frozen bignum digit data in ROM, not in RAM.Damien George
2018-07-09tools/mpy-tool.py: Support freezing of floats in obj representation D.Damien George
2018-06-22tools/pydfu.py: Add support for multiple memory segments.Damien George
Segments are separated by / and begin with the memory address. This follows how the ST DFU tool works.
2018-06-08tools/pydfu.py: Increase download packet size to full 2048 bytes.Damien George
The ST DFU bootloader supports a transfer size up to 2048 bytes, so send that much data on each download (to device) packet. This almost halves total download time.
2018-05-18tools/pydfu.py: Fix typo in comments.Keith Wiley
2018-04-23tools/upip: Upgrade upip to 1.2.4.Damien George
Uses new pypi.org URL, and now creates a socket with the address parameters returned by getaddrinfo().
2017-12-15tools/tinytest-codegen: Ignore system locale, write output in UTF-8.Paul Sokolovsky
Way to reproduce a UnicodeEncodeError without this patch: LC_ALL=C tinytest-codegen.py ...
2017-12-14tools/tinytest-codegen: Add --stdin switch instead of recently added --target.Paul Sokolovsky
Instead of passing thru more and more options from tinytest-codegen to run-tests --list-tests, pipe output of run-tests --list-tests into tinytest-codegen.
2017-12-14tools/pydfu.py: Call set_configuration() on fresh USB device object.Damien George
This call is required before using the device (some operating systems don't need it but others do). Fixes issue #3476.
2017-12-13tools/tinytest-codegen: Take --target= option for test set selection.Paul Sokolovsky
Gets passed to run-tests --list-tests to get actual list of tests to use. If --target= is not given, legacy set hardcoded in tinytest-codegen itself is used. Also, get rid of tinytest test groups - they aren't really used for anything, and only complicate processing. Besides, one of the next step is to limit number of tests per a generated file to control the binary size, which also will require "flat" list of tests.
2017-12-13tools/tinytest-codegen: More excludes after enabling expected output match.Paul Sokolovsky
2017-12-13tools/tinytest-codegen: Wrap lines of exclude_tests.Paul Sokolovsky
So it was manageable and extensible.
2017-12-13tools/tinytest-codegen.py: Generate code for upytesthelper.Paul Sokolovsky
The way tinytest was used in qemu-arm test target is that it didn't test much. MicroPython tests are based on matching the test output against reference output, but qemu-arm's implementation didn't do that, it effectively tested just that there was no exception during test execution. "upytesthelper" wrapper was introduce to fix it, and so test generator is now switched to generate test code for it. Also, fix PEP8 and other codestyle issues.
2017-12-08lib/tinytest: Move from tools/tinytest.Paul Sokolovsky
Tinytest library was misplaced under tools/. By convention, any target libraries belong to lib/, while tools/ contains host-side tools.
2017-11-28tools/gen-cpydiff.py: Update executable paths to point to new ports dir.Damien George
2017-11-15tools/mpy-tool.py: Implement freezing of Ellipsis const object.Damien George
2017-10-10py/bc: Update opcode_format_table to match the bytecode.Damien George
2017-10-08tools/pyboard: Update docstring for additional device support.Paul Sokolovsky
2017-10-05tools/pyboard: Use repr() when quoting data in error messages.Paul Sokolovsky
As it may contain newlines, etc.
2017-10-05py/persistentcode: Bump .mpy version number to version 3.Damien George
The binary and unary ops have changed bytecode encoding.
2017-09-29tools/upip: Upgrade to 1.2.2.Paul Sokolovsky
TLS SNI support, fixes after making str.rstrip() behavior compliant.
2017-09-06all: Update Makefiles and others to build with new ports/ dir layout.Damien George
Also renames "stmhal" to "stm32" in documentation and everywhere else.
2017-08-16tools/mpy-tool.py: Fix missing argument in dump() functionstijn
This makes the -d commandline argument usable again. Pass empty string as parent name as listing starts from the root.
2017-08-12tools/mpy-tool.py: Don't generate const_table if it's empty.Damien George
2017-07-31all: Use the name MicroPython consistently in commentsAlexander Steffen
There were several different spellings of MicroPython present in comments, when there should be only one.
2017-07-27tools/mpy_bin2res: Tools to convert binary resources to Python module.Paul Sokolovsky
Afterwards, they can be access using pkg_resource module from micropython-lib.
2017-07-22tools/pyboard: Add license header.Paul Sokolovsky
2017-07-19all: Remove trailing spaces, per coding conventions.Damien George
2017-07-09tools/gen-cpydiff: Use case description as 3rd-level heading.Paul Sokolovsky
This is required to easily giving links to a particular difference case. Also, add RST anchors to allow cases to cross-reference each other.
2017-05-29various: Spelling fixesVille Skyttä
2017-05-16tools/mpy-tool.py: Fix regression with freezing floats in obj repr C.Damien George
Regression was introduced by ec534609f665cb791b8fc1eae1a44e514c297659
2017-05-14tools/mpy_cross_all.py: Helper tool to run mpy-cross on the entire project.Paul Sokolovsky
2017-05-13tools/mpy-tool.py: Use MP_ROM_xxx macros to support nanbox builds.Damien George
2017-05-05tools/upip: Upgrade to 1.2.Paul Sokolovsky
Memory optimizations and error handling improvements.
2017-05-01tools/upip: Upgrade to 1.1.6, supports commented lines in requirements.txt.Paul Sokolovsky
2017-05-01tools/mpy-tool: Make work if run from another directory.Paul Sokolovsky
By making sure we don't add relative paths to sys.path.
2017-04-22py: Add LOAD_SUPER_METHOD bytecode to allow heap-free super meth calls.Damien George
This patch allows the following code to run without allocating on the heap: super().foo(...) Before this patch such a call would allocate a super object on the heap and then load the foo method and call it right away. The super object is only needed to perform the lookup of the method and not needed after that. This patch makes an optimisation to allocate the super object on the C stack and discard it right after use. Changes in code size due to this patch are: bare-arm: +128 minimal: +232 unix x64: +416 unix nanbox: +364 stmhal: +184 esp8266: +340 cc3200: +128
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).