Double precision math library and support on pyboard, and improved ussl
This release brings general improvements and bug fixes to the core and
various ports, as well as documentation additions, clean-ups and better
consistency. And effort has been made to clean up the source code to
make it more consistent across the core and all ports.
There is a new tool "mpy_bin2res.py" to convert arbitrary (binary) files
to Python resources for inclusion in source code (frozen or otherwise).
The ussl module has seen improvements, including implementation of
server_hostname (for axtls) and server_side mode (for mbedtls).
There is now a double-precision float math library and stmhal has support
to build firmware with software or hardware double-precision.
A detailed list of changes follows.
py core:
- formatfloat: fix number of digits and exponent sign when rounding
- modthread: raise RuntimeError in release() if lock is not acquired
- compile: raise SyntaxError if positional args are given after */**
- objint: support "big" byte-order in int.to_bytes()
- objint: in to_bytes(), allow length arg to be any int and check sign
- compile: fix bug with break/continue in else of optimised for-range
- compile: optimise emitter label indices to save a word of heap
- builtinimport: remove unreachable code for relative imports
- objnamedtuple: simplify and remove use of alloca building namedtuple
- mpprint: remove unreachable check for neg return of mp_format_float
- binary: add missing "break" statements
- runtime: mark m_malloc_fail() as NORETURN
- objstr: remove unnecessary "sign" variable in formatting code
- vm: make "if" control flow more obvious in YIELD_FROM opcode
- modmath: check for zero division in log with 2 args
- makeversionhdr.py: update to parse new release line in docs/conf.py
- objdict: factorise dict accessor helper to reduce code size
- change mp_uint_t to size_t in builtins code
- repl: change mp_uint_t to size_t in repl helpers
- compile: combine arith and bit-shift ops into 1 compile routine
- compile: use switch-case to match token and operator
- objgenerator: allow to hash generators and generator instances
- gc: refactor assertions in gc_free function
- vm: make n_state variable local to just set-up part of VM
- asmx64: support moving a 64-bit immediate to one of top 8 registers
- modmicropython: cast stack_limit value so it prints correctly
- builtinevex: add typechecking of globals/locals args to eval/exec
- py.mk: make berkeley-db C-defs apply only to relevant source files
- mperrno: allow mperrno.h to be correctly included before other hdrs
- mpz: make mpz_is_zero() an inline function
- implement raising a big-int to a negative power
- mkrules.mk: show frozen modules sizes together with executable size
- objtuple: allow to use inplace-multiplication operator on tuples
- objstr: raise an exception for wrong type on RHS of str binary op
- modsys: initial implementation of sys.getsizeof()
- binary.c: fix bug when packing big-endian 'Q' values
- add verbose debug compile-time flag MICROPY_DEBUG_VERBOSE
- binary: change internal bytearray typecode from 0 to 1
- objstringio: prevent offset wraparound for io.BytesIO objects
- objstringio: fix regression with handling SEEK_SET
- stream: seek: Consistently handle negative offset for SEEK_SET
- mkrules.mk: use "find -path" when searching for frozen obj files
- compile: remove unused pn_colon code when compiling func params
- objcomplex: remove unnecessary assignment of variable
- formatfloat: don't post-increment variable that won't be used again
- use "static inline" for funcs that should be inline
- asmthumb: use existing macro to properly clear the D-cache
extmod:
- modussl_axtls: update for axTLS 2.1.3
- modussl_axtls: implement server_hostname arg to wrap_socket()
- move modonewire.c from esp8266 to extmod directory
- modure: if input string is bytes, return bytes results too
- modubinascii: add check for empty buffer passed to hexlify
- modussl_axtls: allow to close ssl stream multiple times
- modussl_mbedtls: support server_side mode
- modussl_mbedtls: when reading and peer wants to close, return 0
- modframebuf: fix invalid stride for odd widths in GS4_HMSB fmt
- modussl_mbedtls: make socket.close() free all TLS resources
- modframebuf: consistently use "col" as name for colour variables
- modussl_mbedtls: implement non-blocking SSL sockets
- machine_signal: fix parsing of invert arg when Pin is first arg
- modframebuf: use correct initialization for .locals_dict
- modlwip: implement setsockopt(IP_ADD_MEMBERSHIP)
- modussl_mbedtls.c: add ussl.getpeercert() method
- modubinascii: rewrite mod_binascii_a2b_base64
- modubinascii: don't post-increment variable that won't be used
- modonewire: rename public module to mp_module_onewire
- for uos.stat interpret st_size member as an unsigned int
- use "static inline" for funcs that should be inline
lib:
- axtls: upgrade to axTLS 2.1.3 + MicroPython patchset
- libm/math: remove implementations of float conversion functions
- add libm_dbl, a double-precision math library, from musl-1.1.16
drivers:
- onewire: move onewire.py, ds18x20.py from esp8266 to drivers
- onewire: enable pull-up when init'ing the 1-wire pin
tools:
- gen-cpydiff: use case description as 3rd-level heading
- pyboard: add license header
- mpy_bin2res: tools to convert binary resources to Python module
- mpy-tool.py: don't generate const_table if it's empty
- mpy-tool.py: fix missing argument in dump() function
tests:
- net_inet/test_tls_sites.py: integration test for SSL connections
- net_inet: add tests for accept and connect in nonblocking mode
- basics: add tests for for-else statement
- net_inet: move tests which don't require full Internet to net_hosted
- connect_nonblock: refactor towards real net_hosted test
- auto detect floating point capabilites of the target
- import: add a test for the builtin __import__ function
- import: update comment now that uPy raises correct exception
- basics/namedtuple1: add test for creating with pos and kw args
- unix/extra_coverage: add test for mp_vprintf with bad fmt spec
- basics: add tests for arithmetic operators precedence
- cpydiff/modules_deque: elaborate workaround
- cpydiff/core_class_mro: move under Classes, add workaround
- cpydiff/core_arguments: move under Functions subsection
- cpydiff/core_class_supermultiple: same cause as core_class_mro
- cpydiff: improve wording, add more workarounds
- cpydiff: add case for str.ljust/rjust
- rename exec1.py to builtin_exec.py
- basics/builtin_exec: test various globals/locals args to exec()
minimal port:
- Makefile: enable gc-sections to remove unused code
- remove unused stmhal include from Makefile
- use size_t for mp_builtin_open argument
unix port:
- modtime: replace strftime() with localtime()
- mpconfigport.mk: update descriptions of readline and TLS options
- Makefile: disable assertions in the standard unix executable
- modjni: convert to mp_rom_map_elem_t
- for uos.stat interpret st_size member as an unsigned int
stmhal port:
- mpconfigport.h: remove config of PY_THREAD_GIL to use default
- make error messages more consistent across peripherals
- add initial implementation of Pin.irq() method
- add .value() method to Switch object, to mirror Pin and Signal
- move pybstdio.c to lib/utils/sys_stdio_mphal.c for common use
- add "quiet timing" enter/exit functions
- make available the _onewire module, for low-level bus control
- modules: provide sym-link to onewire.py driver
- boards/stm32f405.ld: increase FLASH_TEXT to end of 1MiB flash
- sdcard: allow a board to customise the SDIO pins
- add possibility to build with double-precision floating point
- boards: enable double-prec FP on F76x boards
- Makefile: use hardware double-prec FP for MCUs that support it
- Makefile: rename FLOAT_IMPL to MICROPY_FLOAT_IMPL to match C name
- Makefile: add CFLAGS_EXTRA to CFLAGS so cmdline can add options
- mpconfigport.h: allow MICROPY_PY_THREAD to be overridden
- boards: add configuration files for NUCLEO_F429ZI
- boards/NUCLEO_F429ZI: change USB config from HS to FS peripheral
- reduce size of ESPRUINO_PICO build so it fits in flash
- servo: make pyb.Servo(n) map to Pin('Xn') on all MCUs
- servo: don't compile servo code when it's not enabled
- use "static inline" for funcs that should be inline
cc3200 port:
- modusocket: simplify socket.makefile() function
- make non-zero socket timeout work with connect/accept/send
- modusocket: fix connect() when in non-blocking or timeout mode
- use the name MicroPython consistently in code
esp8266 port:
- Makefile: bump axTLS TLS record buffer size to 5K
- Makefile: allow FROZEN_DIR,FROZEN_MPY_DIR to be overridden
- Makefile: add LIB_SRC_C variable to qstr auto-extraction list
- make onewire module and support code usable by other ports
- modonewire: move low-level 1-wire bus code to modonewire.c
- modonewire: make timings static and remove onewire.timings func
- reinstate 1-wire scripts by sym-linking to drivers/onewire/
- move mp_hal_pin_open_drain from esp_mphal.c to machine_pin.c
- enable MICROPY_ENABLE_FINALISER
- README: make "Documentation" a top-level section
- machine_rtc: use correct arithmetic for aligning RTC mem len
- mpconfigport_512k: use terse error messages to get 512k to fit
- mpconfigport.h: make socket a weak link
- modesp: remove unused constants: STA_MODE, etc
- general: add known issue of WiFi RX buffers overflow
- use size_t for mp_builtin_open argument
- fix UART stop bit constants
zephyr port:
- Makefile: rework dependencies and "clean" target
- Makefile: revert prj.conf construction rule to the previous state
- remove long-obsolete machine_ptr_t typedef's
- Makefile: explicitly define default target as "all"
- modusocket: allow to use socketized net_context in upstream
- modusocket: socket, close: switch to native Zephyr socket calls
- modusocket: bind, connect, listen, accept: Swtich to native sockets
- modusocket: send: switch to native sockets
- modusocket: recv: switch to native sockets
- modusocket: fully switch to native Zephyr sockets
- modzephyr: add current_tid() and stacks_analyze() functions
- prj_base.conf: enable CONFIG_INIT_STACKS
- modusocket: update struct sockaddr family field name
- prj_96b_carbon.conf: re-enable networking on Carbon
- modzephyr: add shell_net_iface() function
docs:
- btree: add hints about opening db file and need to flush db
- select: rename to uselect, to match the actual module name
- license: update copyright year
- esp8266/tutorial/intro: discourage use of 512kb firmwares
- esp8266/tutorial/intro: Sphinx requires blank lines around literal blocks
- conf.py: include 3 levels of ToC in latexpdf output
- gc: mark mem_alloc()/mem_free() as uPy-specific
- gc: document gc.threshold() function
- builtins: list builtin exceptions
- conf.py: set default_role = 'any'
- lcd160cr: group related constants together and use full sentences
- ref/speed_python: update and make more hardware-neutral
- library/gc: fix grammar and improve readability of gc.threshold()
- move all ports docs to the single ToC
- topindex.html: remove link to wipy.io, it's no longer available
- conf.py: add .venv dir to exclude_patterns
- move topindex.html to templates/ subdir
- differences/index_template: use consistent heading casing
- builtins: add AssertionError, SyntaxError, ZeroDivisionError
- add glossary
- conf.py: switch to "new" format of intersphinx_mapping
- conf.py: add file for global replacements definition
- library: add CPython docs xref to each pertinent module
- replace.inc: add |see_cpython|, to xref individual symbols from CPython
- conf.py: set "version" and "release" to the same value
- *_index: drop "Indices and tables" pseudo-section
- pyboard: move hardware info into General Info chapter
- uerrno: document "uerrno" module
- esp8266/general.rst: fix name of NTP module
- pyboard: move info about using Windows from topindex to general
- uzlib: update description of decompress() and mention DecompIO
- pyboard/tutorial/amp_skin: add example for playing large WAV files
- library/ubinascii: update base64 docs
- library/usocket: move socket.error to its own section
- library/usocket: describe complete information on address formats
- glossary: elaborate on possible MicroPython port differences
- glossary: fix typos in micropython-lib paragraph
- index: rewrite introduction paragraph to avoid confusion
- use the name MicroPython consistently in documentation
- consistently link to micropython-lib in glossary
all:
- make more use of mp_raise_{msg,TypeError,ValueError} helpers
- unify header guard usage
- remove trailing spaces, per coding conventions
- don't include system errno.h when it's not needed
- use the name MicroPython consistently in comments
- make use of $(TOP) variable in Makefiles, instead of ".."
- raise exceptions via mp_raise_XXX
- make static dicts use mp_rom_map_elem_t type and MP_ROM_xxx macros
README:
- mention support for bytecode and frozen bytecode
- improve description of precompiled bytecode; mention mpy-cross
CODECONVENTIONS:
- clarify MicroPython changes sign-off process
- start to describe docs conventions
- describe docs use of markup for None/True/False
travis:
- build STM32F769DISC board instead of F7DISC to test dbl-prec FP
- pin cpp-coveralls at 0.3.12
New VFS subsystem and scheduling framework, and less need for the heap
This release adds some fundamental new components, allows for more Python
operations without using the heap and has reduced code size and stack
usage.
Changes in the way iterators are handled allows to iterate without
allocating on the heap for the types: tuple, list, str, bytes, bytearray,
array, dict, set, frozenset. It also allows to call the builtins all, any,
min max and sum without allocating heap memory for the iterator argument.
And improvements to the handling of super() means that super().foo() method
calls are now heap-less.
A new generic VFS subsystem has been added which allows to mount arbitrary
filesystems (even written in Python) at the root or at a mount-point within
the root. The FatFS driver has been replaced with an object-oriented
version (oofatfs) which allows a fully customisable filesystem layout.
A scheduling framework has been implemented in the core which gives the
ability to schedule callbacks to be called "as soon as possible". This
allows ports to implement "soft IRQs" which allow the programmer to
allocate memory during an interrupt handler, at the cost of some
performance related to response time of the handler. The new
micropython.schedule() function gives access to the scheduler.
Other improvements to the core include: consts can now be big-nums, for
example "X = const(1 << 100)"; addition of "help('modules')" to list
available modules; stack usage reduced for a Python call by 8 bytes on ARM
Cortex-M architectures; micropython.kbd_intr() function added to disable
Ctrl-C capture; addition of uio.resource_stream(); mpy-cross is built
automatically if needed; a helper tool mpy_cross_all.py is added to run
mpy-cross on an entire project.
The bytecode has changed in this version so existing .mpy files will need
recompiling. There have also been some changes to the C API, most notably
with mp_uint_t changed to size_t in many places.
In the extended modules the following main changes have been made: addition
of machine.Signal class to allow inversion on a Pin; framebuf has new
formats of the form MONO_xxx; addition of uselect.ipoll() for allocation-
free polling; addition of uos.ilistdir() for efficient iteration of a
directory listing; machine.Pin high/low methods are renamed to on/off in
esp8266 and zephyr (this is a backwards-incompatible change);
machine.time_pulse_us() function no longer throws exceptions, but returns
negative values instead.
For stmhal the pyb.fault_debug() function is added, and default behaviour
for a hard-fault is now an immediate reset. There is better support for F7
MCUs, in particular DMA and SD card support. A bug has been fixed with the
USB VCP (USB serial) where it would in rare cases (usually when the host PC
was under load) would lose characters. Pyboard now automatically mounts
all available partitions on the SD card. Multithreading has been
implemented and is available via the _thread module, but this feature is
disabled by default and must be enabled at compile time using the
MICROPY_THREAD and MICROPY_THREAD_GIL options. The ability to skip booting
from SD card is now available by creating an empty file on the flash called
"SKIPSD".
The cc3200 port has had some backwards incompatible changes, in particular
with I2C, Pin, UART and uos. Please see the documentation for the new
behaviour.
The esp8266 port has had a change in the size of the firmware in order to
accommodate additional features. As such the filesystem for this version
is incompatible with v1.8.7 and a device requires backup and erasure before
flashing this version. Soft IRQs are now implemented for Pin and Timer
callbacks, along with the general improvements described above.
In the documentation there is now a section describing the differences
between MicroPython and CPython. And code coverage is up to 98% across py/
and extmod/.
Changes in code size (in bytes) between v1.8.7 and this version are:
bare-arm: -1104
minimal: -1324
unix x64: -1115
unix nanbox: -11106
stmhal: +18116
cc3200: +1032
esp8266: +3060
Note that stmhal has increased significantly due to the addition of frozen
bytecode and the LCD160CR driver.
A detailed list of changes follows.
py core:
- builtinimport: raise ValueError for bad relative import, per CPython
- builtinimport: remove unreachable code and change obj-import comment
- runtime: refactor assert(0) to improve coverage
- runtime: fix handling of throw() when resuming generator
- objgenerator: when throwing an object, don't make an exc instance
- objgenerator: don't raise RuntimeError if GeneratorExit ignored
- parse: refactor code to remove assert(0)'s
- emitnative: remove assert(0)'s or replace with mp_not_implemented
- objexcept: replace if-cond and assert(0) with simple assert
- runtime: refactor default case of switch to remove assert(0)
- binary: mp_binary_get_size: Raise error on unsupported typecodes
- formatfloat: remove unreachable code
- objint_mpz: refactor switch-statement to remove unreachable default
- mpz: implement mpz_set_from_bytes() as a foundation for int.from_bytes()
- objint: from_bytes(): implement "byteorder" param and arbitrary precision
- objint_longlong: add stub for mp_obj_int_from_bytes_impl()
- add builtin help function to core, with default help msg
- move weak-link map to objmodule.c, and expose module maps as public
- builtinhelp: implement help('modules') to list available modules
- objint: fix left-shift overflow in checking for large int
- objmodule: move module init/deinit code into runtime functions
- objstr: optimize string concatenation with empty string
- showbc: make sure to set the const_table before printing bytecode
- py.mk: add CFLAGS_MOD flag to set config file for FatFs
- objstringio: allow to specify initial capacity by passing numeric argument
- objset: make inplace binary operators actually modify the set
- objfloat: raise ZeroDivisionError for 0 to negative power
- objcomplex: correctly handle case of 0j to power of something
- objset: fix inplace binary ops so frozensets are not modified
- added optimised support for 3-argument calls to builtin.pow()
- objstr: give correct behaviour when passing a dict to %-formatting
- mpconfig.h: move PY_BUILTINS_POW3 config option to diff part of file
- objstr: convert some instances of mp_uint_t to size_t
- objcomplex: fix typo in ternary expression
- asmxtensa.h: explicitly cast args to 32-bits so left-shift is legal
- map: change mp_uint_t to size_t where appropriate
- nlr: fix execstack builds for ARM
- objtype: add __delattr__/__setattr__ configured by MICROPY_PY_DELATTR_SETATTR
- emitbc: produce correct line number info for large bytecode chunks
- objtype: replace non-ASCII single-quote char with ASCII version
- modthread: use system-provided mutexs for _thread locks
- vm: add MICROPY_PY_THREAD_GIL_VM_DIVISOR option
- runtime: convert mp_uint_t to size_t where appropriate
- mpz: convert mp_uint_t to size_t where appropriate
- mpz: remove obsolete declaration of mpz_as_str_size
- mpz: change type of "base" args from mp_uint_t to unsigned int
- persistentcode: replace mp_uint_t with size_t where appropriate
- objtuple: convert mp_uint_t to size_t where appropriate
- objlist: convert mp_uint_t to size_t where appropriate
- objdict: convert mp_uint_t to size_t where appropriate
- objset: convert mp_uint_t to size_t where appropriate
- objstr: convert mp_uint_t to size_t (and use int) where appropriate
- objarray: convert mp_uint_t to size_t where appropriate
- objfun: convert mp_uint_t to size_t where appropriate
- objclosure: convert mp_uint_t to size_t where appropriate
- objexcept: convert mp_uint_t to size_t where appropriate
- objint: convert mp_uint_t to size_t where appropriate
- vm: convert mp_uint_t to size_t where appropriate
- add iter_buf to getiter type method
- allow bytecode/native to put iter_buf on stack for simple for loops
- make FOR_ITER opcode pop 1+4 slots from the stack when finished
- optimise storage of iterator so it takes only 4 slots on Py stack
- remove unused "use_stack" argument from for_iter_end emit function
- runtime: optimise case of identity iterator so it doesn't alloc RAM
- compile: optimise list/dict/set comprehensions to use stack iter
- de-optimise some uses of mp_getiter, so they don't use the C stack
- grammar: group no-compile grammar rules together to shrink tables
- lexer: don't generate string representation for period or ellipsis
- persistentcode: bump .mpy version due to change in bytecode
- lexer: simplify handling of indenting of very first token
- lexer: move check for keyword to name-tokenising block
- lexer: use strcmp to make keyword searching more efficient
- lexer: simplify handling of line-continuation error
- do adjacent str/bytes literal concatenation in lexer, not compiler
- lexer: convert mp_uint_t to size_t where appropriate
- grammar: remove unused rule
- objlist: for list slice assignment, allow RHS to be a tuple or list
- moduerrno: make uerrno.errorcode dict configurable
- moduerrno: make list of errno codes configurable
- parse: allow parser/compiler consts to be bignums
- create str/bytes objects in the parser, not the compiler
- parse: simplify handling of errors by raising them directly
- runtime: mp_raise_msg(): Accept NULL argument for message
- objarray: disallow slice-assignment to read-only memoryview
- map: fix bugs with deletion of elements from OrderedDict
- move locals/globals dicts to the thread-specific state
- nlr.h: mark nlr_jump_fail as NORETURN
- nlrxtensa: convert from assembler to C file with inline asm
- nlrx64: convert from assembler to C file with inline asm
- nlrx86: convert from assembler to C file with inline asm
- py.mk: force nlr files to be compiled with -Os
- modsys: use MP_SMALL_INT_MAX for sys.maxsize in case of LONGINT_IMPL_NONE
- runtime.c: remove optimization of '*a,=b', it caused a bug
- use mp_obj_get_array where sequence may be a tuple or a list
- nlrx86: add workaround for Zephyr
- nlrx64: fixes to support Mac OS
- objint_longlong: implement mp_obj_int_from_bytes_impl()
- allow lexer to raise exceptions during construction
- objint: allow to print long-long ints without using the heap
- emitnative: use assertions and mp_not_implemented correctly
- emitnative: remove obsolete commented out code
- mpprint: fix int formatting so "+" is printed for 0-valued integer
- mkrules.mk: remove special check for "-B" in qstr auto generation
- objstr: fix eager optimisation of str/bytes addition
- reduce size of mp_code_state_t structure
- provide mp_decode_uint_value to help optimise stack usage
- objstr: use better msg in bad implicit str/bytes conversion exception
- add micropython.schedule() function and associated runtime code
- vm: don't release the GIL if the scheduler is locked
- bc: provide better error message for an unexpected keyword argument
- use size_t as len argument and return type of mp_get_index
- sequence: convert mp_uint_t to size_t where appropriate
- define and use MP_OBJ_ITER_BUF_NSLOTS to get size of stack iter buf
- lexer: remove obsolete comment, since lexer can now raise exceptions
- modmath: allow trunc/ceil/floor to return a big int if necessary
- objint: handle special case of -0 when classifying fp as int
- modbuiltins: for round() builtin use nearbyint instead of round
- modbuiltins: allow round() to return a big int if necessary
- objtype: use size_t where appropriate, instead of mp_uint_t or uint
- objnamedtuple: use size_t where appropriate, instead of mp_uint_t
- use mp_locals/mp_globals accessor funcs instead of MP_STATE_CTX
- remove MP_STATE_CTX, use MP_STATE_THREAD instead (it's an alias)
- objarray: use mp_obj_str_get_str instead of mp_obj_str_get_data
- nlrx86: better check for Zephyr (requires 1.7)
- obj: change mp_uint_t to size_t for mp_obj_get_array_fixed_n len arg
- vm: fix VM opcode tracing to print correct stack pointer
- compile: when compiling super(), handle closed-over self variable
- objmap: convert mp_uint_t to size_t
- use mp_raise_TypeError/mp_raise_ValueError helpers where possible
- lexer: simplify and reduce code size for operator tokenising
- compile: simplify syntax-error messages for illegal assignments
- shorten a couple of error messages
- compile: provide terse error message for invalid dict/set literals
- convert mp_uint_t to size_t for tuple/list accessors
- change mp_uint_t to size_t for mp_obj_str_get_data len arg
- objzip: convert mp_uint_t to size_t
- obj.h: make sequence grow more efficient and support overlapping
- objstr: use MICROPY_FULL_CHECKS for range checking when constructing bytes
- add very simple but correct hashing for float and complex numbers
- objint: consolidate mp_obj_new_int_from_float to one implementation
- raise a ValueError if range() step is zero
- objtuple: add support for inplace add (same as normal add)
- make sure that static emg-exc-buffer is aligned to size of mp_obj_t
- runtime: when init'ing kbd intr exc, use tuple ptr instead of object
- objint: extract small int value directly because type is known
- objint: use unsigned arithmetic when formatting an integer
- obj: clean up and add comments describing mp_obj_type_t struct
- optimise types for common case where type has a single parent type
- objfloat: add implementation of high-quality float hashing
- nlrsetjmp: add check for failed NLR jump
- gc: execute finaliser code in a protected environment
- modmicropython: add micropython.kbd_intr() function
- reduce str/repr precision of float numbers when floats are 30-bit
- objtype: mp_obj_new_super doesn't need to be public, so inline it
- compile: don't do unnecessary check if parse node is a struct
- compile: extract parse-node kind at start of func for efficiency
- compile: add COMP_RETURN_IF_EXPR option to enable return-if-else opt
- compile: don't do unnecessary check if iter parse node is a struct
- compile: refactor handling of special super() call
- add LOAD_SUPER_METHOD bytecode to allow heap-free super meth calls
- mpz: strip trailing zeros from mpz value when set from bytes
- mpz: in mpn_sub, use existing function to remove trailing zeros
- cleanup use of global DEBUG preprocessor definition
- modio: implement uio.resource_stream(package, resource_path)
- objint: in int.from_bytes, only create big-int if really needed
- modio: resource_stream: Implement "package" param handling
- binary: handle storing big-ints to all arrays types
- lexer: simplify lexer startup by using dummy bytes and next_char()
- mkrules.mk: add dependency of .mpy files upon mpy-cross
- lexer: process CR earlier to allow newlines checks on chr1
- modsys: update conditionals for code referencing sys.stdout
- objstringio: fix StringIO reads at or beyond EOF
- sequence: fix boundary errors when slicing with a negative step
- objrange: fix slicing of range when step of slice is negative
- mkenv.mk: use $(TOP) instead of ".." to reference tools, mpy-cross
- vm: fix bug with stackless mode and unwinding of exceptions
- vm: fix bug with unwind jump popping the iterator from a for loop
- emitbc: fix bug with BC emitter computing Python stack size
- mkrules.mk: fix auto-qstr generation when "make -B" is used
- objstringio: catch mp_uint_t overflow of stream position in write()
- move BYTES_PER_WORD definition from ports to py/mpconfig.h
extmod:
- modframebuf: optimize fill_rect subroutine call
- modframebuf: clip pixels drawn by line method
- modframebuf: add GS4_HMSB format
- vfs_fat: rework so it can optionally use OO version of FatFS
- rename vfs_fat_file.h to vfs_fat.h
- add generic VFS sub-system
- vfs_fat: rework to support new generic VFS sub-system
- vfs: add ability for VFS sub-system to import using VfsFat
- modlwip: add socket.readinto() method
- vfs: expose mp_vfs_mount_t type
- vfs_fat: use SECSIZE macro to determine FatFs sector size
- machine_signal: implement "Signal" abstraction for machine module
- vfs_fat: update to use FF_DIR instead of DIR
- vfs: expose lookup_path_raw as mp_vfs_lookup_path
- vfs_fat: remove MICROPY_READER_FATFS component
- vfs_fat: remove MICROPY_FSUSERMOUNT_ADHOC config option
- remove MICROPY_FSUSERMOUNT and related files
- vfs_fat: remove MICROPY_FATFS_OO config option
- merge old fsusermount.h header into vfs.h and vfs_fat.h
- vfs_fat: remove unused fatfs_builtin_open function
- vfs_fat: remove unused function fat_vfs_listdir
- vfs_reader: fix use of NLR by popping context
- vfs_fat.c: use explicit include path for timeutils.h
- machine_pulse: make time_pulse_us() not throw exceptions
- machine_spi: remove EVENT_POLL_HOOK from soft-SPI transfer func
- machine_signal: implement Signal .on() and .off() methods
- vfs: allow to mount a block device, not just a VFS object
- vfs: raise OSError(EEXIST) on attempt to mkdir a mount point
- vfs: allow to stat the root directory
- modlwip: add my copyright
- modurandom: use mp_raise_ValueError()
- modutimeq: make scheduling fair (round-robin)
- modutimeq: add peektime() function (provisional)
- vfs_fat: remove obsolete and unused str/len members
- vfs_fat: allow to compile with MICROPY_VFS_FAT disabled
- vfs: rewrite path lookup algo to support relative paths from root
- modframebuf: add support for monochrome horizontal format
- utime_mphal: don't exit/enter the GIL in generic sleep functions
- modlwip: use mp_obj_str_get_str instead of mp_obj_str_get_data
- vfs_fat: fix calculation of total blocks in statvfs
- moduselect: update to use size_t for array accessor
- update for changes to mp_obj_str_get_data
- modframebuf: make monochrome bitmap formats start with MONO_
- machine_signal: support all Pin's arguments to the constructor
- machine_signal: rename "inverted" arg to "invert", it's shorter
- moductypes: fix bigint handling for 32-bit ports
- crypto-algorithms/sha256: remove non-standard memory.h header
- moduselect: convert to MP_ROM_QSTR and friends
- moduselect: refactor towards introduction of poll.ipoll()
- moduselect: implement ipoll() method for alloc-free polling
- modlwip: getaddrinfo: Allow to accept all 6 standard params
- modlwip: ioctl POLL: Fix handling of peer closed socket
- vfs: allow a VFS to be mounted at the root dir
- vfs: implement mp_vfs_ilistdir()
- vfs_fat: replace listdir() with implementation of ilistdir()
- vfs: use MP_S_IFDIR, MP_S_IFREG consts instead of magic numbers
- vfs_fat_misc: remove dot-dirs filter since FatFS already does it
lib:
- utils: remove old pyhelp helper, replaced with py/builtinhelp.c
- utils/pyexec: only print help prompt if HELP feature is enabled
- oofatfs: add OO version of FatFS library
- fatfs: remove old fatfs library component, it's replaced by oofatfs
- oofatfs/ffconf.h: allow to configure FS_EXFAT option
- oofatfs/ffconf.h: add MICROPY_FATFS_NORTC option
- utils/pyexec: allow to compile when the uPy compiler is disabled
- utils/pyexec: refactor to put lexer constructors all in one place
- memzip: make lexer constructor raise exception when file not found
- utils/pyexec: fix bug with pyexec_file not setting flag for source
- libm: add implementation of nearbyintf, from musl-1.1.16
- netutils: update for changes to mp_obj_str_get_data
- utils/pyexec: update event-driven REPL to match non-event REPL
drivers:
- fix some minor spelling mistakes
- display: add driver and test for uPy LCD160CR display
- memory: add SPI flash driver, written in C
- display/lcd160cr: use correct variable in set_power()
- display/lcd160cr: fix bugs with lcd.get_pixel()
- display/lcd160cr: fix bug with save_to_flash method
- display/lcd160cr: add check that JPEG size is less than 65536
- nrf24l01: update to work on newer ports, using machine, utime
- display/lcd160cr: fix get_line method and enhance screen_dump
- display/lcd160cr_test: allow test to take orientation parameter
- replace deprecated Pin.high()/low() methods with .__call__(1/0)
tools:
- tinytest-codegen.py: blacklist heapalloc_str.py test for qemu-arm
- upip: update to 1.1.5. Better and more user-friendly error handling
- add gen-cpydiff.py to generate docs differences
- gen-cpydiff.py: set the Python import path to find test modules
- gen-cpydiff.py: configurable CPython and micropython executables
- tinytest-codegen: update for recent test renaming ("intbig" suffix)
- pyboard: tighten up Pyboard object closure on errors
- pyboard: add "exec" and "execpty" pseudo-devices support
- pyboard: execpty: Use shell=False to workaround some curdir issues
- pyboard: processPtyToTerminal: Add workaround for PySerial bug
- pyboard: provide more details when expected reply not received
- mpy-tool: make work if run from another directory
- upip: upgrade to 1.1.6, supports commented lines in requirements.txt
- upip: upgrade to 1.2
- mpy-tool.py: use MP_ROM_xxx macros to support nanbox builds
- mpy_cross_all.py: helper tool to run mpy-cross on the entire project
- mpy-tool.py: fix regression with freezing floats in obj repr C
tests:
- add feature check for "const" keyword and skip related tests
- update test suite to be compatible with CPython 3.6
- improve stream.c test coverage
- import: improve builtinimport.c test coverage
- improve frozen import test coverage
- update tests, and add new ones, for recent generator tweaks
- io: improve test coverage of io.BufferedWriter
- basics: improve runtime.c test coverage
- extmod: improve test coverage of ure module
- float: add test for assigning to attribute of complex number
- extmod/framebuf1: add test for no-op fill_rect
- micropython/opt_level: add test for opt_level 3
- misc/non_compliant: add test for inability to assign func attrs
- basics: add test for assignment of attribute to bound method
- add test for int.from_bytes() for arbitrary-precision integer
- heapalloc_int_from_bytes: test that int.from_bytes() can work w/o alloc
- add test for builtin help function
- basics/builtin_help: add test for help('modules')
- make sure special tests can be skipped as well
- extmod/framebuf4: add tests for GS4_HMSB framebuf format
- extmod/framebuf1: fix test for framebuf invalid constructor
- extmod: add test for ure debug printing when compiling a regex
- heapalloc_str: test for alloc-free string operations
- extmod: update vfs_fat tests for new OO FatFs library
- extmod/vfs_fat: update tests to work with new VFS sub-system
- extmod/vfs_fat_ramdisk: make it work on pyboard
- run-tests: skip frozenset tests if set literal syntax is not available
- basics/zip: make skippable
- thread: make thread_exc2 runable on baremetal
- thread: fix stack size test so tests run reliably on baremetal
- heapalloc_bytesio: test for BytesIO with preallocates space
- basics/set_binop: add tests for inplace set operations
- float: add tests for zero to a negative power
- split tests for 2- and 3-arg pow()
- basics/string_format_modulo: add more tests for dict formatting
- pyb: adjust tests so they can run on PYB and PYBLITE
- misc: add test for line number printing with large bytecode chunk
- add option to not clear MICROPYPATH when running tests
- run-tests: allow to skip tests using async/await keywords
- comprehension1, containment: split set tests to separate files
- builtin_dir: the most expected thing in sys is exit, test for it
- basic/[a-f]*: make skippable
- dict_fromkeys: revert to use reversed() to run in native codegen mode
- extmod: make tests skippable
- thread: replace busy waiting loops with a loop that sleeps
- thread: add stress-test for creating many threads
- gen_yield_from_close: use range() instead of reversed()
- basic/: make various tests skippable
- cmdline: update tests to pass with latest changes to bytecode
- cmdline/cmd_showbc: update to work with recent changes
- micropython: add test for iterating with the heap locked
- micropython/heapalloc_iter: add tests for contains and unpack
- cmdline: update cmd_parsetree test for changes to grammar order
- cmdline/cmd_parsetree: update to work with changes to grammar
- basics/string_join: add more tests for string concatenation
- heapalloc_exc_raise.py: heap alloc test for raising/catching exc
- cpydiff: add initial set of tests for uPy-CPython differences
- cpydiff: add a test for storing iterable to a list slice
- micropython: add test for consts that are bignums
- extmod: add test for machine.Signal class
- basics: add further tests for OrderedDict
- run-tests: check for big int availability and skip related tests
- basic: split tests into working with small ints and not working
- float/complex1: split out intbig test
- float2int*: suffix with _intbig, don't run on any other int type
- string_format_modulo2: split off intbig test
- basics/string_join.py: add test case where argument is not iterable
- basics/unpack1.py: test if *a, = b copies b when b is a list
- micropython/: split off intbig tests
- uctypes_array_assign_native_le: split off intbig part
- basic: make various tests skippable
- float: make various tests skippable
- extmod: add very basic feature test for ussl module
- extmod: add websocket tests
- dict_fromkeys: split out skippable part
- micropython: make uio-using tests skippable
- micropython/heapalloc_traceback: fix backtrace line # after refactor
- micropython/opt_level: clarify the expected output for opt_level == 3
- feature_check/int_big: rework "big int" detection
- basics/fun_error: split out skippable test
- extmod: rename websocket test to websocket_basic
- misc/: make few tests skippable
- extmod: add a test for core VFS functionality, sans any filesystem
- extmod/vfs_basic: add more tests for basic VFS functionality
- extmod: improve re1.5/recursiveloop.c test coverage
- improve binary.c test coverage
- basics/struct_micropython: add test for 'S' typecode in ustruct
- run-tests: re-instate skipping of doubleprec test on pyboard
- extmod/vfs_basic: unmount all existing devices before doing test
- extmod: improve tinfgzip.c test coverage
- micropython/viper_error: add more tests to improve coverage
- basics/string_format2: adjust comment now that tests succeed
- basics: add test for string module formatting with int argument
- basics: move string-modulo-format int tests to dedicated file
- basics/bytes_add: add tests for optimised bytes addition
- micropython: add tests for micropython.schedule()
- heapalloc_str: test no-replacement case for str.replace()
- float: add tests for math funcs that return ints
- float: add tests for round() of inf, nan and large number
- basics: add test for super() when self is closed over
- basics: add tests for list and bytearray growing using themselves
- run-tests: be sure to close Pyboard object on completion
- vfs_fat_fileio.py is too big to be parsed in 16K heap, split in 2
- extmod/vfs_fat_fileio*: improve skippability
- float/byte*_construct: skip on missing array module
- micropython/heapalloc_iter: improve skippability
- run-tests: introduce generic "minimal" target
- float: add tests for hashing float and complex numbers
- run-tests: update names of tests that may need skipping
- basics: add tests for raising ValueError when range() gets 0 step
- basics: add test for tuple inplace add
- extmod/utimeq1: improve coverage of utimeq module
- run-tests: search feature checks wrt to main script location
- run-tests: don't post-process CRASH result in any way
- micropython: add test for micropython.kbd_intr()
- add tests for calling super and loading a method directly
- basics: add tests for int.from_bytes when src has trailing zeros
- cpydiff/core_arguments: fill in cause/workaround
- cpydiff/core_function_userattr: clarify, fill in cause and workaround
- cpydiff/core_import_prereg: fill in cause and workaround
- io/resource_stream: add test for uio.resource_stream()
- cpydiff/core_import_path: test showing difference in package.__path__
- cpydiff/core_import_split_ns_pkgs: test for split namespace packages
- cpydiff/core_function_unpacking: fill in workaround
- extmod: add more tests for VFS FAT
- extmod: add some more VFS tests
- micropython: add test for int.from_bytes with many zero bytes
- move super-as-local test from cpydiff to basic tests
- basics: update array test for big-int with lL typecodes
- basics: add memoryview test for big ints
- basics/lexer: add lexer tests for input starting with newlines
- extmod: make some vfs tests fully unmount FSs before running
- extmod/vfs: update tests to reflect new ilistdir() method
- basics/lexer: add line continuation tests for lexer
- extmod/vfs_fat: add test for ilistdir of a non-existent directory
- extmod/vfs_fat_more: make skippable is uos is not available
- io/bytesio_ext: test read() after seek() past end of BytesIO object
- basics/list_slice_3arg: add more tests for negative slicing
- basics/builtin_range: add tests for negative slicing of range
- basics: add more tests for unwind jumps from within a try-finally
mpy-cross:
- main: move lexer constructor to within NLR handler block
- fix compiler detection for including windows/fmode.c
- Makefile: override undefine any inherited variables
- Makefile: guard "override undefine" by test for make feature
bare-arm port:
- main: move lexer constructor to within NLR handler block
- Makefile: change C standard from gnu99 to c99
minimal port:
- update frozentest.mpy file for new .mpy version
- add ability and description to build without the compiler
- main: move lexer constructor to within NLR handler block
- Makefile: change C standard from gnu99 to c99
- main: make Cortex-M vector table constant
unix port:
- coverage: move coverage #if guard back to top of file
- enable builtin help function in coverage build
- enable MICROPY_PY_BUILTINS_HELP_MODULES in coverage build
- switch to OO version of FatFS library
- get minimal version compiling again
- change to use new generic VFS sub-system in coverage build
- fatfs_port: include new oofatfs header
- mpconfigport.h: remove obsolete MICROPY_FATFS_VOLUMES config
- modos: remove VfsFat from uos module, it's now in uos_vfs module
- make stack be non-executable
- fix freedos port build problems
- main: properly handle MICROPYPATH starting with ':'
- moduselect: implement ipoll() method with no-allocation policy
- modmachine: add Signal class to machine module
- remove remaining, obsolete traces of GNU readline support
- moduselect: properly implement ipoll object iteration
- main: refactor to put lexer constructors all in one place
- use mp_handle_pending() in time.sleep()
- coverage: enable scheduler and add tests for it
- use mp_obj_str_get_str instead of mp_obj_str_get_data
- convert mp_uint_t to size_t for use of mp_obj_list_get
- convert mp_uint_t to size_t in alloc.c
- enabled high-quality float hashing in coverage build
- remove obsolete MICROPY_FATFS macro
- main: ignore SIGPIPE signal, instead make EPIPE arrive
- main: don't allow to specify too small heap size
- main: implement -m option for packages
- Makefile: enable frozen bytecode modules dir
- move upip to frozen bytecode dir
- Makefile: don't add frozen bytecode to minimal build
- add ilistdir in uos module
- use core-provided KeyboardInterrupt exception object
windows port:
- .gitignore: ignore VC.db and VC.opendb files from VS2015
- make msvc project file support any version from VS2013 to VS2017
- bring mpconfigport.h up-to-date with unix port
- README: convert to Markdown
- README: fix some typos and grammar
- README: add a note about stack usage for msvc
- use core-provided KeyboardInterrupt exception object
- msvc: add machine/pin-related sources to build
- msvc: remove directory with generated files when cleaning
- msvc: do not define DEBUG for debug builds
- msvc: rebuild all qstrs when mpconfig headers are modified
- msvc: workaround parser bug in older MSBuild versions
qemu-arm port:
- don't compile tests in "REPL" mode
- mpconfigport.h: enable MICROPY_PY_BUILTINS_POW3 option
- enable machine module and associated tests
- add basic uos module with generic VFS capabilities
- move lexer constructors to within NLR handler block
stmhal port:
- support PortG on STM32L476 and STM32L486
- fix wrong usage of gcc -print-libgcc-file-name
- fix USB HID receive not receiving the first packet
- implement ioctl for USB HID read
- implement SNAK/CNAK mechanism for USB HID receive
- convert to use builtin help function
- enable help('modules') feature
- add default frozen-bytecode directory and link lcd160cr driver
- fix examples in openocd configs to include addresses
- add ability to have filesystem stored on external SPI flash
- boards/STM32L476DISC: use external SPI flash for filesystem
- mpconfigport.h: reorganise the config options into groups
- usbd_msc_storage: use storage functions instead of disk ones
- convert to use VFS sub-system and new ooFatFs component
- fix name of automatically created boot.py
- moduos: remove duplicated chdir
- use LED constants from PYBv4 onwards
- set the FatFs partition number when initialising VFS object
- fix stack pointer initialisation for F411 and F429 boards
- README: add paragraph about building mpy-cross
- on boot, mount all available partitions of the SD card
- main: put /sd directory before /flash in sys.path
- pin: add C-level pin ioctl method
- modmachine: add machine.Signal type
- main: guard init_sdcard_fs with MICROPY_HW_HAS_SDCARD
- pendsv: fill in comments about what the stack contains
- initial implementation of multithreading, currently disabled
- main: use _estack value to initialise stack extents
- fix build issue when MICROPY_PY_THREAD is disabled
- mpconfigport.h: enable MICROPY_PY_BUILTINS_POW3 option
- on HardFault, print stack pointer and do a stack dump
- add pyb.fault_debug() function, to control hard-fault behaviour
- use MICROPY_EVENT_POLL_HOOK instead of __WFI where appropriate
- add ability to skip booting from SD card via /flash/SKIPSD file
- Makefile: drop use of -mabi=aapcs-linux; link libgcc by default
- boards: for STM32F411DISC, change I2C pin according to datasheet
- implement a proper thread scheduler
- use generic interrupt char code
- main: remove unnecessary header includes
- use mp_hal_delay_ms instead of HAL_Delay
- rename sys_tick ticks/delay functions to corresp. mp_hal ones
- modpyb: use utime ticks ms/us functions instead of custom ones
- modnwcc3k: add include for mp_hal_delay_ms
- mphalport: get ticks_cpu() working on F7 MCUs
- main: allocate flash's VFS struct on the heap to trace root ptrs
- enable micropython.schedule()
- pendsv: disable interrupts during a thread switch
- irq: shift IRQ priorities of TIM and EXTINT to be above PENDSV
- pybthread: allow interrupts to work during lock/unlock of mutex
- systick: make mp_hal_delay_ms release the GIL when sleeping
- boards: fix alt-func config for PA5 of STM32F767
- board: fix existing and add more pin defs for NUCLEO_F767ZI
- spi: clean and/or invalidate D-cache before SPI DMA transfers
- hal: for F7 MCUs, expose DMA_CalcBaseAndBitshift function
- dma: fix reinitialisation of DMA on F7 MCUs, following F4
- update to use size_t for tuple/list accessors
- update for changes to mp_obj_str_get_data
- spi: increase SPI transfer timeout, proportional to num bytes
- support SDMMC alternate functions in pin generation
- sdcard: add support for SDMMC2 on F7 MCUs
- boards: update F76x alternate function table to add SDMMC2
- boards/STM32F769DISC: get SD card working by using SDMMC2
- boards/STM32F769DISC: fix user switch pin, and document stlink
- boards: remove F769 alt function table, it's same as for F767
- dma: don't include SDMMC2 struct if SDMMC2 is not available
- move L4/F7 I2C timing constants from mpconfigboard.h to i2c.c
- i2c: clean the cache so that I2C DMA works on F7 MCUs
- usbd_cdc_interface: increase in-endpoint timeout to 500ms
- usbd_cdc_interface: change CDC RX to use a circular buffer
- enable parsing of all Pin constructor args by machine.Signal
- timer: clear interrupt flag before setting callback
- convert all module and method tables to use MP_ROM macros
- modmachine: add machine.UART class, linking to pyb.UART
- modmachine: remove TODO comment that is now implemented
- add machine.Pin on/off methods
- add ilistdir in uos module
cc3200 port:
- convert to use builtin help function
- add implementations of mp_import_stat and builtin_open
- modusocket: remove deprecated socket.error
- convert to use new VFS sub-system and new ooFatFs library
- refactor "ticks" functions to use common extmod implementation
- move stoupper to ftp.c and define in terms of unichar_toupper
- use simplelink API instead of emulated BSD API
- remove util/std.h, can just use stdio.h instead
- mods/modwlan: remove unused header includes; simplify others
- mods/modwlan: make multi-threaded a proper compile-time option
- mods/modwlan: allow antenna diversity to be fully compiled out
- mods/modwlan: add int casts to silence compiler warnings
- remove remaining references to std.h
- move wlan socket glue functions from modwlan to modusocket
- convert to using uPy internal errno numbers
- when raising OSError's use MP_Exxx as arg instead of a string
- enable uerrno module with short, custom list of error codes
- mods/modusocket: init vars to 0 to silence compiler warnings
- remove socket.timeout class, use OSError(ETIMEDOUT) instead
- moduos: remove uos.sep, as it's strictly optional
- mptask: allocate flash VFS struct on the heap to trace root ptrs
- mods/modutime: use generic sleep_ms and sleep_us implementations
- update to use size_t for tuple/list accessors
- update for changes to mp_obj_str_get_data
- mods/pybi2c: raise OSError if readfrom_mem fails to write addr
- modmachine: return frequency value directly, like other ports
- pybuart: make parity specifications consistent with HW API
- mods/pybi2c: make machine.I2C constructor/init conform to HW API
- mods/pybi2c: make readfnom_mem_into/writeto_mem return None
- mods/pybpin: remove toggle() method
teensy port:
- convert to use builtin help function
- main: remove unnecessary header includes
- lexerfrozen: make mp_lexer_new_from_file raise an exception
esp8266 port:
- convert to use builtin help function
- factor out common linker code to esp8266_common.ld
- switch to use OO version of FatFs library
- change to use new generic VFS sub-system
- fatfs_port: include new oofatfs header
- machine_pin: implement pin ioctl protocol
- modmachine: add Signal class
- mpconfigport.h: remove obsolete MICROPY_FATFS_VOLUMES config
- uart: add support for polling uart device
- moduos: populate release field of uname in case it was GC'd
- mpconfigport.h: enable help('modules') feature
- update lexer constructors so they can raise exceptions
- only execute main.py if in friendly REPL mode
- enable micropython.schedule() with locking in pin callback
- change machine.Timer callback to soft callback
- machine_pin: add "hard" parameter to pin.irq, soft by default
- machine_pin: make pin.irq arguments positional
- machine_pin: fix memset size for zeroing of pin_irq_is_hard
- machine_pin: fix pin.irq() to work when all args are keywords
- modesp: use mp_obj_str_get_str instead of mp_obj_str_get_data
- modesp: remove long-obsolete and unused espconn bindings
- update to use size_t for tuple/list accessors
- update for changes to mp_obj_str_get_data
- remove unused entry in port root pointers
- README: replace reference of alpha status to beta status
- README: add notice about 512K version
- change default settings to mount flash at root dir
- esp8266.ld, esp8266_ota.ld: grow main firmware size by 32KB
- modesp: flash_user_start: Use value from linker script
- modules/flashbdev: reserve one sector for native code storage
- scripts: move drivers/modules to modules/ (frozen bytecode)
- scripts: move initsetup & port_diag tools to modules/
- ets_alt_task.c: prevent spurious large increment of ticks_ms()
- modnetwork: in connect, fix potential buffer overflows
- machine_uart: add uart.any() method
- modules: mount filesystem at root when creating for first time
- mpconfigport.h: remove duplicate link to lwip module
- rename machine.Pin high/low methods to on/off
- add ilistdir in uos module
zephyr port:
- help: update n_args param type to size_t
- remove deprecated .mdef file
- add separate Zephyr config for "minimal" build
- enable SLIP networking for the default build
- convert to use builtin help function
- make sure that correct Zephyr config is used for "minimal" build
- allow to have per-board Zephyr config fragments
- prj_frdm_k64f.conf: add, enable Ethernet support
- Makefile.zephyr: support and default to networked (SLIP) QEMU
- README: describe many gotchas of networked builds
- enable IPv6 networking in addition to IPv4
- add qemu_cortex_m3 config fragment
- main: don't unconditionally dump stats on each GC
- README: network startup issues with frdm_k64f resolved
- modzephyr: add a module for Zephyr-specific things
- modzephyr: fix typo in identifier
- make sure that generated prj.conf is updated only on content changes
- move "minimal" configuration building to a separate wrapper script
- main: nlr_jump_fail: Fix noreturn warning
- main: remove unused __fatal_error()
- main: move lexer constructor to within NLR handler block
- zephyr_getchar: use native k_sem instead of legacy nano_sem
- prj_base.conf: disable legacy kernel compatibility
- prj_base.conf: enable TCP (and UDP explicitly)
- Makefile: rework to use modern, official build integration
- Makefile: add workaround (fix?) for broken builds for DTS targets
- fix NLR segfault in minimal build
- modusocket: initial version of usocket module for Zephyr
- integrate modusocket into build
- modusocket: implement bind() and connect()
- modusocket: implement send()
- modusocket: implement recv() for UDP sockets
- modusocket: implement recv() for TCP sockets
- prj_base.conf: add config for net_buf logging
- modusocket: be sure to use MP_OBJ_FROM_PTR
- modusocket: factor out socket_new() function
- zephyr_getchar: explicitly yield to other threads on char availability
- Makefile: add "test" target, runs testsuite in QEMU
- modusocket: factor out "extended k_fifo API"
- modusocket: implement listen()
- modusocket: socket_bind: Don't set recv callback on STREAM sockets
- modusocket: implement accept()
- mpconfigport.h: fix build if usocket module is disabled
- modmachine: add Signal class
- machine_pin: implement pin protocol for machine.Signal support
- modusocket: call net_nbuf_print_frags() in recv callback if DEBUG > 1
- modusocket: strip packet header right in the receive callback
- modmachine: implement machine.reset()
- main: configure IPv4 netmask and gateway to allow Internet access
- add 96b_carbon configuration
- modusocket: refactor send() into stream write() method
- modusocket: enable stream write() method
- modusocket: refactor recv() into stream read() method
- modusocket: add read/readline/readinto stream methods
- modusocket: sock_read: Check socket status only at the start of packet
- modusocket: add dummy makefile() implementation
- Makefile: add debugserver Zephyr target
- mpconfigport.h: enable line number information for scripts
- main: remove superfluous include
- modusocket: add dummy setsockopt() implementation
- modusocket: add SOL_SOCKET and SO_REUSEADDR constants
- prj_qemu_x86.conf: bump RAM size to 320K
- README: update to require Zephyr 1.8
- modusocket: wrap pkt_get_info() call
- modusocket: update for net_pkt refactor
- modusocket: switch to net_pkt_append() returning length
- modusocket: if there're no packets in recv_q, cancel waiter
- modusocket: implement getaddrinfo()
- modusocket: first step to switch to alternative FIFO processing
- modusocket: get rid of cur_pkt object member
- main: check default netif before applying operations to it
- modusocket: getaddrinfo: Use RAISE_ERRNO for proper error decoding
- modusocket: getaddrinfo: Raise OSError on resolution timeout, etc
- modusocket: use DEBUG_PRINT macro name as other modules do
- rename machine.Pin high/low methods to on/off
- don't send more than MTU allows
- modusocket: handle a case when recv_q is empty when EOF is signaled
pic16bit port:
- main: make nlr_jump_fail never return
- main: make mp_lexer_new_from_file raise an exception
README:
- explicitly mention "await" support, and formatting for keywords
- add link to docs.micropython.org
- describe extmod/ dir
- change Travis & Coveralls badges to not use link references
travis:
- unconditionally run coveralls analysis, even if others failed
- change an stmhal rule to build PYBV11 instead of default PYBV10
gitattributes:
- add .mpy files to list of binary files
- remove obsolete lines
docs:
- fix some minor spelling mistakes
- add documentation for lcd160cr module
- pyboard/tutorial: add tutorial for LCD160CR
- library/lcd160cr: fix set_brightness range, should be 0..31
- machine.Timer: move WiPy adhoc parts to its documentation
- machine: add explicit note on machine module level and scope
- usocket: clarify exceptions used
- usocket: elaborate "Constants" section
- usocket: clarify description of various methods
- usocket: dedent Methods section
- uio: describe differences between uPy an CPy stream hierarchy
- conf.py: add myself as a copyright holder on the docs
- uio: typo fixes/lexical improvements
- pyboard/tutorial/lcd160cr_skin: fix typo, get_touched->get_touch
- for LCD160CR driver and tutorial, add link to positioning image
- esp8266/tutorial: specify the baudrate in picocom example command
- add M-logo as favicon
- library/pyb.Pin: minor typo fix, B6 should be A0
- library/machine: make separate TOC for WiPy vs non-WiPy
- uos: remove mention of uos.sep
- library/lcd160cr: mention the valid values for set_power() method
- modify Makefile and indexes to generate cPy-differences pages
- uhashlib: provide port-neutral description
- Makefile: define and use PYTHON as the interpreter for CPYDIFF
- machine: fix formatting of Constants section
- library/lcd160cr: add note about supported JPEG format/encodings
- library: add framebuf documentation
- library/lcd160cr: add link to framebuf page
- esp8266/tutorial: update since esptool 1.3 added Python 3 support
- library/framebuf: fix typo in bit-width for MVLSB description
- library/machine.I2C: fix scan() doc to match implementation
- library/btree: add btree module docs
- utime: de-conditionalize description of sleep_ms() and friends
- uos: de-conditionalize statvfs() description
- machine.SPI: remove outdated wipy chunk
- machine.Pin: move wipy-specific details to its own docs
- machine.Pin: move wipy-specific methods to its docs
- esp8266/general: start explicit "Known Issues", mentioned RTC inaccuracy
- library/builtins: int: Add notice on byteorder param for to/from_bytes
- library/machine.UART: remove some conditionals
- utime: deconditionalize description of sleep()
- usocket: deconditionalize
- uhashlib: deconditionalize
- esp8266/tutorial/intro: reword section on flash size requirement
- library/micropython: deconditionalize
- library/uos: urandom: Generalize description
- library/ussl: deconditionalize, wipy notes moved to its documentation
- machine.UART: deconditionalize normal methods
- machine: move machine.main() misnomer to wipy's known issues
- library/machine: typo fix in machine_callbacks section
- library/machine.UART: remove pyboard-specific section
- wipy/quickref: update reference for change to I2C API
- wipy/general: add section about specifics of I2C implementation
- library/machine.I2C: deconditionalise all methods
- library/machine.*: add cross-reference label to individual classes
- esp8266/quickref: add links from quickref page to machine classes
- library/machine.I2C: remove WiPy-specific return values
- library/machine.SPI: fix formatting of bullet list to stop warning
- library/uos: add description of uos.ilistdir() function
- machine.Pin: there's no toggle() method in MicroPython hardware API
- machine.Signal: add initial draft description of Signal class
- library/index: add important summary of the intro section as warning
- change single occurrence of "Micropython" to "MicroPython"
- library/micropython: document the newer micropython functions
- library/machine.UART: update and improve uart.any() docs
- library/machine.Pin: remove .id() method and .board class attr
examples:
- hwapi: use Signal for inverted LED on ESP-12
- hwapi: consistently use Signal class to define LEDs
- button_reaction: update for time_pulse_us() no longer raising exc
- hwapi: add hwconfig_pyboard.py for pyboard
- hwapi: be sure to import Signal when it's used
- hwapi/soft_pwm: use Signal on()/off() methods
- embedding/README: convert to markdown, grammar and clarity fixes
- embedding: place lexer constructor within NLR handler block
- hwapi: add config for Zephyr port of 96Boards Carbon
- hwapi/hwconfig*: use inline Signal() args where possible
- hwapi/soft_pwm2_uasyncio: update for call_later_ms()
Support for Xtensa emitter and assembler, and upgraded F4 and F7 STM HAL
This release adds support for the Xtensa architecture as a target for the
native emitter, as well as Xtensa inline assembler. The int.from_bytes
and int.to_bytes methods now require a second argument (the byte order)
per CPython (only "little" is supported at this time). The "readall"
method has been removed from all stream classes that used it; "read" with
no arguments should be used instead. There is now support for importing
packages from compiled .mpy files. Test coverage is increased to 96%.
The generic I2C driver has improvements: configurable clock stretching
timeout, "stop" argument added to readfrom/writeto methods, "nack"
argument added to readinto, and write[to] now returns num of ACKs
received. The framebuf module now handles 16-bit depth (generic colour
format) and has hline, vline, rect, line methods. A new utimeq module is
added for efficient queue ordering defined by modulo time (to be
compatible with time.ticks_xxx functions). The pyboard.py script has been
modified so that the target board is not reset between scripts or commands
that are given on a single command line.
For the stmhal port the STM Cube HAL has been upgraded: Cube F4 HAL to
v1.13.1 (CMSIS 2.5.1, HAL v1.5.2) and Cube F7 HAL to v1.1.2. There is a
more robust pyb.I2C implementation (DMA is now disabled by default, can be
enabled via an option), and there is an implementation of machine.I2C with
robust error handling and hardware acceleration on F4 MCUs. It is now
recommended to use machine.I2C instead of pyb.I2C. The UART class is now
more robust with better handling of errors/timeouts. There is also more
accurate VBAT and VREFINT measurements for the ADC. New boards that are
supported include: NUCLEO_F767ZI, STM32F769DISC and NUCLEO_L476RG.
For the esp8266 port select/poll is now supported for sockets using the
uselect module. There is support for native and viper emitters, as well
as an inline assembler (with limited iRAM for storage of native functions,
or the option to store code to flash). There is improved software I2C
with a slight API change: scl/sda pins can be specified as positional only
when "-1" is passed as the first argument to indicate the use of software
I2C. It is recommended to use keyword arguments for scl/sda. There is
very early support for over-the-air (OTA) updates using the yaota8266
project.
A detailed list of changes follows.
py core:
- emitnative: fix native import emitter when in viper mode
- remove readall() method, which is equivalent to read() w/o args
- objexcept: allow clearing traceback with 'exc.__traceback__ = None'
- runtime: mp_resume: handle exceptions in Python __next__()
- mkrules.mk: rework find command so it works on OSX
- *.mk: replace uses of 'sed' with $(SED)
- parse: move function to check for const parse node to parse.[ch]
- parse: make mp_parse_node_new_leaf an inline function
- parse: add code to fold logical constants in or/and/not operations
- factor persistent code load/save funcs into persistentcode.[ch]
- factor out persistent-code reader into separate files
- lexer: rewrite mp_lexer_new_from_str_len in terms of mp_reader_mem
- lexer: provide generic mp_lexer_new_from_file based on mp_reader
- lexer: rewrite mp_lexer_new_from_fd in terms of mp_reader
- lexer: make lexer use an mp_reader as its source
- objtype: implement __call__ handling for an instance w/o heap alloc
- factor out common code from assemblers into asmbase.[ch]
- stream: move ad-hoc ioctl constants to stream.h and rename them
- compile: simplify configuration of native emitter
- emit.h: remove long-obsolete declarations for cpython emitter
- move arch-specific assembler macros from emitnative to asmXXX.h
- asmbase: add MP_PLAT_COMMIT_EXEC option for handling exec code
- asmxtensa: add low-level Xtensa assembler
- integrate Xtensa assembler into native emitter
- allow inline-assembler emitter to be generic
- add inline Xtensa assembler
- emitinline: embed entire asm struct instead of a pointer to it
- emitinline: move inline-asm align and data methods to compiler
- emitinline: move common code for end of final pass to compiler
- asm: remove need for dummy_data when doing initial assembler passes
- objint: from_bytes, to_bytes: require byteorder arg, require "little"
- binary: do zero extension when storing a value larger than word size
- builtinimport: support importing packages from compiled .mpy files
- mpz: remove unreachable code in mpn_or_neg functions
- runtime: zero out fs_user_mount array in mp_init
- mpconfig.h: enable MICROPY_PY_SYS_EXIT by default
- add MICROPY_KBD_EXCEPTION config option to provide mp_kbd_exception
- compile: add an extra pass for Xtensa inline assembler
- modbuiltins: remove unreachable code
- objint: rename mp_obj_int_as_float to mp_obj_int_as_float_impl
- emitglue: refactor to remove assert(0), to improve coverage
- lexer: remove unreachable code in string tokeniser
- lexer: remove unnecessary check for EOF in lexer's next_char func
- lexer: permanently disable the mp_lexer_show_token function
- parsenum: simplify and generalise decoding of digit values
- mpz: fix assertion in mpz_set_from_str which checks value of base
- mpprint: add assertion for, and comment about, valid base values
- objint: simplify mp_int_format_size and remove unreachable code
- unicode: comment-out unused function unichar_isprint
- consistently update signatures of .make_new and .call methods
- mkrules.mk: add MPY_CROSS_FLAGS option to pass flags to mpy-cross
- builtinimport: fix bug when importing names from frozen packages
extmod:
- machine_i2c: make the clock stretching timeout configurable
- machine_i2c: raise an error when clock stretching times out
- machine_i2c: release SDA on bus error
- machine_i2c: add a C-level I2C-protocol, refactoring soft I2C
- machine_i2c: add argument to C funcs to control stop generation
- machine_i2c: rewrite i2c.scan in terms of C-level protocol
- machine_i2c: rewrite mem xfer funcs in terms of C-level protocol
- machine_i2c: remove unneeded i2c_write_mem/i2c_read_mem funcs
- machine_i2c: make C-level functions return -errno on I2C error
- machine_i2c: add 'nack' argument to i2c.readinto
- machine_i2c: make i2c.write[to] methods return num of ACKs recvd
- machine_i2c: add 'stop' argument to i2c readfrom/writeto meths
- machine_i2c: remove trivial function wrappers
- machine_i2c: expose soft I2C obj and readfrom/writeto funcs
- machine_i2c: add hook to constructor to call port-specific code
- modurandom: allow to build with float disabled
- modframebuf: make FrameBuffer handle 16bit depth
- modframebuf: add back legacy FrameBuffer1 "class"
- modframebuf: optimise fill and fill_rect methods
- vfs_fat: implement POSIX behaviour of rename, allow to overwrite
- moduselect: use stream helper function instead of ad-hoc code
- moduselect: use configurable EVENT_POLL_HOOK instead of WFI
- modlwip: add ioctl method to socket, with poll implementation
- vfs_fat_file: allow file obj to respond to ioctl flush request
- modbtree: add method to sync the database
- modbtree: rename "sync" method to "flush" for consistency
- modframebuf: add hline, vline, rect and line methods
- machine_spi: provide reusable software SPI class
- modframebuf: make framebuf implement the buffer protocol
- modframebuf: store underlying buffer object to prevent GC free
- modutimeq: copy of current moduheapq with timeq support for refactoring
- modutimeq: refactor into optimized class
- modutimeq: make time_less_than be actually "less than", not less/eq
lib:
- utils/interrupt_char: use core-provided mp_kbd_exception if enabled
drivers:
- display/ssd1306.py: update to use FrameBuffer not FrameBuffer1
- onewire: enable pull up on data pin
- onewire/ds18x20: fix negative temperature calc for DS18B20
tools:
- tinytest-codegen: blacklist recently added uheapq_timeq test (qemu-arm)
- pyboard.py: refactor so target is not reset between scripts/cmd
- mpy-tool.py: add support for OPT_CACHE_MAP_LOOKUP_IN_BYTECODE
tests:
- micropython: add test for import from within viper function
- use read() instead of readall()
- basics: add test for logical constant folding
- micropython: add test for creating traceback without allocation
- micropython: move alloc-less traceback test to separate test file
- extmod: improve ujson coverage
- basics: improve user class coverage
- basics: add test for dict.fromkeys where arg is a generator
- basics: add tests for if-expressions
- basics: change dict_fromkeys test so it doesn't use generators
- basics: enable tests for list slice getting with 3rd arg
- extmod/vfs_fat_fileio: add test for constructor of FileIO type
- extmod/btree1: exercise btree.flush()
- extmod/framebuf1: add basics tests for hline, vline, rect, line
- update for required byteorder arg for int.from_bytes()/to_bytes()
- extmod: improve moductypes test coverage
- extmod: improve modframebuf test coverage
- micropython: get heapalloc_traceback test running on baremetal
- struct*: make skippable
- basics: improve mpz test coverage
- float/builtin_float_round: test round() with second arg
- basics/builtin_dir: add test for dir() of a type
- basics: add test for builtin locals()
- basics/set_pop: improve coverage of set functions
- run-tests: for REPL tests make sure the REPL is exited at the end
- basics: improve test coverage for generators
- import: add a test which uses ... in from-import statement
- add tests to improve coverage of runtime.c
- add tests to improve coverage of objarray.c
- extmod: add test for utimeq module
- basics/lexer: add a test for newline-escaping within a string
- add a coverage test for printing the parse-tree
- utimeq_stable: test for partial stability of utimeq queuing
- heapalloc_inst_call: test for no alloc for simple object calls
- basics: add tests for parsing of ints with base 36
- basics: add tests to improve coverage of binary.c
- micropython: add test for micropython.stack_use() function
- extmod: improve ubinascii.c test coverage
- thread: improve modthread.c test coverage
- cmdline: improve repl.c autocomplete test coverage
- unix: improve runtime_utils.c test coverage
- pyb/uart: update test to match recent change to UART timeout_char
- run-tests: allow to skip set tests
- improve warning.c test coverage
- float: improve formatfloat.c test coverage using Python
- unix: improve formatfloat.c test coverage using C
- unix/extra_coverage: add basic tests to import frozen str and mpy
- types1: split out set type test to set_types
- array: allow to skip test if "array" is unavailable
- unix/extra_coverage: add tests for importing frozen packages
unix port:
- rename define for unix moduselect to MICROPY_PY_USELECT_POSIX
- Makefile: update freedos target for change of USELECT config name
- enable utimeq module
- main: allow to print the parse tree in coverage build
- Makefile: make "coverage_test" target mirror Travis test actions
- moduselect: if file object passed to .register(), return it in .poll()
- Makefile: split long line for coverage target, easier to modify
- enable and add basic frozen str and frozen mpy in coverage build
- Makefile: allow cache-map-lookup optimisation with frozen bytecode
windows port:
- enable READER_POSIX to get access to lexer_new_from_file
stmhal port:
- dma: de-init the DMA peripheral properly before initialising
- i2c: add option to I2C to enable/disable use of DMA transfers
- i2c: reset the I2C peripheral if there was an error on the bus
- rename mp_hal_pin_set_af to _config_alt, to simplify alt config
- upgrade to STM32CubeF4 v1.13.0 - CMSIS/Device 2.5.1
- upgrade to STM32CubeF4 v1.13.0 - HAL v1.5.1
- apply STM32CubeF4 v1.13.1 patch - upgrade HAL driver to v1.5.2
- hal/i2c: reapply HAL commit ea040a4 for f4
- hal/sd: reapply HAL commit 1d7fb82 for f4
- hal: reapply HAL commit 9db719b for f4
- hal/rcc: reapply HAL commit c568a2b for f4
- hal/sd: reapply HAL commit 09de030 for f4
- boards: configure all F4 boards to work with new HAL
- make-stmconst.py: fix regex's to work with current CMSIS
- i2c: handle I2C IRQs
- dma: precalculate register base and bitshift on handle init
- dma: mark DMA sate as READY even if HAL_DMA_Init is skipped
- can: clear FIFO flags in IRQ handler
- i2c: provide custom IRQ handlers
- hal: do not include <stdio.h> in HAL headers
- mphalport.h: use single GPIOx->BSRR register
- make-stmconst.py: add support for files with invalid utf8 bytes
- update HALCOMMITS due to change to hal
- make-stmconst.py: restore Python 2 compatibility
- update HALCOMMITS due to change to hal
- moduselect: move to extmod/ for reuse by other ports
- i2c: use the HAL's I2C IRQ handler for F7 and L4 MCUs
- updates to get F411 MCUs compiling with latest ST HAL
- i2c: remove use of legacy I2C_NOSTRETCH_DISABLED option
- add beginnings of port-specific machine.I2C implementation
- i2c: add support for I2C4 hardware block on F7 MCUs
- i2c: expose the pyb_i2c_obj_t struct and some relevant functions
- machine_i2c: provide HW implementation of I2C peripherals for F4
- add support for flash storage on STM32F415
- add back GPIO_BSRRL and GPIO_BSRRH constants to stm module
- add OpenOCD configuration for STM32L4
- add address parameters to openocd config files
- adc: add "mask" selection parameter to pyb.ADCAll constructor
- adc: provide more accurate measure of VBAT and VREFINT
- adc: make ADCAll.read_core_temp return accurate float value
- adc: add ADCAll.read_vref method, returning "3.3v" value
- adc: add support for F767 MCU
- adc: make channel "16" always map to the temperature sensor
- sdcard: clean/invalidate cache before DMA transfers with SD card
- moduos: implement POSIX behaviour of rename, allow to overwrite
- adc: use constants from new HAL version
- refactor UART configuration to use pin objects
- uart: add support for UART7 and UART8 on F7 MCUs
- uart: add check that UART id is valid for the given board
- cmsis: update STM32F7 CMSIS device include files to V1.1.2
- hal: update ST32CubeF7 HAL files to V1.1.2
- port of f4 hal commit c568a2b to updated f7 hal
- port of f4 hal commit 09de030 to updated f7 hal
- port of f4 hal commit 1d7fb82 to updated f7 hal
- declare and initialise PrescTables for F7 MCUs
- boards/STM32F7DISC: define LSE_STARTUP_TIMEOUT
- hal: update HALCOMMITS due to change in f7 hal files
- refactor to use extmod implementation of software SPI class
- cmsis: add CMSIS file stm32f767xx.h, V1.1.2
- add NUCLEO_F767ZI board, with openocd config for stm32f7
- cmsis: add CMSIS file stm32f769xx.h, V1.1.2
- add STM32F769DISC board files
- move PY_SYS_PLATFORM config from board to general config file
- mpconfigport: add weak-module links for io, collections, random
- rename mp_const_vcp_interrupt to mp_kbd_exception
- usb: always use the mp_kbd_exception object for VCP interrupt
- use core-provided keyboard exception object
- led: properly initialise timer handle to zero before using it
- mphalport.h: explicitly use HAL's GPIO constants for pull modes
- usrsw: use mp_hal_pin_config function instead of HAL_GPIO_Init
- led: use mp_hal_pin_config function instead of HAL_GPIO_Init
- sdcard: use mp_hal_pin_config function instead of HAL_GPIO_Init
- add support for STM32 Nucleo64 L476RG
- uart: provide a custom function to transmit over UART
- uart: increase inter-character timeout by 1ms
- enable utimeq module
cc3200 port:
- tools/smoke.py: change readall() to read()
- pybspi: remove static mode=SPI.MASTER parameter for latest HW API
- mods/pybspi: remove SPI.MASTER constant, it's no longer needed
- update for moduselect moved to extmod/
- re-add support for UART REPL (MICROPY_STDIO_UART setting)
- enable UART REPL by default
- README: (re)add information about accessing REPL on serial
- make: rename "deploy" target to "deploy-ota"
- add targets to erase flash, deploy firmware using cc3200tool
- README: reorganize and update to the current state of affairs
- modwlan: add network.WLAN.print_ver() diagnostic function
esp8266 port:
- enable uselect module
- move websocket_helper.py from scripts to modules for frozen BC
- refactor to use extmod implementation of software SPI class
- mpconfigport_512k: disable framebuf module for 512k build
- enable native emitter for Xtensa arch
- enable inline Xtensa assembler
- add "ota" target to produce firmware binary for use with yaota8266
- use core-provided keyboard exception object
- add "erase" target to Makefile, to erase entire flash
- when doing GC be sure to trace the memory holding native code
- modesp: flash_user_start(): support configuration with yaota8266
- force relinking OTA firmware image if built after normal one
- scripts/inisetup: dump FS starting sector/size on error
- Makefile: produce OTA firmware as firmware-ota.bin
- modesp: make check_fw() work with OTA firmware
- enable utimeq module
- Makefile: put firmware-ota.bin in build/, for consistency
- modules/flashbdev: add RESERVED_SECS before the filesystem
- modules/flashbdev: remove code to patch bootloader flash size
- modules/flashbdev: remove now-unused function set_bl_flash_size
- modules/flashbdev: change RESERVED_SECS to 0
zephyr port:
- add .gitignore to ignore Zephyr's "outdir" directory
- zephyr_getchar: update to Zephyr 1.6 unified kernel API
- switch to Zephyr 1.6 unified kernel API
- support raw REPL
- implement soft reset feature
- main: initialize sys.path and sys.argv
- use core-provided keyboard exception object
- uart_core: access console UART directly instead of printk() hack
- enable slice subscription
docs:
- remove references to readall() and update stream read() docs
- library/index: elaborate on u-modules
- library/machine.I2C: refine definitions of I2C methods
- library/pyb.Accel: add hardware note about pins used by accel
- library/pyb.UART: added clarification about timeouts
- library/pyb.UART: moved writechar doc to sit with other writes
- esp8266/tutorial: update intro to add Getting the firmware section
- library/machine.I2C: fix I2C constructor docs to match impl
- esp8266/tutorial: close socket after reading page content
- esp8266/general: add "Scarcity of runtime resources" section
- library/esp: document esp.set_native_code_location() function
- library/esp: remove para and add further warning about flash
- usocket: clarify that socket timeout raises OSError exception
travis:
- build STM32 F7 and L4 boards under Travis CI
- include persistent bytecode with floats in coverage tests
examples:
- hwapi: button_led: Add GPIO pin read example
- hwapi: add soft_pwm example converted to uasyncio
- http_client: use read() instead of readall()
- hwapi: add uasyncio example of fading 2 LEDs in parallel
- hwapi: add example for machine.time_pulse_us()
- hwapi: add hwconfig for console tracing of LED operations
- accellog.py: change 1: to /sd/, and update comment about FS
- hwapi/hwconfig_console: don't alloc memory in value()
New port to Zephyr, upip runs on baremetal, and reduction in code size
This release adds a new port of MicroPython to run on top of the Zephyr
real-time operating system. As part of this there is now basic support for
using mbedTLS as the ussl module. The release also brings initial support
for running the package manager upip on baremetal systems with low heap
memory (such as esp8266), through a Python module interface.
Work has been done in this release to clean up the core, removing redundant
and/or unreachable code, and factoring existing duplicated code patterns.
This brings a reduction of 828 bytes in code size to the bare-arm port, and
1368 bytes to the minimal port. There is also improved coverage through
the addition of new tests for corner cases.
The "micropython" module sees the addition of the "const" identity function
which should be used as "from micropython import const" in scripts that
want to use the MicroPython constant optimisations in the compile stage.
There is also the addition of the "opt_level" function to change the
parser/compiler optimisation level at runtime.
The behaviour of "sys.exit" (and "raise SystemExit") on baremetal is now
changed: this function no longer does a soft-reset of the board, rather it
just stops the running script and drops to the REPL. In order to do an
actual soft reset the "machine.soft_reset" function has been added (to the
stmhal port only, for the time being).
Following CPython, KeyError exceptions for dictionary lookups now have the
failed key stored as the argument of the exception instance, accessible as
exc.args[0]. The "ujson.load" function has also been added, to load JSON
data from an arbitrary stream.
The I2C support in the machine module now has clock stretching, the
addition of the "addrsize" parameter in memory transfer methods, and I2C
scanning now uses dummy writes instead of dummy reads to make the scanning
more reliable.
The CMSIS library has been upgrade to v4.30, and the boards section of
the stmhal port has been refactored to use a common.ld script. The stmhal
port now has a full implementation of the machine.SPI class, with support
for both hardware SPI peripherals and fast software SPI. The USB HID
driver in stmhal has added support to receive USB HID messages from the
host.
py core:
- asmthumb: flush D-cache, and invalidate I-cache on STM32F7
- makeqstrdefs.py: use python 2.6 syntax for set creation
- objnone: remove unnecessary handling of MP_UNARY_OP_BOOL
- move frozen modules rules from esp8266 port for reuse across ports
- combine 3 comprehension emit functions (list/dict/set) into 1
- combine 3 comprehension opcodes (list/dict/set) into 1
- vstr: remove vstr.had_error flag and inline basic vstr functions
- objnone: use mp_generic_unary_op instead of custom one
- showbc: make printf's go to the platform print stream
- remove 'name' member from mp_obj_module_t struct
- builtinimport: fix nanbox build after change to better handle -m modules
- stream: remove unnecessary check for NULL return from vstr_extend
- py.mk: suppress some compiler warnings when building berkeley-db
- shrink mp_arg_t struct by using reduced-size integer members
- update opcode format table because 3 opcodes were removed, 1 added
- parse: only replace constants that are standalone identifiers
- py.mk: add support for building modussl_mbedtls
- only store the exception instance on Py stack in bytecode try block
- vm: use MP_OBJ_FROM_PTR to cast a type to an object
- modmicropython: add micropython.const, alias for identity function
- objstr: remove unreachable function used only for terse error msgs
- emitbc: remove/refactor unreachable code, to improve coverage
- objfun: remove unnecessary check for viper fun with 5 or more args
- objfun: use if instead of switch to check return value of VM execute
- objset: use mp_check_self() to check args of set/frozenset methods
- objset: ensure that use of frozenset.update raises an exception
- compile: fix async-for/async-with to work with simpler exc on stack
- scope: use lookup-table to determine a scope's simple name
- scope: shrink scope_t struct by 1 machine word
- scope: factor common code to find locals and close over them
- compile: fix typo when checking for parse-node kind
- argcheck: simplify if-chain so that the last one is the default
- objbool: defer bool's unary op implementation to small int
- objbool: make a slight simplification of bool constructor
- modstruct: remove unreachable code, and add comment about CPy diff
- add mp_raise_OSError(errno) helper function
- objstringio: add readinto() method
- modmicropython: add micropython.opt_level([value]) function
- compile: remove unreachable code
- mpz: in divmod, replace check for rhs!=0 with assert
- mpz: use assert to verify mpz does not have a fixed digit buffer
- factor duplicated function to calculate size of formatted int
- objint: use size_t for arguments that measure bytes/sizes
- compile: remove debugging code for compiler dispatch
- lexer: remove unnecessary code, and unreachable code
- vstr: combine vstr_new_size with vstr_new since they are rarely used
- objdict: fix optimisation for allocating result in fromkeys
- objdict: actually provide the key that failed in KeyError exception
- use mp_raise_msg helper function where appropriate
- add the module specified by -m to sys.modules as '__main__'
extmod:
- modussl_mbedtls: initial implementation of mbedTLS ussl module
- uctypes: allow full 32-bit address range
- modubinascii: fix crc32() function on 32-bit platforms
- modussl_mbedtls: implement key= and cert= args to wrap_socket()
- modussl_mbedtls: use 2-component include paths
- machine_i2c: add clock stretching support
- modussl_mbedtls: add server_hostname param for wrap_socket()
- uzlib: add tinfgzip.c (gzip header parsing) from upstream
- moduzlib: DecompIO: Add support for gzip-formatted streams
- uzlib/: update uzlib to v2.0.3
- vfs_fat: add fat_vfs_statvfs(), reused from stmhal
- machine_i2c: add support for the addrsize parameter in mem xfers
- machine_spi: simplify SPI xfer function to only take one buf len
- machine_spi: factor out software SPI code from esp8266 to extmod
- machine_spi: use delay_half, not baudrate, for internal timing
- machine_spi: add optional support for fast software SPI
- vfs_fat: use mp_raise_OSError helper function
- modlwip: use mp_raise_OSError helper function
- use mp_raise_OSError helper function
- vfs_fat_file: use MP_Exxx errno constants
- uzlib: update to upstream v2.1
- machine_i2c: use writes not reads in i2c.scan()
- vfs_fat: add file and directory checks for remove and rmdir
- modujson: implement ujson.load() to load JSON from a stream
- modujson: fix nanbox build
- utime_mphal: factor out implementations in terms of mp_hal_* for reuse
- utime_mphal: sleep_us/ms(): Don't wait on negative argument
- modussl_mbedtls: add dummy setblocking() method
lib:
- interrupt_char: factor out typical Ctrl+C handling from esp8266 port
- cmsis: move CMSIS headers to lib/
- cmsis: remove CMSIS-DSP headers, they are unused
- cmsis: upgrade CMSIS-CORE to V4.30
- utils/pyexec: don't treat SystemExit as "forced exit"
- utils/pyexec: allow behaviour of SystemExit to be configurable
drivers:
- dht: use mp_raise_OSError helper function
tools:
- update upip to 0.8, fixes IPv6 support
- upgrade upip to 1.0, fully self-hosted release (without fallbacks), and
uses stream gzip decompression (step towards support for limited-heap
baremetal systems)
- upgrade upip to 1.1.3, initial support for running on a baremetal,
low-heap systems (like esp8266), using Python module interface
tests:
- pyb: add test for ExtInt when doing swint while disabled
- pyb: update exp file for previously updated extint test
- extmod/urandom: add urandom tests for error cases
- basics: add errno1 test, to check basics of uerrno module
- extmod: add test for machine.time_pulse_us()
- struct1: test "l" specifier to improve coverage
- array1: add tests for "l", "L" array types to improve coverage
- get cmdline verbose tests running again
- run-tests: add --via-mpy option to run test from precompiled code
- uzlib_decompio_gz: test for DecompIO with gzip bitstream
- basics: add test case for overflowing Py stack in try-finally
- micropython: add tests for const names being replaced in parser
- cmdline/cmd_showbc: fix test now that 1 value is stored on stack
- extmod/vfs_fat_ramdisk: add test for VFS.statvfs()
- float: add test for parsing a float from an empty string
- basics: add test for set.difference_update with arg being itself
- basics: add further tests for nonlocal scoping and closures
- import: add test for compiling "import a.b as c"
- basics: add test constructing a set from a non-trivial expression
- basics: add test for printing OSError when errno is unknown
- run-tests: disable cmdline/cmd_showbc test on Windows
- extmod/btree1: checks for put, seq, string print and unsupported binary op
- fix expected output of verbose cmdline test
- extmod/uzlib: test adaptive huffman tree for tinflate coverage
- improve coverage of struct with test for non-compliant behaviour
- io/write_ext: add description comment
- io/bytesio_ext: add test for readinto()
- micropython: add test for micropython.opt_level() function
- improve test coverage of py/compile.c
- extmod/vfs_fat: test coverage for remove() and rmdir()
- extmod: add test for ujson.load()
- extmod/vfs_fat: replace asserts with prints and expected outputs
- micropython: add tests for heap_lock, and emergency exceptions
- cmdline: improve coverage test for printing bytecode
- improve coverage of array, range, dict, slice, exc, unicode
- add test to print full KeyError exc from failed dict lookup
- run-tests: enable extmod/machine1.py on pyboard
unix port:
- fix build for when MICROPY_PY_SOCKET=0
- modjni: implement subscription for object arrays
- modjni: add array() top-level function to create Java array
- modjni: array(): Support creation of object arrays
- enable btree module for coverage build
- use mp_raise_OSError helper function
- use common RAISE_ERRNO macro from mphalport.h
windows port:
- enable MICROPY_PY_UERRNO
qemu-arm port:
- enable lots of extmods and enable tests for them
stmhal port:
- lcd: de-assert chip select after completing SPI transmission
- {accel,lcd}: use GPIO_{set,clear}_pin
- extint: force 0 to 1 transition on swint()
- boards: add pllvalues.py script to compute PLL values for sysclk
- boards: for OLIMEX_E407, enable UART1 and fix I2C1 mapping
- use attribute to avoid inlining
- put common definitions from linker files to common.ld
- remove STM32CubeF2 HAL files, they are unused/unsupported
- modmachine: fix clearing of reset-cause flags
- add virtual com port support for STM32L476DISC
- remove CMSIS STM32F2xx files, they are unused/unsupported
- spi: simplify spi_transfer function to take only one buf len arg
- mphalport: implement mp_hal_pin_{input,output,write}
- spi: make machine.SPI class conform to correct API
- mphalport: fix mp_hal_pin_write to use correct pin_mask
- spi: use software SPI if no periph id given, even if pins given
- spi: enable use of fast software SPI
- fix linker map for STM32L476 chips
- usbdev: add OUT endpoint to HID interface
- usb: add support to receive USB HID messages from host
- usb: use correct ClassData structure for HID receive
- usb: use real packet size (not maximum) in HID receive
- fix ESPRUINO_PICO by adding ld scripts with correct flash size
- mphalport: change pin obj type to const pointer, to avoid casts
- moduos: implement total-number-of-blocks field in statvfs
- disable network and usocket for ESPRUINO_PICO
- enable machine.time_pulse_us() function
- use mp_raise_OSError helper function
- pybstdio: use size_t instead of mp_uint_t
- modutime: refactor to use extmod/utime_mphal.c
- implement machine.soft_reset()
- enable str.center(), str.[r]partition() and builtin compile()
cc3200 port:
- add ssl_version argument to ssl.wrap_socket()
esp8266 port:
- Makefile: rename SCRIPTDIR to FROZEN_DIR for consistency with FROZEN_MPY_DIR
- ets_alt_task: ets_post: Should return 0 on success, !0 - failure
- esp_mphal: add tentative change to mp_hal_stdin_rx_chr() to wait IRQ
- extend system microsecond counter to 64-bits; use in ticks_ms
- add uos.statvfs() to get filesystem status
- moduos: move stat/statvfs funcs to sit within #if VFS guard
- modmachine: idle(): Return number of CPU cycles spent idling
- main: put /lib before / in sys.path
- modpybrtc.c: implement machine.RTC.alarm_left()
- make PY_UHASHLIB_SHA1 config depend on PY_USSL and SSL_AXTLS
- add FLASH_MODE,FLASH_SIZE options for make deploy target
- use mp_raise_OSError helper function
- make neopixel support configurable
- mpconfigport: enable MICROPY_PY_BUILTINS_SLICE_ATTRS
- enable sys.{stdin,stdout,stderr}.buffer for raw serial access
- enable importing of precompiled .mpy files
- enable micropython.alloc_emergency_exception_buf()
zephyr port:
- initial Zephyr RTOS port, MicroPython part
- initial Zephyr RTOS port, Zephyr part
- add zephyr_getchar module to handle console input
- switch to microkernel, required for network to work in background
- automatically derive ARCH
- support extra make targets
- Makefile: automatically derive target-specific CFLAGS
- use recently added "make outputexports" Zephyr target
- add README
- enable stack checking and micropython.mem_info()
- enable frozen modules support
- main: execute main.py frozen module on boot, if available
- zephyr_getchar: add support for Ctrl+C handling
- add Ctrl+C handling
- implement the help() function
- add copyright blurbs
README:
- remove issue-stats badges, the service is no longer available
- mention _thread module availability in select ports
docs:
- library/pyb.SPI: init(): describe "bits" argument
- library/machine: update description of disable/enable IRQ funcs
- uos: add uos.statvfs() documentation
- wipy: correct deep sleep current figure
- wipy: small doc fixes
- reference: add constrained.rst doc
travis:
- abandon mingw32 in favour of mingw-w64
- run feature and coverage test for precompiled mpy files
examples:
- network/http_client*: use \r\n line-endings in request
The code conventions suggest using header guards, but do not define how
those should look like and instead point to existing files. However, not
all existing files follow the same scheme, sometimes omitting header guards
altogether, sometimes using non-standard names, making it easy to
accidentally pick a "wrong" example.
This commit ensures that all header files of the MicroPython project (that
were not simply copied from somewhere else) follow the same pattern, that
was already present in the majority of files, especially in the py folder.
The rules are as follows.
Naming convention:
* start with the words MICROPY_INCLUDED
* contain the full path to the file
* replace special characters with _
In addition, there are no empty lines before #ifndef, between #ifndef and
one empty line before #endif. #endif is followed by a comment containing
the name of the guard macro.
py/grammar.h cannot use header guards by design, since it has to be
included multiple times in a single C file. Several other files also do not
need header guards as they are only used internally and guaranteed to be
included only once:
* MICROPY_MPHALPORT_H
* mpconfigboard.h
* mpconfigport.h
* mpthreadport.h
* pin_defs_*.h
* qstrdefs*.h
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
This patch moves some common code from the individual inline assemblers to
the compiler, the code that calls the emit-glue to assign the machine code
to the functions scope.
This patch adds the MICROPY_EMIT_INLINE_XTENSA option, which, when
enabled, allows the @micropython.asm_xtensa decorator to be used.
The following opcodes are currently supported (ax is a register, a0-a15):
ret_n()
callx0(ax)
j(label)
jx(ax)
beqz(ax, label)
bnez(ax, label)
mov(ax, ay)
movi(ax, imm) # imm can be full 32-bit, uses l32r if needed
and_(ax, ay, az)
or_(ax, ay, az)
xor(ax, ay, az)
add(ax, ay, az)
sub(ax, ay, az)
mull(ax, ay, az)
l8ui(ax, ay, imm)
l16ui(ax, ay, imm)
l32i(ax, ay, imm)
s8i(ax, ay, imm)
s16i(ax, ay, imm)
s32i(ax, ay, imm)
l16si(ax, ay, imm)
addi(ax, ay, imm)
ball(ax, ay, label)
bany(ax, ay, label)
bbc(ax, ay, label)
bbs(ax, ay, label)
beq(ax, ay, label)
bge(ax, ay, label)
bgeu(ax, ay, label)
blt(ax, ay, label)
bnall(ax, ay, label)
bne(ax, ay, label)
bnone(ax, ay, label)
Upon entry to the assembly function the registers a0, a12, a13, a14 are
pushed to the stack and the stack pointer (a1) decreased by 16. Upon
exit, these registers and the stack pointer are restored, and ret.n is
executed to return to the caller (caller address is in a0).
Note that the ABI for the Xtensa emitters is non-windowing.
The 3 kinds of comprehensions are similar enough that merging their emit
functions reduces code size. Decreases in code size in bytes are:
bare-arm:24, minimal:96, unix(NDEBUG,x86-64):328, stmhal:80, esp8266:76.
unix-cpy was originally written to get semantic equivalent with CPython
without writing functional tests. When writing the initial
implementation of uPy it was a long way between lexer and functional
tests, so the half-way test was to make sure that the bytecode was
correct. The idea was that if the uPy bytecode matched CPython 1-1 then
uPy would be proper Python if the bytecodes acted correctly. And having
matching bytecode meant that it was less likely to miss some deep
subtlety in the Python semantics that would require an architectural
change later on.
But that is all history and it no longer makes sense to retain the
ability to output CPython bytecode, because:
1. It outputs CPython 3.3 compatible bytecode. CPython's bytecode
changes from version to version, and seems to have changed quite a bit
in 3.5. There's no point in changing the bytecode output to match
CPython anymore.
2. uPy and CPy do different optimisations to the bytecode which makes it
harder to match.
3. The bytecode tests are not run. They were never part of Travis and
are not run locally anymore.
4. The EMIT_CPYTHON option needs a lot of extra source code which adds
heaps of noise, especially in compile.c.
5. Now that there is an extensive test suite (which tests functionality)
there is no need to match the bytecode. Some very subtle behaviour is
tested with the test suite and passing these tests is a much better
way to stay Python-language compliant, rather than trying to match
CPy bytecode.
Previous to this patch each time a bytes object was referenced a new
instance (with the same data) was created. With this patch a single
bytes object is created in the compiler and is loaded directly at execute
time as a true constant (similar to loading bignum and float objects).
This saves on allocating RAM and means that bytes objects can now be
used when the memory manager is locked (eg in interrupts).
The MP_BC_LOAD_CONST_BYTES bytecode was removed as part of this.
Generated bytecode is slightly larger due to storing a pointer to the
bytes object instead of the qstr identifier.
Code size is reduced by about 60 bytes on Thumb2 architectures.
This fixes a long standing problem that viper code generation gave
terrible error messages, and actually no errors on pyboard where
assertions are disabled.
Now all compile-time errors are raised as proper Python exceptions, and
are of type ViperTypeError.
Addresses issue #940.
When just the bytecode emitter is needed there is no need to have a
dynamic method table for the emitter back-end, and we can instead
directly call the mp_emit_bc_XXX functions. This gives a significant
reduction in code size and a very slight performance boost for the
compiler.
This patch saves 1160 bytes code on Thumb2 and 972 bytes on x86, when
native emitters are disabled.
Overall savings in code over the last 3 commits are:
bare-arm: 1664 bytes.
minimal: 2136 bytes.
stmhal: 584 bytes (it has native emitter enabled).
cc3200: 1736 bytes.
First pass for the compiler is computing the scope (eg if an identifier
is local or not) and originally had an entire table of methods dedicated
to this, most of which did nothing. With changes from previous commit,
this set of methods can be removed and the methods from the bytecode
emitter used instead, with very little modification -- this is what is
done in this commit.
This factoring has little to no impact on the speed of the compiler
(tested by compiling 3763 Python scripts and timing it).
This factoring reduces code size by about 270-300 bytes on Thumb2 archs,
and 400 bytes on x86.
Previous to this patch, a big-int, float or imag constant was interned
(made into a qstr) and then parsed at runtime to create an object each
time it was needed. This is wasteful in RAM and not efficient. Now,
these constants are parsed straight away in the parser and turned into
objects. This allows constants with large numbers of digits (so
addresses issue #1103) and takes us a step closer to #722.
This cleans up vstr so that it's a pure "variable buffer", and the user
can decide whether they need to add a terminating null byte. In most
places where vstr is used, the vstr did not need to be null terminated
and so this patch saves code size, a tiny bit of RAM, and makes vstr
usage more efficient. When null termination is needed it must be
done explicitly using vstr_null_terminate.
This patch makes the MICROPY_PY_BUILTINS_SLICE compile-time option
fully disable the builtin slice operation (when set to 0). This
includes removing the slice sytanx from the grammar. Now, enabling
slice costs 4228 bytes on unix x64, and 1816 bytes on stmhal.
This patch makes MICROPY_PY_BUILTINS_SET compile-time option fully
disable the builtin set object (when set to 0). This includes removing
set constructor/comprehension from the grammar, the compiler and the
emitters. Now, enabling set costs 8168 bytes on unix x64, and 3576
bytes on stmhal.
Native emitter can now compile try/except blocks using nlr_push/nlr_pop.
It probably only works for 1 level of exception handling. It doesn't
work on Thumb (only x64).
Native emitter can also handle some additional op codes.
With this patch, 198 tests now pass using "-X emit=native" option to
micropython.
Needed to pop the iterator object when breaking out of a for loop. Need
also to be careful to unwind exception handler before popping iterator.
Addresses issue #635.
Blanket wide to all .c and .h files. Some files originating from ST are
difficult to deal with (license wise) so it was left out of those.
Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.