- Jun 04, 2019
-
-
Damien George authored
Fixes errors in the tool when 1) linking qstrs in native ARM-M code; 2) freezing multiple files some of which use native code and some which don't. Fixes issue #4829.
-
- May 15, 2019
-
-
Damien George authored
The user can now select their own package index by either passing the "-i" command line option, or setting the upip.index_urls variable (before doing an install). The https://micropython.org/pi package index hosts packages from micropython-lib and will be searched first when installing a package. If a package is not found here then it will fallback to PyPI.
-
- Apr 25, 2019
-
-
Damien George authored
Prior to this patch, when a lot of data was output by a running script pyboard.py would try to capture all of this output into the "data" variable, which would gradually slow down pyboard.py to the point where it would have large CPU and memory usage (on the host) and potentially lose data. This patch fixes this problem by not accumulating the data in the case that the data is not needed, which is when "data_consumer" is used.
-
- Apr 08, 2019
-
-
Damien George authored
The qstr window size is not log-2 encoded, it's just the actual number (but in mpy-tool.py this didn't lead to an error because the size is just used to truncate the window so it doesn't grow arbitrarily large in memory). Addresses issue #4635.
-
Damien George authored
Fixes the regression introduced in ea3c80a5
-
- Mar 26, 2019
-
-
rhubarbdog authored
-
- Mar 08, 2019
-
-
Andrew Leech authored
How to use this feature is documented in docs/develop/cmodules.rst.
-
Ayke van Laethem authored
This system makes it a lot easier to include external libraries as static, native modules in MicroPython. Simply pass USER_C_MODULES (like FROZEN_MPY_DIR) as a make parameter.
-
Damien George authored
-
Damien George authored
-
Damien George authored
This adds support to freeze .mpy files that contain native code blocks.
-
Damien George authored
-
- Mar 05, 2019
-
-
Damien George authored
When encoded in the mpy file, if qstr <= QSTR_LAST_STATIC then store two bytes: 0, static_qstr_id. Otherwise encode the qstr as usual (either with string data or a reference into the qstr window). Reduces mpy file size by about 5%.
-
Damien George authored
Instead of emitting two bytes in the bytecode for where the linked qstr should be written to, it is now replaced by the actual qstr data, or a reference into the qstr window. Reduces mpy file size by about 10%.
-
Damien George authored
This is an implementation of a sliding qstr window used to reduce the number of qstrs stored in a .mpy file. The window size is configured to 32 entries which takes a fixed 64 bytes (16-bits each) on the C stack when loading/saving a .mpy file. It allows to remember the most recent 32 qstrs so they don't need to be stored again in the .mpy file. The qstr window uses a simple least-recently-used mechanism to discard the least recently used qstr when the window overflows (similar to dictionary compression). This scheme only needs a single pass to save/load the .mpy file. Reduces mpy file size by about 25% with a window size of 32.
-
Damien George authored
POP_BLOCK and POP_EXCEPT are now the same, and are always followed by a JUMP. So this optimisation reduces code size, and RAM usage of bytecode by two bytes for each try-except handler.
-
- Dec 29, 2018
-
-
Dave Hylands authored
Under python3 (tested with 3.6.7) bytes with a list of integers as an argument returns a different result than under python 2.7 (tested with 2.7.15rc1) which causes pydfu.py to fail when run under 2.7. Changing bytes to bytearray makes pydfu work properly under both Python 2.7 and Python 3.6.
-
- Dec 15, 2018
-
-
Dave Hylands authored
If you happen to only have a really simple frozen file that doesn't contain any new qstrs then the generated frozen_mpy.c file contains an empty enumeration which causes a C compile time error.
-
- Dec 12, 2018
-
-
Damien George authored
Following an equivalent fix to py/bc.c. The reason the incorrect values for the opcode constants were not previously causing a bug is because they were never being used: these opcodes always have qstr arguments so the part of the code that was comparing them would never be reached. Thanks to @malinah for finding the problem and providing the initial patch.
-
- Nov 27, 2018
-
-
Damien George authored
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.
-
- Oct 19, 2018
-
-
Martin Dybdal authored
Some Python linters don't like unconditional except clauses because they catch SystemExit and KeyboardInterrupt, which usually is not the intended behaviour.
-
- Sep 21, 2018
-
-
Andrew Leech authored
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.
-
- Aug 10, 2018
-
-
Martin Dybdal authored
Following standard practice for defining custom exceptions.
-
- Aug 04, 2018
-
-
Ayke van Laethem authored
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
-
- Aug 01, 2018
-
-
Rich Barlow authored
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.
-
- Jul 27, 2018
-
-
roland authored
This patch will work for both Python 2 and 3.
-
- Jul 20, 2018
- Jul 09, 2018
-
-
Damien George authored
-
Damien George authored
-
- Jun 22, 2018
-
-
Damien George authored
Segments are separated by / and begin with the memory address. This follows how the ST DFU tool works.
-
- Jun 08, 2018
-
-
Damien George authored
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.
-
- May 18, 2018
-
-
Keith Wiley authored
-
- Apr 23, 2018
-
-
Damien George authored
Uses new pypi.org URL, and now creates a socket with the address parameters returned by getaddrinfo().
-
- Dec 15, 2017
-
-
Paul Sokolovsky authored
Way to reproduce a UnicodeEncodeError without this patch: LC_ALL=C tinytest-codegen.py ...
-
- Dec 14, 2017
-
-
Paul Sokolovsky authored
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.
-
- Dec 13, 2017
-
-
Damien George authored
This call is required before using the device (some operating systems don't need it but others do). Fixes issue #3476.
-
Paul Sokolovsky authored
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.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
So it was manageable and extensible.
-