1 Star 0 Fork 0

兴博软件/micropython

标签名
描述
提交信息
操作

Improved mpy format with support for native code, and new JavaScript port

In this release the mpy file format has been moved to version 4 and has
some significant improvements: mpy file size is reduced on average by about
35%, loading time of mpy files is reduced by about 40%, and they now have
support to save native, viper and inline assembler code (or machine code
generated from any other source). Size reduction of mpy files was achieved
by adding a qstr window to reuse past qstrs when encoding them, by packing
qstrs directly in the bytecode, and by defining a static qstr set.

Some VM opcodes were also changed to fix a bug when doing a break/continue
out of a finally block, and to make some simplifications. In particular
POP_BLOCK and POP_EXCEPT opcodes were replaced with POP_EXCEPT_JUMP.

Most uppercase macros have been converted to lowercase to make a more
consistent C API, including all MP_OBJ_IS_xxx and MP_xxx_SLOT_IS_FILLED
macros.

The default PYTHON makefile variable is now changed from "python" to
"python3", but Python 2 is still supported via "make PYTHON=python2".

The mpy-cross compiler supports the new mpy version 4 and has new command
line options: "-march=" to select the native emitter, and "--version"
to print the MicroPython version and the mpy version. Also mpy-tool.py has
support for freezing native code.

A module system for external, user C modules has been implemented and
documentation for this is available in the new "docs/develop" section.

A new "javascript" port has been added which targets JavaScript as the
machine via Emscripten. This allows to run MicroPython as an application
within node.js, and to run it within a browser (among other things).

All bare-metal ports have the following improvements: machine.sleep() is
now machine.lightsleep(), and both lightsleep() and deepsleep() now take an
optional argument which is the maximum time to sleep in milliseconds.
These ports also now allow freezing of boot.py and main.py using the usual
methods. And a new I2C method i2c.writevto(addr, vect) is added which can
be used to write a tuple/list of buffers all at once to an I2C device.

The stm32 port now has a fully integrated Ethernet MAC driver (see the
network.LAN class) using lwIP for the TCP/IP stack, and sockets were made
significantly more robust. Support for F413 MCUs was added. There are
also some minor user-facing changes to this port:

  • machine.UART (and pyb.UART) now defaults to timeout=0 (was 1000ms) which
    gives UARTs a non-blocking behaviour.
  • The USB REPL is now configurable using uos.dupterm, and by default
    pyb.USB_VCP(0) is put on dupterm slot 1 before boot.py is executed. To
    disable the default REPL use: uos.dupterm(None, 1).
  • pyb.DAC(id) will now only reset the DAC the first time it is called; to
    get the old behaviour pass the bits parameter like: pyb.DAC(id, bits).
  • pyb.DAC.noise() and pyb.DAC.triangle() now output at full scale.
  • The system will not recreate boot.py if it's missing (it will only create
    it if the filesystem is corrupt, or when doing a factory reset).

For the esp32 port, the build process has been updated to align better with
the ESP IDF and now uses sdkconfig to configure features. Dual core mode
is now enabled by default, SPIRAM is in memory-mapped mode so all of it can
be used for the MicroPython heap, there is support to change the CPU
frequency, and the WDT now panics and resets the device if it times out.

A detailed list of changes follows.

py core:

  • remove calls to file reader functions when these are disabled
  • add optional support for 2-argument version of built-in next()
  • compile: swap order of pop_block/pop_except in "except as" handler
  • warning: support categories for warnings
  • builtinhelp: only print help re FS modules if external import enabled
  • downcase all MP_OBJ_IS_xxx macros to make a more consistent C API
  • downcase MP_xxx_SLOT_IS_FILLED inline functions
  • mkenv.mk: change default PYTHON variable from "python" to "python3"
  • qstr: evaluate find_qstr only once then pass to Q_GET_HASH macro
  • obj.h: remove obsolete mp_obj_new_fun_viper() declaration
  • objfun: make fun_data arg of mp_obj_new_fun_asm() a const pointer
  • eliminate warnings about unused arguments when debugging disabled
  • compile: fix handling of unwinding BaseException in async with
  • compile: add optimisation to compile OrderedDict inplace
  • objexcept: fix hash of exc str created in mp_obj_new_exception_msg
  • py.mk: update lwip build config to work with latest lwip version
  • fix VM crash with unwinding jump out of a finally block
  • vm: remove currently_in_except_block variable
  • replace POP_BLOCK and POP_EXCEPT opcodes with POP_EXCEPT_JUMP
  • persistentcode: add a qstr window to save mpy files more efficiently
  • persistentcode: pack qstrs directly in bytecode to reduce mpy size
  • persistentcode: define static qstr set to reduce size of mpy files
  • add independent config for debugging sentinel object values
  • emitnative: consolidate where HASCONSTS is set to load-const-obj fun
  • emitnative: provide concentrated points of qstr emit
  • emitnative: adjust accounting of size of const_table
  • emitglue: remove union in mp_raw_code_t to combine bytecode & native
  • add support to save native, viper and asm code to .mpy files
  • persistentcode: bump .mpy version to 4
  • allow registration of modules at their definition
  • implement a module system for external, user C modules
  • update and rework build system for including external C modules
  • move mp_native_type_from_qstr() from emitnative.c to nativeglue.c
  • nativeglue: rename native convert funs to match other native helpers
  • compile: add support to select the native emitter at runtime
  • compile: support multiple inline asm emitters
  • compile: check that arch is set when compiling native, viper or asm
  • runtime: remove long-obsolete MICROPY_FSUSERMOUNT init code
  • scheduler: convert micropythyon.schedule() to a circular buffer
  • nlrthumb: add support for iOS where the C func is _nlr_push_tail
  • makedefs: use io.open with utf-8 encoding when processing source
  • runtime: optimise to not create temp float for int to power negative
  • runtime: fix mp_unpack_ex so seq can't be reclaimed by GC during use
  • mpprint: support printing %ld and %lu formats on 64-bit archs
  • asmthumb: support asm_thumb code running on normal ARM processors
  • native: improve support for bool type in viper functions
  • remove "if (0)" and "if (false)" branches
  • objgenerator: fix handling of None passed as 2nd arg to throw()
  • objgenerator: remove unneeded forward decl and clean up white space
  • misc.h: rename _MP_STRINGIFY to not use leading underscore in ident
  • persistentcode: change "len" type to size_t for mp_obj_str_get_data
  • objarray: add support for memoryview.itemsize attribute
  • objarray: add decode method to bytearray
  • update makefiles to use $(CAT) variable instead of hard coded "cat"
  • update makefiles to use $(TOUCH) instead of hard coded "touch"

extmod:

  • moduzlib: update to uzlib 2.9.2
  • modlwip: add support for polling UDP sockets for writability
  • moduhashlib: include implementation of sha256 only when required
  • convert legacy uppercase macro names to lowercase
  • moduwebsocket: refactor websocket to uwebsocket
  • modlwip: change #ifdef to #if for check of MICROPY_PY_LWIP
  • modlwip: fix bug when polling listening socket with backlog=1
  • modlwip: add concurrency protection macros
  • modwebrepl: fix logic to handle a put of file of size 0
  • vfs_fat: update for new oofatfs version
  • modlwip: fix case where concurrency lock isn't released on error
  • moduselect: adjust select_select and poll_register to use size_t
  • vfs_fat: fallback to FAT32 if standard FAT16/SFD format fails
  • modlwip: handle case of connection closing while on accept queue
  • modlwip: handle case of accept callback called with null PCB
  • modlwip: protect socket.accept with lwIP concurrency lock
  • modlwip: free any stored incoming bufs/connections on TCP error
  • modlwip: use correct listening socket object in accept callback
  • modlwip: abort TCP conns that didn't close cleanly in a while
  • modurandom: add init method to seed the Yasmarang generator
  • machine_signal: fix fault when no args are passed to Signal()
  • modussl_mbedtls: support non-blocking handshake
  • modussl_axtls: add non-blocking mode support
  • moducryptolib: add optional AES-CTR support
  • modujson: handle parsing of floats with + in the exponent
  • machine_i2c: change C-level API to allow split I2C transactions
  • machine_i2c: remove need for temporary memory in writemem() call
  • machine_i2c: add i2c.writevto() that can write a vector of bufs
  • modlwip: free any incoming bufs/connections before closing PCB
  • modlwip: register TCP close-timeout callback before closing PCB

lib:

  • utils/pyexec: implement paste mode with event driven REPL
  • utils/printf: exclude __GI_vsnprintf alias for gcc 9 and above
  • utils/gchelper_m3: add license header and clean up code
  • utils/gchelper_m3: add gc_helper_get_sp() function
  • utils/gchelper: add gchelper.h header file for assembler functions
  • netutils: add function to print tracing info for Ethernet frames
  • oofatfs: update oofatfs library to R0.13c working branch
  • oofatfs: update ffconf.h config for new oofatfs version
  • oofatfs: update oofatfs library to fix issue with logic not
  • stm32lib: update library to fix F7 MMC capacity calculation
  • utils/pyexec: add pyexec_file_if_exists() helper function
  • utils: make pyexec_file_if_exists run frozen scripts if they exist
  • utils/interrupt_char: invalidate interrupt char at start up
  • stm32lib: update library to fix UART9/10 baudrate on F4 MCUs
  • nrfx: upgrade nrfx to v1.7.1 plus a UART bug fix

drivers:

  • memory/spiflash: rework wait_sr to fix uninit'd variable 'sr'
  • display/ssd1306.py: change to use new i2c.writevto() method

tools:

  • mpy-tool.py: add support for freezing native code
  • upip.py: use "raise arg" instead of no-arg raise form, for native
  • pyboard.py: add missing line from example usage comments
  • mpy-tool.py: adjust use of super() to make it work with Python 2
  • mpy-tool.py: fix init of QStrWindow, and remove unused variable
  • pyboard.py: don't accumulate output data if data_consumer used
  • upip.py: add support for multiple index URLs with custom default

tests:

  • basics: add tests for try-except-else and try-except-else-finally
  • run-tests: support running native tests via mpy
  • import: add test for importing x64 native code
  • extmod: add test for FAT filesystem on a very large block device
  • run-tests: ignore exception in process kill when ending repl test
  • micropython: add some tests for failed heap allocation
  • skip tests needing machine module if (u)machine doesn't exist
  • ussl_basic: disable setblocking() calls
  • basics/sys1.py: add test for calling sys.exit() without any args
  • pyb: update UART expected output now that default timeout is 0
  • basics: add coverage tests for memoryview attributes

mpy-cross:

  • enable building of x64 native .mpy files
  • add "-march=" option to select native emitter
  • support compiling with MICROPY_PY___FILE__ enabled
  • automatically select ARMV6 arch when running on such a host
  • add --version command line option to print version info

all ports:

  • change PYB message prefix to MPY
  • convert legacy uppercase macro names to lowercase
  • update to work with new oofatfs version
  • {stm32,esp8266}: set mpy-cross native arch for frozen native code
  • convert to use pyexec_file_if_exists() to execute boot/main.py

unix port:

  • mpthreadport: add thread deinit code to stop threads on exit
  • mpthreadport: cleanup used memory on thread exit
  • mpthreadport: remove busy wait loop in thread garbage collection
  • modmachine: handle repeated /dev/mem open errors
  • modffi: eliminate unused-argument warning when debugging disabled
  • Makefile: update coverage tests to match those in Travis
  • mpthreadport: use named semaphores on Mac OS X
  • gcollect: make sure stack/regs get captured properly for GC
  • coverage: add test for printing literal % character
  • modusocket: fix use of setsockopt in usocket.settimeout impl
  • modusocket: raise ETIMEDOUT when connect or accept has timeout

windows port:

  • fix line wrapping behaviour on the REPL

qemu-arm port:

  • rework to run bare-metal on boards with Cortex-M CPUs
  • use gchelper code to get registers for GC scanning

stm32 port:

  • implement machine.lightsleep()
  • rtc: check RTCEN=1 when testing if RTC is already running on boot
  • usbdev: add USB config option for board being self powered
  • usbdev: add USB config option for max power drawn by the board
  • main: make board-defined UART REPL use a static object and buffer
  • boards/stm32f429_af.csv: fix typos in UART defs Tx->TX and Rx->RX
  • mboot: add option to autodetect the USB port that DFU uses
  • sdcard: don't use SD clock bypass on F7 MCUs
  • usb: add flow control option for USB VCP data received from host
  • boards/make-pins.py: add basic support for STM32H7 ADC periphs
  • boards/stm32h743_af.csv: add ADC entries to pin capability table
  • adc: add basic support for ADC on a pin on STM32H7 MCUs
  • mboot: use USB HS as main USB device regardless of USB_HS_IN_FS
  • mboot: add support for STM32F769 MCUs
  • mboot: add support for GPIO ports G, H, I and J
  • mboot: allow deploying via deploy-stlink
  • usb: use USB HS as main USB device regardless of USB_HS_IN_FS
  • usbd_conf: fully support USB HS with external PHY
  • modmachine: make bootloader() enter custom loader if it's enabled
  • boards/STM32F769DISC: support the use of USB HS with external PHY
  • boards/STM32F769DISC: configure for use with mboot by default
  • systick: rename sys_tick_XXX functions to systick_XXX
  • systick: make periodic systick callbacks use a cyclic func table
  • pendsv: clean up pendsv IRQ handler and eliminate duplicate code
  • pendsv: add ability to schedule callbacks at pendsv IRQ level
  • systick: provide better compile-time configurability of slots
  • modnetwork: change lwIP polling to be based on background systick
  • move gchelper assembler code to lib/utils for use by other ports
  • gccollect: use gchelper.h header instead of explicit declaration
  • pendsv: fix inline asm constant and prefix with # character
  • mboot/Makefile: support specifying BOARD_DIR for custom board
  • boards/NUCLEO_L476RG: add support for RNG, DAC and CAN1
  • boards/make-pins.py: add cmdline options to support use by mboot
  • mboot/Makefile: generate all pin header files from board pins.csv
  • mboot/mphalport.h: include genhdr/pins.h for access to pin names
  • qspi: use static af functions for pin configuration
  • mboot: add support for loading gzip'd firmware from a filesystem
  • mboot: move some BSS vars to new section that isn't zeroed out
  • mboot: add support script which can program mboot and application
  • modmachine: add ability to pass through user data to mboot
  • mboot: add hook to run board-specific code early on startup
  • boards/stm32f429.ld: increase uPy heap size by 64k for F429 MCU
  • extint: fix ExtInt to work with non-GPIO pins
  • extint: fix RTC Alarm/FS USB EXTI constants for L4
  • make-stmconst.py: improve regex to parse more constants
  • extint: add non-GPIO EXTI IRQ sources for F0
  • extint: remove unused (and incorrect) EXTI defines
  • stm32_it: fix RTC IRQ handler to handle all EXTI IRQs on F0 MCUs
  • sdram: increase GPIO speed for SDRAM interface to "very high"
  • boards/NUCLEO_F767ZI: fix up comments about HCLK computation
  • mphalport: add mp_hal_get_mac() helper function
  • eth: add low-level Ethernet MAC driver
  • network_lan: add high-level network.LAN interface to ETH driver
  • mpconfigport.h: enable lwIP concurrency protection mechanism
  • modnetwork: don't call NIC callback if it's NULL
  • boards/NUCLEO_F767ZI: enable lwIP and Ethernet peripheral
  • boards/STM32F7DISC: enable lwIP and Ethernet peripheral
  • boards/STM32F769DISC: enable lwIP and Ethernet peripheral
  • boards/NUCLEO_F429ZI: enable lwIP and Ethernet peripheral
  • qspi: enable sample shift and disable timeout counter
  • Makefile: allow a board to specify its linker sections for FW
  • boards/STM32F769DISC: use external QSPI flash to store some code
  • use global lwip build config and support building without lwip
  • boards: update to use new build config for lwip component
  • add compile-time option to use HSI as clock source
  • mboot: update to match latest oofatfs version
  • allow to build with threading with the GIL disabled
  • qspi: set pin speed to very-high and allow to config some options
  • usb: allow to override USB strings & VID/PID in app and mboot
  • stm32_it: guard UART7_IRQHandler with check for UART7 define
  • mboot: set USE_MBOOT=1 by default in the Makefile
  • system_stm32: provide default value for HSI calibration
  • mpconfigport.h: remove malloc/free/realloc helper macros
  • boards/STM32L476DISC: enable servo support on STM32L476DISC board
  • Makefile: allow to override CROSS_COMPILE with included Makefile
  • make default USB_VCP stream go through uos.dupterm for main REPL
  • timer: expose the PWM BRK capability of Timer 1 and 8
  • uart: handle correctly the char overrun case of RXNE=0 and ORE=1
  • rename MICROPY_HW_HAS_SDCARD to MICROPY_HW_ENABLE_SDCARD
  • add support for MMC driver, exposed via pyb.MMCard class
  • moduos: allow to compile again without USB enabled
  • network_wiznet5k: add ability to trace Ethernet TX and RX frames
  • network_wiznet5k: add ability to set the MAC address
  • network_wiznet5k: automatically set MAC if device doesn't have one
  • i2cslave: add support for H7 MCUs
  • usbd_conf: add support for USB HS peripheral on H7 MCUs
  • mboot: add support for H7 MCUs, with H743 flash layout
  • boards/NUCLEO_H743ZI: add config options to support mboot
  • boards/NUCLEO_L432KC: disable complex nos and default frozen mods
  • rtc: add auto-LSE-bypass detection with fallback to LSE then LSI
  • rtc: remove unused LSE detection code
  • rtc: remove non-ASCII mu-character from source code comment
  • timer: correctly initialise extended break settings on F7/H7/L4
  • system_stm32f0: enable PWR clock on startup
  • system_stm32f0: add support for using HSE and PLL as SYSCLK
  • powerctrl: enable EIWUP to ensure RTC wakes device from standby
  • dac: rework DAC driver to use direct register access
  • usbdev: make USB device descriptors at runtime rather than static
  • usb: add USB device mode for VCP+VCP without MSC
  • powerctrl: deselect PLLSAI as 48MHz src before turning off PLLSAI
  • usb: remove mp_hal_set_interrupt_char now that it's reset at boot
  • main: increase default UART REPL rx buffer from 64 to 260 bytes
  • powerctrl: support changing frequency when HSI is clock source
  • flash: fix bug computing page number for L432 page erase
  • add support for F413 MCUs
  • boards: add NUCLEO_F413ZH board configuration
  • machine_uart: change default UART timeout to 0, for non blocking
  • move factory reset files and code to separate source file
  • usbd_cdc_interface: don't retransmit chars if USB is reconnected
  • rtc: allow overriding startup timeouts from mpconfigboard
  • dma: initialise all members of DMA structs for H7 MCUs
  • dma: always reset and configure the H7 DMA peripheral
  • spi: enable SPI IRQs and add IRQHandlers for H7 MCUs
  • irq: fix IRQ_ENABLE_STATS stats config to work on all MCUs
  • boards/NUCLEO_H743ZI: enable SPI3 on this board
  • modmachine: create dedicated asm function to branch to bootloader
  • adc: fix VBAT_DIV to be 4 for STM32F411
  • machine_i2c: update to support new C-level I2C API
  • i2c: make timeout for hardware I2C configurable
  • machine_i2c: simplify ROM initialisation of static HW I2C objects
  • i2c: support setting the I2C TIMINGR value via keyword arg
  • sdcard: add switch break to ensure only correct SD/MMC IRQ is run
  • sdram: update MPU settings to block invalid region, change attrs
  • mboot/README: fix some typos, describe bootloader and fwupdate.py
  • modmachine: in bootloader() disable caches before reset of periphs

cc3200 port:

  • mods/modussl: fix ca_certs arg validation in mod_ssl_wrap_socket
  • modmachine: rename machine.sleep to machine.lightsleep
  • use common gchelper_m3.s code from lib/utils
  • mpconfigport.h: disable compiler optimisation of OrderedDict

esp8266 port:

  • modmachine: implement optional time_ms arg to machine.deepsleep
  • modmachine: rename machine.sleep to machine.lightsleep
  • modmachine: implement simple machine.lightsleep function
  • modmachine: in lightsleep, only waiti if wifi is turned off
  • modmachine: call ets_event_poll after waiti in machine.idle
  • modmachine: handle overflow of timer to get longer periods
  • fix ticks_ms to correctly handle wraparound of system counter

esp32 port:

  • don't put py/scheduler.o in iRAM, it's no longer needed
  • Makefile: put all IDF compenents in .a libs to use IDF ld script
  • update to latest ESP IDF using sdkconfig and new ldgen procedure
  • machine_timer: deinit all active timers on soft reset
  • Makefile: make sure that directory exists for sdkconfig.h
  • boards: use auto xtal freq config instead of default 40MHz
  • modsocket: fix crashes when connect/bind can't resolve given addr
  • modmachine: rename machine.sleep to machine.lightsleep
  • use SPIRAM in mem-map mode so all of it can be used for uPy heap
  • modmachine: add support for changing the CPU frequency
  • modsocket: fix usocket.send to accept anything with buffer proto
  • modsocket: change socket.socket to be socket type rather than fun
  • network_lan: add arg to constructor to set clock mode for ETH PHY
  • modnetwork: catch and report Ethernet events
  • network_lan: make power arg to constructor optional
  • modnetwork: fix wifi.isconnected to return False after disconnect
  • modnetwork: implement RSSI for WiFi STA via WLAN.status('rssi')
  • modnetwork: remove redundant esp_log include
  • Makefile: add some missing IDF source files to bootloader and app
  • mphalport: use ets_delay_us for mp_hal_delay_us_fast
  • machine_pin: make it so None as pull value disables pull up/down
  • machine_pin: add new PULL_HOLD pin pull mode
  • machine_pin: rework pull mode config to fix GPIO hold feature
  • mpthreadport: exit vPortCleanUpTCB early if threading not init'd
  • boards: enable dual core support by default
  • boards/sdkconfig: disable WDT check of idle task on CPU1
  • README: add info about pyparsing and the correct Python version
  • machine_wdt: add timeout arg to select interval, make WDT panic
  • modnetwork: change type to size_t for uses of mp_obj_str_get_data
  • machine_uart: implement UART.deinit() method
  • network_ppp: add a timeout for closing PPP connection
  • machine_touchpad: use HW timer for FSM to enable wake-on-touch
  • modsocket: raise EAGAIN when accept fails in non-blocking mode

javascript port:

  • add new port targeting JavaScript via Emscripten
  • fix Emscripten async load, and to compile with modern clang
  • library: use Buffer.alloc() since new Buffer() is deprecated
  • pass (error) exit value out from script to process caller
  • Makefile: fix unrepresentable float error by using clamp
  • library: print data as raw bytes to stdout so unicode works

nrf port:

  • modmachine: rename machine.sleep to machine.lightsleep
  • uart: use formula instead of switch for baudrate calculation
  • uart: remove unused machine.UART() parameters
  • shrink " does not exist" error messages
  • pin: cleanup Pin.str to print relevant information
  • pin: print pull information in Pin.str
  • ticker: remove duplicate NRFX_IRQ_PRIORITY_SET
  • timer: fix disabling Timer 1 when using soft PWM
  • readme: update link to nrfjprog download
  • bluetooth: improve advertisment behavior for nrf52 targets
  • bluetooth: resolve compilation warning in ble_drv.c
  • readme: update make flash command when defining board
  • pwm: remove superfluous NULL in machine_hard_pwm_instances
  • bluetooth: add support for SoftDevice s132 version 6.1.1
  • board: migrate all nrf52832 targets to new BLE stack
  • bluetooth: deprecate use of SoftDevice s132 v6.0.0
  • bluetooth: add support for SoftDevice s140 version 6.1.1
  • board: migrate nrf52840 target to new BLE stack
  • bluetooth: deprecate use of SoftDevice s140 v6.0.0
  • readme: add section about LTO
  • Makefile: update to match latest oofatfs version
  • boards: add support for BLYST Nano module based boards
  • change types to size_t for all uses of mp_obj_str_get_data
  • machine/i2c: update to support new C-level I2C API
  • nrfx_glue: adapt to nrfx v.1.7.1
  • uart: change UART driver to be non-blocking and use IRQs
  • mpconfigport.h: enable MICROPY_KBD_EXCEPTION by default
  • uart: make UART print output something, and add write method
  • mphalport: use wfi to save power while waiting at the UART REPL

zephyr port:

  • modzephyr: revamp stacks_analyze() call
  • modzsensor: rename "TEMP" sensor channel to "DIE_TEMP"
  • prj_minimal.conf: switch to CONFIG_STDOUT_CONSOLE
  • Makefile: proxy ram_report, rom_report targets from Zephyr
  • prj_frdm_k64f.conf: add fxos8700 sensor
  • prj_frdm_kw41z.conf: add new board configuration
  • i2c: add support for hardware i2c
  • CMakeLists.txt: set AR to point to the Zephyr toolchain exe
  • machine_i2c: update to support new C-level I2C API
  • switch back to enabling I2C in board-specific configs

docs:

  • machine: change sleep to lightsleep and add timeout arguments
  • convert all cases of machine.sleep to machine.lightsleep
  • ure: fix match.group signature to indicate index param is required
  • uos: document extra requirements on stream objs passed to dupterm
  • pyboard: add link to pyboard v1.1 schematic and layout PDF
  • pyboard: make pyboard v1.1 pinout the default shown in quickref
  • develop: fix typos in C-module example for example_add_ints
  • library/machine.Pin: add PULL_HOLD constant to possible pin pulls
  • esp32: add a note to quickref about use of Pin.PULL_HOLD
  • esp32: add example for pin isolation in combination with deepsleep
  • develop: remove paragraph that was copied in error from other doc
  • cmodules: fix example to globally define MODULE_EXAMPLE_ENABLED
  • cmodules: note the various ways MODULE_EXAMPLE_ENABLED can be set
  • esp8266: add tutorial for APA102 LEDs
  • esp32: correct quickref for ESP32 hardware SPI with non-default IO
  • machine.I2C: add writevto method to write a vector of byte bufs
  • pyboard/quickref: refer to new machine.I2C instead of old pyb.I2C

travis:

  • update to use Ubuntu 16.04 Xenial for CI builds
  • enable test for running native code via mpy
2019-05-29 14:38

Vast improvements to native emitter, new nrf port, unified documentation

In this release there are a wide range of improvements and additions to
both the core and the ports. In the core the main improvement was to the
native emitter to have much more comprehensive support for general Python
features, such as generators and complex exception handling, and the
generated machine code is smaller and retains its efficiency. Elsewhere,
fuzzy testing was used to find and eliminate some corner-case bugs, user
classes were optimised when they don't use special accessors, underscores
in numeric literals are now supported (PEP515), and the uio.IOBase class
was added to allow user defined streams.

For the extended modules there is now a VfsPosix filesystem component,
a new ucryptolib module with AES support, addition of ure.sub() and of
uhashlib.md5, and the lwIP socket implementation now has working TCP
listen/accept backlog.

Compared to the last release the minimal baseline core code size is reduced
by about 2.2%, down by roughly 1500 bytes for bare-arm port and 3500 bytes
for minimal x86 port. Most other ports have increased in size due to the
addition of new features (eg ucryptolib, ure.sub).

The stm32 port sees the introduction of a new bootloader -- mboot -- which
supports DFU upload via USB FS, USB HS, as well as a custom I2C protocol,
and also support to program external SPI flash. There is significant
refactoring of the USB device driver, improved VCP throughput, and support
for 2x VCP interfaces on the one USB device. lwIP has been integrated, and
support added for SDRAM. Cortex-M0 CPUs are now supported along with
STM32F0 MCUs.

For the esp8266 port the heap is increased by 2kbytes, the radio is
automatically put to sleep if no WLAN interfaces are active, and the UART
can now be disconnected from the REPL and its RX buffer length configured.
Upon soft-reset sockets are now cleaned up.

The esp32 port has added support for external SPI RAM, PPPoS functionality,
improved performance and stability when using threads, and other general
bug fixes.

There is a new nrf port for Nordic MCUs, currently supporting nRF51x and
nRF52x chips.

The docs have now been unified so there is just one set of documentation
covering all ports. And initial documentation for the esp32 port is added.

There are two changes at the Python API level that are not backwards with
previous versions:

  • uos.dupterm now requires that a stream passed to it is derived from
    uio.IOBase (or is a native stream object).
  • The esp32 neopixel driver has had its default timing changed from 400kHz
    to 800kHz; existing code that didn't explicitly specify the "timing"
    parameter in the NeoPixel constructor may need to be updated to specify
    this as "timing=0" to get 400kHz timing.

A detailed list of changes follows.

py core:

  • mpconfig.h: be stricter when autodetecting machine endianness
  • mpstate.h: adjust start of root pointer section to exclude non-ptrs
  • nlrx86: use naked attribute on nlr_push for gcc 8.0 and higher
  • vm: adjust #if logic for gil_divisor so braces are balanced
  • objfun: fix variable name in DECODE_CODESTATE_SIZE() macro
  • vm: use enum names instead of magic numbers in multi-opcode dispatch
  • vm: improve performance of opcode dispatch when using switch stmt
  • repl: fix handling of unmatched brackets and unfinished quotes
  • misc.h: add MP_STATIC_ASSERT macro to do static assertions
  • compile: change comment about ITER_BUF_NSLOTS to a static assertion
  • emitbc: avoid undefined behavior calling memset() with NULL 1st arg
  • parsenum: use int instead of mp_int_t for parsing float exponent
  • parsenum: avoid undefined behavior parsing floats with large exponents
  • objfloat: fix undefined shifting behavior in high-quality float hash
  • mpz: avoid undefined behavior at integer overflow in mpz_hash
  • objfloat: fix undefined integer behavior hashing negative zero
  • gc: when GC threshold is hit don't unnecessarily collect twice
  • parsenum: adjust braces so they are balanced
  • modbuiltins: add support for rounding integers
  • objgenerator: save state in old_globals instead of local variable
  • objgenerator: protect against reentering a generator
  • emit: combine fast and deref into one function for load/store/delete
  • emit: combine yield value and yield-from emit funcs into one
  • emit: combine build tuple/list/map emit funcs into one
  • emit: combine name and global into one func for load/store/delete
  • emit: combine load/store/delete subscr into one emit function
  • emit: combine load/store/delete attr into one emit function
  • emit: combine break_loop and continue_loop into one emit function
  • emit: combine import from/name/star into one emit function
  • emit: merge build set/slice into existing build emit function
  • emit: combine setup with/except/finally into one emit function
  • objtype: fix assertion failures in mp_obj_new_type by checking types
  • objtype: fix assertion failures in super_attr by checking type
  • stream: move definition of mp_stream_p_t from obj.h to stream.h
  • reader: allow MICROPY_VFS_POSIX to work with MICROPY_READER_POSIX
  • mpconfig.h: add default MICROPY_VFS_FAT config value
  • obj.h: introduce a "flags" entry in mp_obj_type_t
  • objtype: don't expose mp_obj_instance_attr()
  • objtype: optimise instance get/set/del by skipping special accessors
  • gc: add gc_sweep_all() function to run all remaining finalisers
  • lexer: add support for underscores in numeric literals
  • modio: add uio.IOBase class to allow to define user streams
  • mkrules.mk: regenerate all qstrs when config files change
  • stream: introduce and use efficient mp_get_stream to access stream_p
  • objarray: replace 0x80 with new MP_OBJ_ARRAY_TYPECODE_FLAG_RW macro
  • add checks for stream objects in print() and sys.print_exception()
  • compile: combine break and continue compile functions
  • compile: combine subscript_2 and subscript_3 into one function
  • compile: combine global and nonlocal statement compile functions
  • compile: combine or_test and and_test compile functions
  • compile: combine expr, xor_expr and and_expr into one function
  • compile: handle return/break/continue correctly in async with
  • objgenerator: eliminate need for mp_obj_gen_wrap wrapper instances
  • obj.h: fix broken build for object repr C when float disabled
  • simplify some cases of accessing the map of module and type dict
  • objdict: make mp_obj_dict_get_map an inline function
  • objmodule: make mp_obj_module_get_globals an inline function
  • obj.h: give compile error if using obj repr D with single-prec float
  • malloc: give a compile warning if using finaliser without GC
  • objgenerator: implement name with normal fun attr accessor code
  • emitnative: optimise for iteration asm code for non-debug build
  • runtime: use mp_obj_new_int_from_ll when return int is not small
  • stream: introduce MP_STREAM_GET_FILENO ioctl request
  • objstr: in format error message, use common string with %s for type
  • asmthumb: optimise native code calling runtime glue functions
  • mpconfig.h: introduce MICROPY_DEBUG_PRINTER for debugging output
  • fix compiling with debug enabled and make more use of DEBUG_printf
  • emitnative: factor common code for native jump helper
  • emitnative: fix x86 native zero checks by comparing full word
  • asmx86: use generic emit function to simplify cmp emit function
  • emitnative: fix native locals stack to start at correct location
  • emitnative: simplify handling of exception objects from nlr_buf_t
  • emitnative: allocate space for local stack info as it's needed
  • compile: for dynamic compiler, widen literal 1 to get correct shift
  • py.mk: don't hardcode path to libaxtls.a
  • gc: in gc_alloc, reset n_free var right before search for free mem
  • objarray: allow to build again when bytearray is disabled
  • stream: adjust mp_stream_posix_XXX to take void*, not mp_obj_t
  • emitnative: use small tables to simplify handling of local regs
  • asmxtensa: handle function entry/exit when stack use larger than 127
  • asm*: support assembling code to jump to a register, and get PC+off
  • emitnative: optimise and improve exception handling in native code
  • asmxtensa: fix bug with order of regs in addi encoding
  • asmxtensa: optimise loading local addr and support larger offsets
  • emitnative: fix bug with store of 16 and 32 values in viper ARM mode
  • asmxtensa: use narrow version of add instr to reduce native code size
  • emitnx86: fix number of args passed to mp_setup_code_state, 4 not 5
  • vm: fix handling of finally-return with complex nested finallys
  • emitnative: cancel caught exception once handled to prevent reraise
  • emitnative: add support for return/break/continue in try and with
  • compile: factor code that compiles start/end of exception handler
  • py.mk: build axtls library directly from its source files
  • runtime: fix incorrect test for MICROPY_PORT_DEINIT_FUNC
  • objarray: bytearray: allow 2nd/3rd arg to constructor
  • emitnative: fix try-finally in outer scope, so finally is cancelled
  • fix native functions so they run with their correct globals context
  • optimise call to mp_arg_check_num by compressing fun signature
  • asmx64: fix bug in assembler when creating disp with r13 and 0 offset
  • {asmx86,asmx64}: extend test_r8_with_r8 to accept all 8 lower regs
  • emit: move MP_EMIT_OPT_xxx enums from compile.h to emitglue.h
  • emit: remove need to call set_native_type to set native/viper mode
  • emit: remove need to call set_native_type to set viper return type
  • emit: completely remove set_native_type, arg type is set in compiler
  • compile: merge viper annotation and normal param compilation stages
  • compile: factor code that compiles viper type annotations
  • emitnative: reuse mp_native_type_from_qstr when searching for a cast
  • make viper functions have the same entry signature as native
  • emitnative: support arbitrary number of arguments to viper functions
  • emitnative: use macros instead of raw offsetof for slot locations
  • emitnative: make viper funcs run with their correct globals context
  • asmxtensa: make indirect calls using func table, not raw pointers
  • asmthumb: detect presence of I-cache using CMSIS macro
  • objtype: clarify comment about configuring inplace op methods
  • shorten error messages by using contractions and some rewording
  • objstr: make % (mod) formatting operator configurable
  • modbuiltins: make oct/hex work when !MICROPY_PY_BUILTINS_STR_OP_MODULO
  • objgenerator: implement PEP479, StopIteration convs to RuntimeError
  • parsenum: avoid rounding errors with negative powers-of-10
  • modmath: add math.factorial, optimised and non-opt implementations
  • objstr: format: return bytes result for bytes format string
  • fix msvc C++ compiler warnings with MP_OBJ_FUN_MAKE_SIG macro
  • vm: make small optimisation of BUILD_SLICE opcode
  • objfloat: fix abs(-0.0) so it returns 0.0
  • emitnative: place const objs for native code in separate const table
  • asm*: remove ASM_MOV_REG_ALIGNED_IMM emit macro, it's no longer used
  • emitnative: change type of const_table from uintptr_t to mp_uint_t
  • vm: fix case of throwing GeneratorExit type into yield-from
  • runtime: remove nlr protection when calling next in mp_resume
  • objtype: support full object model for get/set/delitem special meths
  • vm: when VM raises exception put exc obj at beginning of func state
  • asmthumb: add wide ldr to handle larger offsets
  • asmthumb: clean up asm_thumb_bl_ind to use new optimised ldr helper
  • asmthumb: extend asm entry/exit to handle stack larger than 508 bytes
  • asmx86: comment out unused asm_x86_nop to prevent compiler warnings
  • asmx64: extend asm_x64_mov_reg_pcrel to accept high registers
  • asmxtensa: use proper calculation for const table offset
  • emitnative: reorder native state on C stack so nlr_buf_t is first
  • emitnative: implement yield and yield-from in native emitter
  • runtime: use mp_import_name to implement tail of mp_import_from
  • runtime: remove comment in mp_import_name about level being 0
  • obj.h: use uint64_t instead of mp_int_t in repr-D MP_OBJ_IS_x macros
  • emitnative: clean up unused macro and forward function declarations
  • asmx64: change stack management to reference locals by rsp not rbp
  • asmx64: change indirect calls to load fun ptr from the native table
  • asmx86: change stack management to reference locals by esp not ebp
  • asmx86: change indirect calls to load fun ptr from the native table
  • emitnative: load native fun table ptr from const table for all archs
  • asmarm: simplify asm_arm_bl_ind to only load via index, not literal
  • asmthumb: remove unused fun_ptr arg from asm_thumb_bl_ind function
  • emitnative: remove unused ptr argument from ASM_CALL_IND macro
  • emitnative: consolidate use of stacked immediate values to one func
  • emitnative: simplify viper mode handling in emit_native_import_name
  • emitnative: push internal None rather than const obj where possible
  • emitnative: put None/False/True in global native const table
  • objtype: remove comment about catching exc from user getattr
  • objstr: make str.count() method configurable
  • objmodule: implement PEP 562's getattr for modules
  • py.mk: when building axtls use -Wno-all to prevent all warnings
  • compile: fix case of eager implicit conversion of local to nonlocal
  • compile: remove unneeded variable from global/nonlocal stmt helpers
  • scope: optimise scope_find_or_add_id to not need "added" arg
  • runtime: fix qstr assumptions when handling "import *"
  • unicode: fix check for valid utf8 being stricter about contn chars
  • py.mk: fix broken Gmane URL
  • add option to reduce GC stack integer size to save RAM
  • objboundmeth: support loading generic attrs from the method
  • obj: add support for int special method
  • objexcept: use macros to make offsets in emergency exc buf clearer
  • objexcept: make sure mp_obj_new_exception_msg doesn't copy/format msg
  • objdict: make .fromkeys() method configurable
  • bc: fix calculation of opcode size for opcodes with map caching
  • qstr: put a lower bound on new qstr pool allocation
  • objarray: introduce "memview_offset" alias for "free" field of object
  • gc: adjust gc_alloc() signature to be able to accept multiple flags
  • mpconfig: move MICROPY_VERSION macros to static ones in mpconfig.h
  • runtime: unlock the GIL in mp_deinit function
  • get optional VM stack overflow check compiling and working again
  • fix location of VM returned exception in invalid opcode and comments
  • modio: make iobase_singleton object const so it goes in ROM
  • obj.h: explicitly cast args to uint32_t in MP_OBJ_FUN_MAKE_SIG

extmod:

  • modlwip: update to work with lwIP v2.0
  • modlwip: set POLLHUP flag for sockets that are new
  • modlwip: allow to compile with MICROPY_PY_LWIP disabled
  • modussl_mbedtls: populate sock member right away in wrap_socket
  • modussl_mbedtls: use mbedtls_entropy_func for CTR-DRBG entropy
  • vfs: use u_rom_obj properly in argument structures
  • vfs_fat: rename FileIO/TextIO types to mp_type_vfs_fat_XXX
  • add VfsPosix filesystem component
  • vfs: add fast path for stating VfsPosix filesystem
  • vfs: introduce a C-level VFS protocol, with fast import_stat
  • moduhashlib: prefix all Python methods and objects with uhashlib
  • moduhashlib: reorder funcs so that they are grouped by hash type
  • moduhashlib: allow to disable the sha256 class
  • moduhashlib: allow using the sha256 implementation of mbedTLS
  • moduhashlib: make function objects STATIC
  • uos_dupterm: use native C stream methods on dupterm object
  • modussl_axtls: fix del to point to mp_stream_close_obj
  • vfs_fat_diskio: factor disk ioctl code to reduce code size
  • update to use new mp_get_stream helper
  • moducryptolib: add ucryptolib module with crypto functions
  • moducryptolib: optionally export MODE_* constants to Python
  • moducryptolib: refactor functions for clean interface with axTLS
  • moducryptolib: add an mbedTLS implementation for this module
  • moducryptolib: prefix all Python methods/objects with ucryptolib
  • moducryptolib: shorten exception messages to reduce code size
  • moducryptolib: don't include arpa/inet.h, it's not needed
  • modure: add match.groups() method, and tests
  • modure: add match.span(), start() and end() methods, and tests
  • modure: add ure.sub() function and method, and tests
  • vfs: support opening a file descriptor (int) with VfsPosix
  • fix to support compiling with object representation D
  • vfs_posix: support ilistdir with no (or empty) argument
  • vfs_posix: use DTTOIF if available to convert type in ilistdir
  • modlwip: deregister all lwIP callbacks when closing a socket
  • modussl: support polling in ussl objects by passing through ioctl
  • modbtree: update to work with new mp_stream_posix_XXX signatures
  • modussl_axtls: use MP_ROM_PTR for objects in allowed args array
  • moduhashlib: add md5 implementation, using axTLS
  • moduhashlib: use newer message digest API for mbedtls >=2.7.0
  • moduhashlib: add md5 implementation using mbedtls
  • moductypes: remove BITFIELD from aggregate types enum
  • moductypes: accept OrderedDict as a structure description
  • modonewire: fix reset timings to match 1-wire specs
  • moductypes: make sizeof() accept "layout" parameter
  • modlwip: implement TCP listen/accept backlog
  • modlwip: fix read-polling of listening socket with a backlog
  • moductypes: implement int for PTR
  • moductypes: add aliases for native C types

lib:

  • lwip: update lwIP to v2.0.3, tag STABLE-2_0_3_RELEASE
  • stm32lib: update library to include support for STM32F0 MCUs
  • utils/printf: make DEBUG_printf implementation more accessible
  • utils: fix to support compiling with object representation D
  • utils: expose pyb_set_repl_info function public
  • libm_dbl/tanh: make tanh more efficient and handle large numbers
  • libm/math: make tanhf more efficient and handle large numbers
  • libm/wf_tgamma: fix tgammaf handling of -inf, should return nan
  • libm_dbl: add implementation of copysign() for DEBUG builds
  • stm32lib: update library to fix issue with filling USB TX FIFO
  • libm/math: fix int type in float union, uint64_t should be uint32_t
  • libm/math: add implementation of __signbitf, if needed by a port
  • utils/pyexec: forcefully unlock the heap if locked and REPL active
  • utils: add generic MicroPython IRQ helper functions
  • stm32lib: update library to get F413 BOR defs and fix gcc 8 warning

drivers:

  • wiznet5k: fix bug with MACRAW socket calculating packet size
  • memory/spiflash: move cache buffer to user-provided config
  • memory/spiflash: rename functions to indicate they use cache
  • memory/spiflash: add functions for direct erase/read/write
  • sdcard: change driver to use new block-device protocol
  • sdcard: fix bug in computing number of sectors on SD Card
  • sdcard: do not release CS during the middle of read operations
  • cc3000: use cc3000_time_t instead of time_t for custom typedef
  • display/lcd160cr.py: in fast_spi, send command before flushing
  • sdcard: in test use os.umount and machine module instead of pyb
  • sdcard: remove debugging print statement in ioctl method
  • dht: allow open-drain-high call to be DHT specific if needed

tools:

  • pydfu.py: increase download packet size to full 2048 bytes
  • pydfu.py: add support for multiple memory segments
  • pydfu.py: use getfullargspec instead of getargspec for newer pyusb
  • pydfu.py: workaround stdio flush error on Windows with Python 3.6
  • pydfu.py: improve DFU reset, and auto-detect USB transfer size
  • mpy-tool.py: support freezing of floats in obj representation D
  • mpy-tool.py: put frozen bignum digit data in ROM, not in RAM
  • mpy-tool.py: set sane initial dynamic qstr pool size with frozen mods
  • mpy-tool.py: fix calc of opcode size for opcodes with map caching
  • mpy-tool.py: fix build error when no qstrs present in frozen mpy
  • dfu.py: pad image data to 8 byte alignment to support L476
  • pyboard.py: run exec: command as a string
  • pyboard.py: change base class of PyboardError to Exception
  • pyboard.py: in TelnetToSerial.close replace try/except with if

tests:

  • basics/special_methods2: enable some additional tests that work
  • add some tests for bigint hash, float hash and float parsing
  • extmod: add test for importing a script from a user VFS
  • extmod: remove conditional import of uos_vfs, it no longer exists
  • pyb: make i2c and pyb1 pyboard tests run again
  • io: add simple IOBase test
  • extmod: add test for VFS and user-defined filesystem and files
  • unix/extra_coverage: don't test stream objs with NULL write fun
  • extmod/ujson_dump.py: add test for dump to non-stream object
  • extmod: add test for ujson.dump writing to a user IOBase object
  • import: add test for importing invalid .mpy file
  • add tests using "file" argument in print and sys.print_exception
  • extmod/ucryptolib*: add tests for ucryptolib module
  • extmod/ucryptolib*: add into and inplace tests for ucryptolib
  • basics/namedtuple*: import ucollections first
  • move non-filesystem io tests to basics dir with io_ prefix
  • improve feature detection for VFS
  • run-tests: add nrf target
  • run-tests: improve crash reporting when running on remote targets
  • extmod/ujson_dump_iobase.py: return number of bytes written
  • make tests work on targets without float support
  • micropython/viper_cond: add test for large int as bool
  • run-tests: enable bool1.py test with native emitter
  • micropython: add tests for try and with blocks under native/viper
  • basics/set_pop.py: sort set before printing for consistent output
  • basics/int_big_error.py: use bytearray to test for int overflow
  • modify tests that print repr of an exception with 1 arg
  • basics: provide .exp files for generator tests that fail PEP479
  • run-tests: enable native tests for unwinding jumps
  • basics: add more tests for return within try-finally
  • basics: add test cases for context manager raising in enter/exit
  • float/cmath_fun.py: fix truncation of small real part of complex
  • float: test -inf and some larger values for special math funcs
  • remove pyboard.py symlink and instead import from ../tools
  • extmod/uhashlib_md5: add coverage tests for MD5 algorithm
  • float/float_parse.py: add tests for accuracy of small decimals
  • cpydiff: add case for difference in behaviour of bytes.format()
  • micropython: test loading const objs in native and viper funcs
  • basics: split out gen throw tests from yield-from-throw tests
  • run-tests: enabled native tests that pass now that yield works
  • unix/ffi_float: skip if strtof() is not available
  • uselect_poll_basic: add basic test for uselect.poll invariants
  • uctypes_sizeof_od: test for using OrderedDict as struct descriptor
  • basics/class_getattr: remove invalid test for getattribute
  • make bytes/str.count() tests skippable
  • extmod/uctypes_sizeof_layout: test for sizeof of different layout
  • import: add .exp file for module_getattr.py to not require Py 3.7
  • cmdline/cmd_showbc.py: fix test to explicitly declare nonlocal
  • extmod: skip uselect test when CPython doesn't have poll()
  • import_long_dyn: test for "import *" of a long dynamic name
  • io: update tests to use uos.remove() instead of uos.unlink()
  • basics/special_methods: add testcases for int
  • extmod/uctypes_ptr_le: test int() operation on a pointer field
  • extmod/uctypes_error: add test for unsupported unary op
  • run-tests: make .exp and .out file names unique by prefixing with dir

mpy-cross:

  • make build independent of extmod directory
  • Makefile: also undefine MICROPY_FORCE_32BIT and CROSS_COMPILE

minimal port:

  • main: allow to compile without GC enabled

unix port:

  • support MICROPY_VFS_POSIX and enable it in coverage build
  • moduos_vfs: add missing uos functions from traditional uos module
  • mpconfigport.h: enable MICROPY_PY_UCRYPTOLIB
  • mpconfigport_coverage: enable ure groups, span, start, end and sub
  • modos: convert dir-type to stat-type for file type in ilistdir
  • use MP_STREAM_GET_FILENO to allow uselect to poll general objects
  • Makefile: coverage: Explicitly build "axtls" too
  • Makefile: enable ussl module with nanbox build
  • Makefile: remove building of libaxtls.a which is no longer needed
  • Makefile: build libffi inside $BUILD
  • mpconfigport_coverage.h: enable uhashlib.md5
  • modos: include extmod/vfs.h for MP_S_IFDIR, etc
  • modjni: update .getiter signature to include mp_obj_iter_buf_t*
  • modjni: get building under coverage and nanbox builds
  • mpconfigport.h: enable MICROPY_PY_UHASHLIB_MD5 for uhashlib.md5
  • moduselect: raise OSError(ENOENT) if obj to modify is not in poller
  • modusocket: initial implementation of socket.settimeout()
  • modusocket: finish socket.settimeout() implementation
  • modffi: add support for "q"/"Q" specs (int64_t/uint64_t)
  • Makefile: allow to override/omit pthread lib name
  • modos: rename unlink to remove to be consistent with other ports
  • enable MICROPY_PY_BUILTINS_ROUND_INT
  • enable uio.IOBase
  • call gc_sweep_all() when doing a soft reset

windows port:

  • make printing of debugging info work out of the box
  • msvc: support custom compiler for header generation
  • msvc: implement file/directory type query
  • remove remaining traces of old GNU readline support

stm32 port:

  • usbd_conf.h: remove unused macros and clean up header file
  • usbd_conf: changes files to unix line endings and apply styling
  • usbdev: convert files to unix line endings
  • usbdev: remove unused RxState variable, and unused struct
  • usbdev: be honest about data not being written to HID endpoint
  • usbd_hid_interface: address possible race condition vs. interrupt
  • i2c: add new hardware I2C driver for F4 MCUs
  • machine_i2c: use new F4 hardware I2C driver for machine.I2C class
  • accel: switch pyb.Accel to use new C-level I2C API
  • modpyb: introduce MICROPY_PY_PYB_LEGACY config option for pyb mod
  • pyb_i2c: put pyb.I2C under MICROPY_PY_PYB_LEGACY setting
  • modpyb: remove unused includes and clean up comments
  • usb: use usbd_cdc_itf_t pointer directly in USB_VCP class
  • usb: combine CDC lower-layer and interface state into one struct
  • usb: combine HID lower-layer and interface state into one struct
  • usb: make CDC endpoint definitions private to core usbdev driver
  • usb: change CDC tx/rx funcs to take CDC state, not usbdev state
  • usb: change HID report funcs to take HID state, not usbdev state
  • usb: add ability to have 2x VCP interfaces on the one USB device
  • usb: initialise cdc variable to prevent compiler warnings
  • enable UART7/8 on F4 series that have these peripherals
  • add support for STM32L496 MCU
  • boards: add board ld and af.csv files for STM32L496 MCU
  • boards: add config files for new board, STM32L496GDISC
  • rtc: don't try to set SubSeconds value on RTC
  • integrate lwIP as implementation of usocket module
  • rng: use Yasmarang for rng_get() if MCU doesn't have HW RNG
  • remove unneeded HTML release notes from usbdev and usbhost dirs
  • add low-level hardware I2C slave driver
  • add new component, the mboot bootloader
  • allow to have no storage support if there are no block devices
  • add support for Cortex-M0 CPUs
  • timer: make timer_get_source_freq more efficient by using regs
  • allow a board to disable MICROPY_VFS_FAT
  • boards: add startup_stm32f0.s for STM32F0 MCUs
  • add support for STM32F0 MCUs
  • boards: add alt-func CSV list and linker script for STM32F091
  • boards: add NUCLEO_F091RC board configuration files
  • README: update to include STM32F0 in list of supported MCUs
  • boards: split combined alt-func labels and fix some other errors
  • boards: ensure USB OTG power is off for NUCLEO_F767ZI
  • flash: increase H7 flash size to full 2MiB
  • modnetwork: don't take netif's down when network is deinited
  • modnetwork: change base entry of NIC object from type to base
  • modnetwork: provide generic implementation of ifconfig method
  • add network driver for Wiznet5k using MACRAW mode and lwIP
  • modnetwork: fix arg indexing in generic ifconfig method
  • mpconfigport.h: enable DELATTR_SETATTR and BUILTINS_NOTIMPLEMENTED
  • mboot: increase USB rx_buf and DFU buf sizes to full 2048 bytes
  • Makefile: rebuild all qstrs when any board configuration changes
  • boards/STM32L476DISC: update SPI flash config for cache change
  • timer: support TIM1 on F0 MCUs
  • i2c: fix num_acks calculation in i2c_write for F0 and F7 MCU's
  • i2cslave: fix ordering of event callbacks in slave IRQ handler
  • mboot: adjust user-reset-mode timeout so it ends with mode=1
  • boards/stm32f091_af.csv: split labels that are multiple funcs
  • boards/NUCLEO_F091RC: add Arduino-named pins and rename CPU pins
  • can: use MP_OBJ_ARRAY_TYPECODE_FLAG_RW where appropriate
  • spi: fix SPI driver so it can send/recv more than 65535 bytes
  • mboot: define constants for reset mode cycling and timeout
  • boards/NUCLEO_F091RC: fix TICK_INT_PRIORITY so it is highest prio
  • qspi: don't require data reads and writes to be a multiple of 4
  • mboot: add support for erase/read/write of external SPI flash
  • boards: add .ld and af.csv files for STM32F722
  • modnetwork: fix query of DNS IP address in ifconfig()
  • mboot: fix bug with invalid memory access of USB state
  • mboot: only compile in code for the USB periph that is being used
  • mboot: always use a flash latency of 1WS to match 48MHz HCLK
  • access dict map directly instead of using helper function
  • support compiling with object representation D
  • fatfs_port: fix bug when MICROPY_HW_ENABLE_RTC not enabled
  • timer: use enum for indexing keyword arg in pyb_timer_init_helper
  • timer: add tick_hz arg to Timer constructor and init method
  • mphalport: make mp_hal_stdin_rx_chr/stdout_tx_strn weakly linked
  • flashbdev: fix bug with L4 block cache, dereferencing block size
  • add method for statically configuring pin alternate function
  • sdcard: use mp_hal_pin_config_alt_static to configure SD card pins
  • sdram: add SDRAM driver from OpenMV project
  • sdram: integrate SDRAM driver into rest of code
  • sdram: on F7 MCUs enable MPU on external SDRAM
  • boards/STM32F429DISC: enable onboard SDRAM
  • sdcard: get SDMMC alt func macro names working with F4,F7,H7 MCUs
  • Makefile: use -Wno-attributes for ll_usb.c HAL source file
  • rtc: get rtc.wakeup working on F0 MCUs
  • modmachine: get machine.sleep working on F0 MCUs
  • extint.h: use correct EXTI lines for RTC interrupts
  • modmachine: get machine.sleep working on L4 MCUs
  • adc: disable VBAT in read channel helper function
  • adc: fix ADC reading on F0 MCUs to only sample a single channel
  • spi: round up prescaler calc to never exceed requested baudrate
  • sdram: allow additional config by a board, and tune MPU settings
  • boards/STM32F429DISC: add burst len and autorefresh to SDRAM cfg
  • boards/STM32F7DISC: enable onboard SDRAM
  • spi: split out pyb.SPI and machine.SPI bindings to their own files
  • spi: add implementation of low-level SPI protocol
  • mboot/main: use correct formula for DFU download address
  • Makefile: allow external BOARD_DIR directory to be specified
  • boards/STM32L476DISC: enable external RTC xtal to get RTC working
  • for MCUs that have PLLSAI allow to set SYSCLK at 2MHz increments
  • dma: pass DMA direction as parameter to dma_init not in cfg struct
  • dma: reinitialise the DMA if the direction changed on the channel
  • sdcard: use only a single DMA stream for both SDIO TX/RX
  • sdcard: move temporary DMA state from BSS to stack
  • spi: be sure to set all SPI config values in SPI proto init
  • change flash IRQ priority from 2 to 6 to prevent preemption
  • flashbdev: protect flash writes from cache flushing and USB MSC
  • sdcard: fully reset SDMMC periph before calling HAL DMA functions
  • dma: get DMA working on F0 MCUs
  • sdram: add support for 32-bit wide data bus and 256MB in MPU cfg
  • boards/STM32F769DISC: add optional support for external SDRAM
  • add support for STM32F765xx MCUs
  • Makefile: include copysign.c in double precision float builds
  • adc: fix ADC calibration scale for L4 MCUs, they use 3.0V
  • adc: increase sample time for internal sensors on L4 MCUs
  • dcmi: add F4/F7/H7 hal files and dma definitions for DCMI periph
  • uart: add support for USART3-8 on F0 MCUs
  • boards/NUCLEO_F091RC: enable USART3-8 with default pins
  • modmachine: re-enable PLLSAI[1] after waking from stop mode
  • powerctrl: move function to set SYSCLK into new powerctrl file
  • powerctrl: fix configuring APB1/APB2 frequency when AHB also set
  • powerctrl: factor code to set RCC PLL and use it in startup
  • powerctrl: factor code that configures PLLSAI on F7 MCUs
  • powerctrl: optimise passing of default values to set_sysclk
  • powerctrl: don't configure clocks if already at desired frequency
  • usbd_conf: allocate enough space in USB HS TX FIFO for CDC packet
  • mpconfigport.h: enable math.factorial, optimised version
  • main: add configuration macros for board to set heap start/end
  • usbd_cdc_interface: handle disconnect IRQ to set VCP disconnected
  • usbd_cdc_interface: refactor USB CDC tx code to not use SOF IRQ
  • spi: fix calculation of SPI clock source on H7 MCUs
  • boards/stm32h743.ld: fix total flash size, should be 2048k
  • system_stm32: introduce configuration defines for PLL3 settings
  • adc: add ADC auto-calibration for L4 MCUs
  • flashbdev: add missing include for irq.h
  • servo: only initialise TIM5 if it is needed, to save power
  • usb: fully deinitialise USB periph when it is deactivated
  • powerctrl: move (deep)sleep funcs from modmachine.c to powerctrl.c
  • powerctrl: disable IRQs during stop mode to allow reconfig on wake
  • boards/STM32F429DISC: enable UART as secondary REPL
  • uart: always show the flow setting when printing a UART object
  • mboot: provide led_state_all function to reduce code size
  • mboot: add support for 4th board LED
  • boards: add configuration for putting mboot on PYBv1.x
  • mboot: add documentation for using mboot on PYBv1.x
  • powerctrl: add support for standby mode on L4 MCUs
  • uart: add rxbuf keyword arg to UART constructor and init method
  • boards: add STM32L432KC chip configuration files
  • add peripheral support for STM32L432
  • boards: add NUCLEO_L432KC board configuration files
  • split out UART Python bindings from uart.c to machine_uart.c
  • uart: factor out code from machine_uart.c that computes baudrate
  • uart: rework uart_get_baudrate so it doesn't need a UART handle
  • uart: factor out code to set RX buffer to function uart_set_rxbuf
  • uart: remove HAL's UART_HandleTypeDef from UART object struct
  • uart: simplify deinit of UART, no need to call HAL
  • uart: for UART init, pass in params directly, not via HAL struct
  • uart: move config of char_width/char_mask to uart.c
  • uart: add ability to have a static built-in UART object
  • extint: use correct EXTI channels on H7 MCUs for RTC events
  • adc: fix calibrated volt/temp readings on H7 by using 16bit scale
  • adc: increase ADC sampling time for internal sources on H7 MCUs
  • adc: support 16-bit ADC configuration on H7 MCUs
  • boards: allow OpenOCD stm_flash procedure to accept single FW img
  • boards/NUCLEO_L432KC: specify L4 OpenOCD config file for this MCU
  • main: add board config option to enable/disable mounting SD card
  • implement UART.irq() method with initial support for RX idle IRQ
  • uart: fix uart_rx_any in case of no buffer to return 0 or 1
  • uart: always enable global UART IRQ handler on init
  • uart: clear overrun error flag after reading RX data register
  • uart: make sure user IRQs are handled even with a keyboard intr
  • modmachine: fix reset_cause to correctly give DEEPSLEEP on L4 MCU
  • sdcard: properly reset SD periph when SDMMC2 is used on H7 MCUs
  • wdt: make singleton WDT object const so it goes in ROM
  • main: make thread and FS state static and exclude when not needed
  • use MICROPY_GC_STACK_ENTRY_TYPE to save some RAM
  • .gitattributes: remove special text handling of stm32 usbdev files
  • enable MICROPY_PY_BUILTINS_ROUND_INT
  • enable descriptors
  • enable uio.IOBase
  • enable ure.sub()
  • call gc_sweep_all() when doing a soft reset

cc3200 port:

  • mods: include stream.h to get definition of mp_stream_p_t
  • mods: access dict map directly instead of using helper func
  • use MICROPY_GC_STACK_ENTRY_TYPE to save some RAM

esp8266 port:

  • mpconfigport.h: add some weak links to common Python modules
  • modnetwork: return empty str for hostname if STA is inactive
  • modnetwork: raise ValueError when getting invalid WLAN id
  • modmachine: allow I2C and SPI to be configured out of the build
  • change UART(0) to attach to REPL via uos.dupterm interface
  • modules/ntptime.py: remove print of newly-set time
  • mpconfigport.h: enable ucryptolib module for standard build
  • esp8266_common.ld: put mp_keyboard_interrupt in iRAM
  • modesp: run ets_loop_iter before/after doing flash erase/write
  • let machine.WDT trigger the software WDT if obj is not fed
  • Makefile: remove build of libaxtls.a and add back tuned config
  • main: increase heap by 2kb, now that axtls rodata is in ROM
  • remove scanning of GC pointers in native code block
  • ets_alt_task: process idle callback if no other events occurred
  • modnetwork: automatically do radio sleep if no interface active
  • modnetwork: wait for iface to go down before forcing power mgmt
  • machine_uart: add rxbuf keyword arg to UART constructor/init
  • main: activate UART(0) on dupterm for REPL before boot.py runs
  • esp_mphal: provide mp_hal_pin_od_high_dht so DHT works reliably
  • implement high-res timers using new tick_hz argument
  • use MICROPY_GC_STACK_ENTRY_TYPE to save some RAM
  • enable MICROPY_PY_BUILTINS_ROUND_INT
  • enable descriptors
  • enable uio.IOBase
  • enable ure.sub()
  • call gc_sweep_all() when doing a soft reset, cleans up sockets

esp32 port:

  • update to latest ESP IDF version
  • modnetwork: fix STA/AP activate/deactivate for new IDF API
  • Makefile: update to latest ESP IDF version
  • esp32.custom_common.ld: put soc code in iram0
  • silence ESP-IDF log messages when in raw REPL mode
  • Makefile: extract common C & C++ flags for consistent compilation
  • add support for building with external SPI RAM
  • modnetwork: fix isconnected() when using static IP config
  • remove port-specific uhashlib implementation and use common one
  • fatfs_port: implement get_fattime so FAT files have a timestamp
  • update to latest ESP IDF
  • modules: include umqtt library in frozen modules
  • mpconfigport.h: enable ucryptolib module
  • allow to build with uPy floats disabled
  • reduce latency for handling of scheduled Python callbacks
  • modnetwork: add support for bssid parameter in WLAN.connect()
  • implement WLAN.status() return codes
  • modesp32: add raw temperature reading to esp32 module
  • modesp32: use MP_ROM_QSTR and MP_ROM_PTR in const locals dict
  • modnetwork: add network.(W)LAN.ifconfig('dhcp') support
  • update to latest ESP IDF
  • fix int overflow in machine.sleep/deepsleep functions
  • machine_rtc: fix locals dict entry, init qstr points to init meth
  • modesp32: add hall_sensor() function
  • network_ppp: add PPPoS functionality
  • mpthreadport: prevent deadlocks when deleting all threads
  • allocate task TCB and stack from system heap not uPy heap
  • machine_uart: add txbuf/rxbuf keyword args to UART construct/init
  • machine_uart: implement UART.sendbreak() method
  • machine_pwm: support higher PWM freq by auto-scaling timer res
  • machine_pwm: on deinit stop routing PWM signal to the pin
  • modmachine: enable machine.sleep() now that the IDF supports it
  • mphalport: when tx'ing to REPL only release GIL if many chars sent
  • modsocket: for socket read only release GIL if socket would block
  • machine_pin: add Pin.off() and Pin.on() methods
  • Makefile: use system provided math library rather than uPy one
  • modules/neopixel.py: change NeoPixel to different default timings
  • machine_hw_spi: use separate DMA channels for HSPI and VSPI
  • machine_hw_spi: make HW SPI objects statically allocated
  • implement high-res timers using new tick_hz argument
  • enable MICROPY_PY_BUILTINS_ROUND_INT
  • enable descriptors
  • enable uio.IOBase
  • enable ure.sub()
  • call gc_sweep_all() when doing a soft reset

nrf port:

  • add new port to Nordic nRF5x MCUs
  • align help.c builtin help text to use correct type
  • add WT51822-S4AT board
  • use --gc-sections to reduce code size
  • add compile switch to disable VFS
  • enable Link-time optimizations (LTO)
  • boards/arduino_primo: add missing hal_rng config used by random mod
  • implement NVMC HAL
  • disable FAT/VFS by default
  • hal/nvmc: remove pre-compiler error thrown in nvmc.h, if on nrf52
  • hal/hal_nvmc: fix non-SD code
  • boards: update linker scripts
  • add micro:bit filesystem
  • drivers/bluetooth/ble_drv: don't handle non-events
  • modules/uos/microbitfs: make OSError numeric
  • main: run boot.py and main.py on startup
  • use micropython libm to save flash
  • main: add ampy support
  • drivers/bluetooth: start advertising after disconnect
  • update usage of mp_obj_new_str by removing last parameter
  • remove default FROZEN_MPY_DIR
  • option to enable Ctrl-C in NUS console
  • boards/microbit: add copy of microbit display and image files
  • boards/microbit: add copy of microbit font type from microbit-dal
  • boards/microbit: rename display/image files from .cpp to .c ext
  • boards/microbit: update board modules from C++ to C-code
  • boards/microbit: add framework updates to build micro:bit modules
  • boards/microbit: attempt to get working display/images without FP
  • boards/microbit: add modmicrobit.h to expose module init function
  • boards/microbit: include modmicrobit.h in board_modules.h
  • drivers/softpwm: rename init function to softpwm_init0
  • drivers/ticker: rework ticker functions for microbit display/music
  • boards/microbit: update to work with new ticker code
  • modules/music: remove init of softpwm/ticker upon music module load
  • update main.c to init relevant board drivers, if enabled
  • boards/microbit: move microbit target to custom linker script
  • boards/microbit/modules: fix tabbing in modmicrobit.c
  • boards/microbit: add temperature back to microbit module
  • boards/microbit: update docs on top level tick low pri callback
  • change board module header from board_modules.h to boardmodules.h
  • add if-def around inclusion of nrf_sdm.h in main
  • boards/microbit: enable music, display, image, microbit module
  • drivers/bluetooth: reset evt_len to size of static buffer each iter
  • add support for s132 v5.0.0 bluetooth stack (#139)
  • change PYB prefix to MPY
  • only search for frozen files if FROZEN_MPY_DIR is set
  • mpconfigport: reduce GC stack size for nrf51
  • modules/machine/pin: disable pin debug by default
  • boards/common.ld: avoid overflowing the .text region
  • drivers/ble_drv: fixing sd_ble_enable bug for SD s132 v.2.0.1
  • make machine.UART optional
  • fix stack size in ld script and enable MICROPY_STACK_CHECK
  • improve include of boardmodules.mk
  • make LTO configurable via Makefile flag
  • boards/microbit/modules: initialize variable in microbit_sleep
  • replace custom-HAL with nrfx-HAL
  • fix NUS console when using boot.py or main.py
  • Makefile: fix .PHONY target
  • enable -g flag by default
  • make linker scripts more modular
  • remove port member from Pin object
  • modules/machine/pin: add support for IRQ on Pin's
  • modules/machine/spi: sPIM (EasyDMA) backend for nrf52x
  • drivers/bluetooth/ble_drv: increase max transfers in progress
  • gccollect: use the SP register instead of MSP
  • boards: remove unused defines from board config headers
  • boards/wt51822_s4at: fixes after nrfx and Pin IRQ introduction
  • modules/random: rename port config for RNG
  • modules: align method to resolve pin object
  • adc: allow for external use of new and value read function
  • spi: allow for external use of new and transfer function
  • return immediatly from mp_hal_delay_us if 0us is given
  • modules/machine/adc: fix to make adc.c compile for nrf51 targets
  • bluetooth: fixes for s132 v5 BLE stack
  • Makefile: use "standard" GCC -fshort-enums instead of --short-enums
  • Makefile: remove -fstack-usage
  • Makefile: use C11 instead of Gnu99
  • Makefile: refine dead-code elimination parameters
  • modules/machine/adc: don't compare -1 to an unsigned number
  • modules/uos/microbitfs: fix errno defines
  • modules/uos/microbitfs: remove unused uos_mbfs_mount
  • enable micro:bit FS by default
  • boards/feather52: move phony targets to main Makefile
  • modules/machine/spi: move enable-guard to prevent wrong includes
  • nrfx_config: move back nrf52832 to use non-EasyDMA SPI
  • move pyb module to boards module
  • add support for reading output pin state
  • generalize feather52 target
  • bluetooth: add support for s132/s140 v6, remove s132 v2/3/5
  • boards: check for stack/heap size using an assert
  • quick-fix on const objects with open array dimension in objtuples
  • bluetooth: replace BLE REPL (WebBluetooth) URL
  • add explicit make flag for oofatfs
  • compile nlr objects with -fno-lto flag
  • upgrade to nrfx 1.1.0
  • drivers: add license text to ticker.h and softpwm.h
  • use mp_raise_ValueError instead of nlr_raise(...)
  • include $(SRC_MOD) in the build
  • Makefile: make sure dependencies for pins_gen.c are correct
  • properly use (void) instead of () for function definitions
  • boards/microbit: use MICROPY_PY_BUILTINS_FLOAT to detect FP support
  • update nrfjprog links to allow to download any version
  • drivers/flash: fix incorrect page alignment check
  • uos: add mbfs enter and exit handlers
  • enable all PWM, RTC and Timer instances for nrf52840
  • correct index checking of ADC/PWM/RTCounter instances
  • use separate config for each PWM instance
  • uart: remove unused UART.char_width field
  • uart: fix UART.writechar() to write just 1 byte
  • bluetooth: set GAP_ADV_MAX_SIZE to 31 (s132/s140)
  • bluetooth: update BLE stack download script

pic16bit port:

  • update to compile with latest xc16 v1.35 compiler

teensy port:

  • add own uart.h to not rely on stm32's version of the file

zephyr port:

  • README: hint about existence of qemu_x86_nommu
  • main: after builtin testsuite, drop to REPL
  • mpconfigport.h: enable uhashlib and ubinascii modules
  • modzsensor: zephyr sensor subsystem bindings
  • prj_base.conf: enable DHCP and group static IPs together
  • add prj_disco_l475_iot1.conf with sensor drivers
  • Makefile: add kobj_types_h_target to Z_EXPORTS
  • prj_base.conf: remove outdated CONFIG_NET_NBUF_RX_COUNT option
  • prj_qemu_x86.conf: remove outdated CONFIG_RAM_SIZE
  • rename CONFIG_CONSOLE_PULL to CONFIG_CONSOLE_SUBSYS
  • prj_base.conf: update for net_config subsys refactor
  • CMakeLists: update for latest Zephyr CMake usage refactorings

docs:

  • library: add documentation for ucollections.deque
  • ucryptolib: add docs for new ucryptolib module
  • usocket: getaddrinfo: describe af/type/proto optional params
  • usocket: minor fixes to grammar of getaddrinfo
  • uos: make it clear that block device block_num param is an index
  • ure: document sub(), groups(), span(), start() and end()
  • ure: document some more supported regex operators
  • pyboard: for latex build, use smaller quickref jpg, and no gifs
  • library: remove "only" directive from all pyb module docs
  • library/machine.UART: remove conditional docs for wipy port
  • library/machine: remove conditional docs for wake_reason function
  • library/machine: remove conditional docs for rng function
  • library/index: remove all conditionals from library index
  • library/index: add hint about using help('modules') for discovery
  • reference/index: remove conditional for inline asm docs
  • library/machine: remove conditionals in machine class index
  • move WiPy specific Timer class to separate doc file
  • library/machine.I2C.rst: clarify availability of primitive I2C ops
  • library/machine.UART.rst: specify optional txbuf and rxbuf args
  • library/pyb: add deprecation warning for mount and old block proto
  • pyboard: fix to use Sphinx style for internal/external links
  • library/machine.SPI: add note about baudrate imprecision
  • library/network: move specific network classes to their own file
  • library/network: make AbstractNIC methods layout correctly
  • unify all the ports into one set of documentation
  • remove sphinx_selective_exclude, it's no longer used
  • wipy: fix links to network.Server, and markup for boot.py
  • uselect: describe more aspects of poll.register/modify behavior
  • machine.Pin: add note regarding irq handler argument
  • machine.Pin: document "hard" argument of Pin.irq method
  • uio: document StringIO/BytesIO(alloc_size) constructors
  • library/uctypes: add examples and make general updates
  • conf.py: use https for intersphinx link to docs.python.org
  • ure: fully describe supported syntax subset, add example
  • differences: clarify the differences are against Python 3.4
  • add initial docs for esp32 port, including quick-ref and general
  • library: add documentation for esp32 module

travis:

  • install explicit version of urllib3 for coveralls
  • use build stages and parallel jobs under Travis CI
  • add nrf port to Travis CI build

examples:

  • embedding: add code markup and fix typo in README.md
  • embedding: fix reference to freed memory, lexer src name
  • embedding: fix hard-coded MP_QSTR_ value
  • unix/ffi_example: clean up and update the ffi example

README:

  • update list of ports to include esp32 and nrf
  • remove references to "make axtls", it's no longer needed
  • remove text about selecting different ports in the docs
2019-01-25 21:56
2018-05-11 14:39

Introduction of ports subdirectory where all ports are moved to

The main change in this release is the introduction of a "ports/"
subdirectory at the top-level of the repository, and all of the ports are
moved here. In the process the "stmhal" port is renamed to "stm32" to
better reflect the MCU that it targets. In addition, the STM32 CMSIS and
HAL sources are moved to a new submodule called "stm32lib".

The bytecode has changed in this release, compared to the previous release,
and as a consequence the .mpy version number has increased to version 3.
This means that scripts compiled with the previous mpy-cross must be
recompiled to work with this new version.

There have also been various enhancements and optimisations, such as:
check for valid UTF-8 when creating str objects, support for reverse
special binary operations like radd, full domain checking in the math
module, support for floor-division and modulo in the viper emitter,
and addition of stack overflow checking when executing a regex.

The stm32 port sees improved support for F7 MCUs, addition of a new board
B_L475E_IOT01A based on the STM32L475, and support for the Wiznet W5500
chipset along with improved socket behaviour.

A detailed list of changes follows.

py core:

  • objstr: startswith, endswith: check arg to be a string
  • nlrx86,x64: replace #define of defined() with portable macro usage
  • objtype: handle NotImplemented return from binary special methods
  • objtype: mp_obj_class_lookup: improve debug logging
  • map: remove unused new/free functions
  • make m_malloc_fail() have void return type, since it doesn't return
  • modstruct: in struct.pack, stop converting if there are no args left
  • modstruct: check and prevent buffer-read overflow in struct unpacking
  • modstruct: check and prevent buffer-write overflow in struct packing
  • nlrthumb: get working again on standard Thumb arch (ie not Thumb2)
  • objfloat: fix binary ops with incompatible objects
  • obj: fix comparison of float/complex NaN with itself
  • objtype: implement fallback for instance inplace special methods
  • objtuple: properly implement comparison with incompatible types
  • objstr: add check for valid UTF-8 when making a str from bytes
  • objlist: properly implement comparison with incompatible types
  • runtime0.h: move relational ops to the beginning of mp_binary_op_t
  • runtime0.h: move MP_BINARY_OP_DIVMOD to the end of mp_binary_op_t
  • objtype: make sure mp_binary_op_method_name has full size again
  • runtime0.h: put inplace arith ops in front of normal operations
  • builtinhelp: simplify code slightly by extracting object type
  • runtime: implement dispatch for "reverse op" special methods
  • nlrx86: fix building for Android/x86
  • builtinhelp: change signature of help text var from pointer to array
  • runtime.h: change empty mp_warning macro so var-args are non empty
  • modbuiltins: implement abs() by dispatching to MP_UNARY_OP_ABS
  • {objfloat,objcomplex}: optimise MP_UNARY_OP_ABS by reusing variables
  • mpconfig.h: add note that using computed gotos in VM is not C99
  • objstr: strip: don't strip "\0" by default
  • objexcept: prevent infinite recursion when allocating exceptions
  • stream: remove unnecessary checks for NULL return from vstr_add_len
  • vstr: raise a RuntimeError if fixed vstr buffer overflows
  • vm: use lowercase letter at start of exception message
  • persistentcode: define mp_raw_code_save_file() for any unix target
  • add config option to print warnings/errors to stderr
  • objfloat: support raising a negative number to a fractional power
  • objset: simplify set and frozenset by separating their locals dicts
  • objset: check that RHS of a binary op is a set/frozenset
  • objset: include the failed key in a KeyError raised from set.remove
  • objtype: change type of enum-to-qstr table to uint16_t to save space
  • objstr: make empty bytes object have a null-terminating byte
  • mpprint: only check for null string printing when NDEBUG not defined
  • objtype: clean up unary- and binary-op enum-to-qstr mapping tables
  • persistentcode: bump .mpy version number to version 3
  • bc: update opcode_format_table to match the bytecode
  • modmath: add full checks for math domain errors
  • modmath: convert log2 macro into a function
  • formatfloat: don't print the negative sign of a NaN value
  • formatfloat: use standard isinf, isnan funcs instead of custom ones
  • modbuiltins: use existing utf8_get_char helper in builtin ord func
  • emitnative: implement floor-division and modulo for viper emitter
  • objtype: use CPython compatible method name for sizeof
  • objtype: fit qstrs for special methods in byte type
  • objtype: define all special methods if requested
  • objtype: introduce MICROPY_PY_ALL_INPLACE_SPECIAL_METHODS

extmod:

  • modubinascii: only include uzlib/tinf.h when it's really needed
  • modussl_mbedtls: allow to compile with MBEDTLS_DEBUG_C disabled
  • machine_pinbase: put PinBase singleton in ROM
  • re1.5: upgrade to v0.8.2, adds hook for stack overflow checking
  • modure: add stack overflow checking when executing a regex
  • uos_dupterm: update uos.dupterm() and helper funcs to have index
  • uos_dupterm: swallow any errors from dupterm closing the stream
  • vfs: replace VLA in proxy func with small, static sized array
  • modussl: add finaliser support for ussl objects
  • modussl_mbedtls: allow to compile with unix coverage build

lib:

  • add new submodule, stm32lib containing STM32 CMSIS and HAL source
  • embed/abort_: use mp_raise_msg helper function
  • libm: fix tanhf so that it correctly handles +/- infinity args
  • libm: remove implementation of log2f, use MP_NEED_LOG2 instead
  • axtls: update, support for SSL_EAGAIN return code
  • berkeley-db-1.xx: update, allow to override MINCACHE, DEFPSIZE

drivers:

  • memory/spiflash: change from hard-coded soft SPI to generic SPI
  • display/ssd1306.py: improve performance of graphics methods
  • nrf24l01: make nRF24L01 test script more portable
  • display/ssd1306: implement SSD1306_I2C poweron method
  • display/ssd1306: make poweron() work the same with SSD1306_SPI
  • wiznet5k: improve the performance of socket ops with threading
  • wiznet5k: get low-level W5500 driver working

tools:

  • upip: upgrade to 1.2.2
  • pyboard: use repr() when quoting data in error messages
  • pyboard: update docstring for additional device support

tests:

  • object_new: better messages, check user new() method
  • class_new: add checks for init being called and other improvements
  • class_new: add another testcase for new/init interaction
  • class_inplace_op: test for inplace op fallback to normal one
  • run-bench-tests: update locations of executables, now in ports/
  • class_reverse_op: test for reverse arith ops special methods
  • run-tests: skip class_inplace_op for minimal profile
  • run-tests: fix copy-paste mistake in var name
  • cpydiff: add cases for locals() discrepancies
  • extmod: add test for ure regexes leading to infinite recursion
  • extmod: add test for '-' in character class in regex
  • run-tests: close device under test using "finally"
  • net_inet: update tls test to work with CPython and incl new site

unix port:

  • rename modsocket.c to modusocket.c
  • modusocket: remove #if MICROPY_SOCKET_EXTRA code blocks
  • enable MICROPY_PY_REVERSE_SPECIAL_METHODS

stm32 port:

  • modmachine: make machine.bootloader() work when MPU is enabled
  • modmachine: improve support for sleep/deepsleep on F7 MCUs
  • compute PLL freq table during build instead of at run time
  • modmachine: for F7 MCU, save power by reducing internal volt reg
  • boards/pllvalues.py: make script work with both Python 2 and 3
  • Makefile: use lib/stm32lib instead of local cmsis and hal files
  • remove cmsis and hal files, they are now a submodule
  • Makefile: automatically fetch stm32lib submodule if needed
  • update to new STM Cube HAL library
  • fix clock initialisation of L4 MCUs
  • rename stmhal port directory to stm32
  • remove unused usbd_msc.c file
  • boards: change remaining stm32f4xx_hal_conf.h to unix line ending
  • boards: change linker scripts to use "K" instead of hex byte size
  • boards: fix I2C1 pin mapping on NUCLEO_F401RE/F411RE boards
  • i2c: when scanning for I2C devices only do 1 probe per address
  • modnwwiznet5k: release the GIL on blocking network operations
  • boards: add new board B_L475E_IOT01A based on STM32L475
  • make-stmconst.py: make sure mpz const data lives in ROM
  • timer: make pyb.Timer() instances persistent
  • mpconfigport.h: add configuration for max periphs on L4 series
  • usbdev: make the USBD callback struct const so it can go in ROM
  • usbdev: change static function variable to non-static
  • usbdev: put all CDC state in a struct
  • usbdev: put all HID state in a struct
  • usbdev: simplify CDC tx/rx buffer passing
  • usbdev: simplify HID tx/rx buffer passing
  • usbdev/core: add state parameter to all callback functions
  • usbdev: put all state for the USB device driver in a struct
  • usbdev: simplify pointers to MSC state and block dev operations
  • usbdev: merge all global USB device state into a single struct
  • usbdev: make device descriptor callbacks take a state pointer
  • usbdev: move all the USB device descriptor state into its struct
  • timer: enable ARPE so that timer freq can be changed smoothly
  • modnwwiznet5k: get the IP address of an established socket
  • boards: fix typos in stm32f767_af.csv table
  • usbd_cdc_interface: don't reset CDC output buf on initialisation
  • modnwwiznet5k: implement WIZNET5K.isconnected() method
  • modusocket: make getaddrinfo() work when passed an IP address
  • modusocket: return OSError(-2) if getaddrinfo fails
  • mpconfigport.h: add MICROPY_THREAD_YIELD() macro
  • modnwwiznet5k: add support for W5500 Ethernet chip
  • modnwwiznet5k: increase SPI bus speed to 42MHz
  • modnwwiznet5k: implement stream ioctl for the Wiznet driver
  • mphalport: improve efficiency of mp_hal_stdout_tx_strn_cooked
  • make uos.dupterm() conform to specs by using extmod version

cc3200 port:

  • enable micropython.kbd_intr() method
  • use standard implementation of keyboard interrupt

esp8266 port:

  • rename axtls_helpers.c to posix_helpers.c
  • posix_helpers: set ENOMEM on memory alloc failure
  • set DEFPSIZE=1024, MINCACHE=3 for "btree" module
  • esp_mphal: send data in chunks to mp_uos_dupterm_tx_strn
  • modnetwork: add "bssid" keyword arg to WLAN.connect() method
  • modules/webrepl_setup: add info about allowed password length

zephyr port:

  • Makefile: revamp "test" target after ports were moved to ports/
  • use CONFIG_NET_APP_SETTINGS to setup initial network addresses
  • switch to interrupt-driven pull-style console

pic16bit port:

  • add definition of SEEK_SET to unistd.h

docs:

  • pyboard/tutorial: add "timeout=0" to UART in pass-through example
  • more xrefs to "MicroPython port" in glossary
  • library/network: fix ref to "socket" module (should be "usocket")
  • machine.Signal: improve style/grammar and add usage example
  • library: add description of "index" parameter to uos.dupterm()
  • library/micropython: fix typo in RST formatting
  • library/framebuf.rst: generalise constructor to all colour formats
  • btree: describe page caching policy of the underlying implementation
  • esp8266/tutorial: update neopixel with example of using 4 bbp
  • library/network: clarify usage of "bssid" arg in connect() method
  • pyboard/quickref: add info for Switch, RTC, CAN, Accel classes
  • pyboard/tutorial: update now that yellow LED also supports PWM
  • esp8266/quickref: add quickref info for RTC class
  • library: add missing cross-ref links for classes in pyb module
  • library/network: update docs to state that W5500 is supported
  • uselect: document one-shot polling mode
  • usocket: elaborate descriptions
  • usocket: document inet_ntop(), inet_pton()
  • library/network: add dhcp_hostname parameter
  • reference/isr_rules: minor typo correction
  • ussl: fix module name refs and use "MicroPython port" term
  • esp8266/general: add section on TLS limitations
  • usocket: document that settimeout() isn't supported by all ports
  • ure: add "|" (alternative) to the list of supported operators
  • reference/isr_rules.rst: add tutorial on use of micropython.schedule()

travis:

  • use --upgrade when pip is installing cpp-coveralls
  • update build command now that stm32 Wiznet config has changed

examples:

  • hwconfig_console: add .on()/.off() methods

all:

  • convert mp_uint_t to mp_unary_op_t/mp_binary_op_t where appropriate
  • convert remaining "mp_uint_t n_args" to "size_t n_args"
  • make new ports/ sub-directory and move all ports there
  • update Makefiles and others to build with new ports/ dir layout
  • remove inclusion of internal py header files
  • use NULL instead of "" when calling mp_raise exception helpers

README:

  • update "Dependencies" section
  • add explicit section on contributing
  • add gcc and arm-none-eabi-newlib to list of required components

.gitattributes:

  • remove obsolete entries for stmhal/hal, stmhal/cmsis
  • add entries for files that will move to ports/ dir
2017-11-01 08:19

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
2017-08-23 09:46

Fixes for stmhal USB mass storage, lwIP bindings and VFS regressions

This release provides an important fix for the USB mass storage device in
the stmhal port by implementing the SCSI SYNCHRONIZE_CACHE command, which
is now require by some Operating Systems. There are also fixes for the
lwIP bindings to improve non-blocking sockets and error codes. The VFS has
some regressions fixed including the ability to statvfs the root.

All changes are listed below.

py core:

  • modbuiltins: add core-provided version of input() function
  • objstr: catch case of negative "maxsplit" arg to str.rsplit()
  • persistentcode: allow to compile with complex numbers disabled
  • objstr: allow to compile with obj-repr D, and unicode disabled
  • modsys: allow to compile with obj-repr D and PY_ATTRTUPLE disabled
  • provide mp_decode_uint_skip() to help reduce stack usage
  • makeqstrdefs.py: make script run correctly with Python 2.6
  • objstringio: if created from immutable object, follow copy on write policy

extmod:

  • modlwip: connect: for non-blocking mode, return EINPROGRESS
  • modlwip: fix error codes for duplicate calls to connect()
  • modlwip: accept: fix error code for non-blocking mode
  • vfs: allow to statvfs the root directory
  • vfs: allow "buffering" and "encoding" args to VFS's open()
  • modframebuf: fix signed/unsigned comparison pendantic warning

lib:

  • libm: use isfinite instead of finitef, for C99 compatibility
  • utils/interrupt_char: remove support for KBD_EXCEPTION disabled

tests:

  • basics/string_rsplit: add tests for negative "maxsplit" argument
  • float: convert "sys.exit()" to "raise SystemExit"
  • float/builtin_float_minmax: PEP8 fixes
  • basics: convert "sys.exit()" to "raise SystemExit"
  • convert remaining "sys.exit()" to "raise SystemExit"

unix port:

  • convert to use core-provided version of built-in import()
  • Makefile: replace references to make with $(MAKE)

windows port:

  • convert to use core-provided version of built-in import()

qemu-arm port:

  • Makefile: adjust object-file lists to get correct dependencies
  • enable micropython.mem_*() functions to allow more tests

stmhal port:

  • boards: enable DAC for NUCLEO_F767ZI board
  • add support for NUCLEO_F446RE board
  • pass USB handler as parameter to allow more than one USB handler
  • usb: use local USB handler variable in Start-of-Frame handler
  • usb: make state for USB device private to top-level USB driver
  • usbdev: for MSC implement SCSI SYNCHRONIZE_CACHE command
  • convert from using stmhal's input() to core provided version

cc3200 port:

  • convert from using stmhal's input() to core provided version

teensy port:

  • convert from using stmhal's input() to core provided version

esp8266 port:

  • Makefile: replace references to make with $(MAKE)
  • Makefile: add clean-modules target
  • convert from using stmhal's input() to core provided version

zephyr port:

  • modusocket: getaddrinfo: Fix mp_obj_len() usage
  • define MICROPY_PY_SYS_PLATFORM (to "zephyr")
  • machine_pin: use native Zephyr types for Zephyr API calls

docs:

  • machine.Pin: remove out_value() method
  • machine.Pin: add on() and off() methods
  • esp8266: consistently replace Pin.high/low methods with .on/off
  • esp8266/quickref: polish Pin.on()/off() examples
  • network: move confusingly-named cc3200 Server class to its reference
  • uos: deconditionalize, remove minor port-specific details
  • uos: move cc3200 port legacy VFS mounting functions to its ref doc
  • machine: sort machine classes in logical order, not alphabetically
  • network: first step to describe standard network class interface

examples:

  • embedding: use core-provided KeyboardInterrupt object
2017-06-11 21:04
2017-05-26 17:07

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()
2017-01-08 20:53

ESP8266 port uses SDK 2.0, has more heap, has support for 512k devices

This release brings some code size reductions to the core as well as
more tests and improved coverage which is now at 94.3%.

The time.ticks_diff(a, b) function has changed: the order of the arguments
has been swapped so that it behaves like "a - b", and it can now return a
negative number if "a" came before "b" (modulo the period of the ticks
functions).

For the ESP8266 port the Espressif SDK has been updated to 2.0.0, the
heap has been increased from 28k to 36k, and there is support for 512k
devices via "make 512k". upip is included by default as frozen bytecode.
The network module now allows access-point reconnection without WiFi
credentials, and exposes configuration for the station DHCP hostname. The
DS18B20 driver now handles negative temperatures, and NeoPixel and APA102
drivers handle 4 bytes-per-pixel LEDs.

For the CC3200 port there is now support for loading of precompiled .mpy
files and threading now works properly with interrupts.

A detailed list of changes follows.

py core:

  • py.mk: automatically add frozen.c to source list if FROZEN_DIR is defined
  • be more specific with MP_DECLARE_CONST_FUN_OBJ macros
  • specialise builtin funcs to use separate type for fixed arg count
  • {modbuiltins,obj}: use MP_PYTHON_PRINTER where possible
  • modbuiltins: add builtin "slice", pointing to existing slice type
  • add "delattr" builtin, conditional on MICROPY_CPYTHON_COMPAT
  • sequence: fix reverse slicing of lists
  • fix null pointer dereference in mpz.c, fix missing va_end in warning.c
  • remove asserts that are always true in emitbc.c
  • fix wrong assumption that m_renew will not move if shrinking
  • change config default so m_malloc0 uses memset if GC not enabled
  • add MICROPY_FLOAT_CONST macro for defining float constants
  • move frozen bytecode Makefile rules from ports to common mk files
  • strip leading dirs from frozen mpy files, so any path can be used

extmod:

  • vfs_fat_file: check fatfs f_sync() and f_close() returns for errors
  • vfs_fat_file: make file.close() a no-op if file already closed
  • utime_mphal: ticks_diff(): switch arg order, return signed value
  • utime_mphal: add MP_THREAD_GIL_EXIT/ENTER warppers for sleep functions
  • utime_mphal: implement ticks_add(), add to all maintained ports
  • utime_mphal: allow ticks functions period be configurable by a port

lib:

  • utils/pyhelp.c: use mp_printf() instead of printf()
  • utils/pyexec: add mp_hal_set_interrupt_char() prototype
  • libm: move Thumb-specific sqrtf function to separate file

drivers:

  • add "from micropython import const" when const is used

tools:

  • upgrade upip to 1.1.4: fix error on unix when installing to non-existing
    absolute path
  • pip-micropython: remove deprecated wrapper tool
  • check_code_size.sh: code size validation script for CI
  • replace upip tarball with just source file, to make its inclusion as
    frozen modules in multiple ports less magic

tests:

  • extmod/vfs_fat: improve VFS test coverage
  • basics/builtin_slice: add test for "slice" builtin name
  • basics: add test for builtin "delattr"
  • extmod/vfs_fat_fsusermount: improve fsusermount test coverage
  • extmod/vfs_fat_oldproto: test old block device protocol
  • basics/gc1: garbage collector threshold() coverage
  • extmod/uhashlib_sha1: coverage for SHA1 algorithm
  • extmod/uhashlib_sha256: rename sha256.py test
  • btree1: fix out of memory error running on esp8266
  • extmod/ticks_diff: test for new semantics of ticks_diff()
  • extmod/framebuf1: test framebuffer pixel clear, and text function

minimal port:

  • Makefile: split rule for firmware.bin generation

unix port:

  • Makefile: remove references to deprecated pip-micropython
  • modtime: use ticks_diff() implementation from extmod/utime_mphal.c
  • mphalport.h: add warning of mp_hal_delay_ms() implementation
  • modtime: switch ticks/sleep_ms/us() to utime_mphal
  • fix symbol references for x86 Mac
  • replace upip tarball with just source file

windows port:

  • enable utime_mphal following unix, define mp_hal_ticks_*
  • fix utime_mphal compilation for msvc
  • implement mp_hal_ticks_cpu in terms of QueryPerformanceCounter

qemu-arm port:

  • exclude ticks_diff test for qemu-arm port
  • exclude extmod/vfs_fat_fileio.py test
  • exclude new vfs_fat tests
  • enable software floating point support, and float tests

stmhal port:

  • modutime: refactor to use extmod's version of ticks_cpu
  • refactor pin usage to use mp_hal_pin API
  • led: refactor LED to use mp_hal_pin_output() init function
  • Makefile: use standard rules for frozen module generation
  • modutime: consistently convert to MP_ROM_QSTR/MP_ROM_PTR
  • enable SD power save (disable CLK on idle)

cc3200 port:

  • use mp_raise_XXX helper functions to reduce code size
  • mods/pybspi: allow "write" arg of read/readinto to be positional
  • enable loading of precompiled .mpy files
  • fix thread mutex's so threading works with interrupts

teensy port:

  • update to provide new mp_hal_pin_XXX functions following stmhal

esp8266 port:

  • Makefile: use latest esptool.py flash size auto-detection
  • esp_init_data: auto-initialize system params with vendor SDK 2.0.0
  • esp8266.ld: move help.o to iROM
  • esp8266.ld: move modmachine.o to iROM
  • esp8266.ld: move main.o to iROM
  • add MP_FASTCODE modifier to put a function to iRAM
  • main: mark nlr_jump_fail() as MP_FASTCODE
  • modules/webrepl: enforce only one concurrent WebREPL connection
  • etshal.h: add few more ESP8266 vendor lib prototypes
  • modesp: add flash_user_start() function
  • add support for building firmware version for 512K modules
  • scripts: make neopixel/apa102 handle 4bpp LEDs with common code
  • modutime: consistently convert to MP_ROM_QSTR/MP_ROM_PTR
  • modnetwork: config(): fix copy-paste error in setting "mac"
  • scripts/port_diag: add descriptions for esf_buf types
  • modnetwork.c: allows AP reconnection without WiFi credentials
  • main: bump heap size to 36K
  • etshal.h: add prototypes for SPIRead/SPIWrite/SPIEraseSector
  • etshal.h: adjust size of MD5_CTX structure
  • modules: fix negative temperature in ds18x20 driver
  • rename "machine" module implementation to use contemporary naming
  • rework webrepl_setup to run over wired REPL
  • espneopixel.c: solve glitching LED issues with cpu at 80MHz
  • include upip as a standard frozen bytecode module
  • update docs for esptool 1.2.1/SDK 2.0 (--flash_size=detect)
  • modnetwork.c: expose configuration for station DHCP hostname

zephyr port:

  • implement utime module
  • use board/SoC values for startup banner based on Zephyr config
  • initial implementation of machine.Pin
  • zephyr_getchar: update for recent Zephyr refactor of console hooks
  • support time -> utime module "weaklink"
  • README: update for the current featureset, add more info
  • mpconfigport.h: move less important params to the bottom
  • Makefile: allow to adjust heap size from make command line
  • Makefile: update comments to the current state of affairs
  • Makefile: allow to override Zephyr config from make command line
  • Makefile: add minimal port
  • Makefile: add -fomit-frame-pointer to reduce code size
  • mphalport.h: update for new "unified" kernal API (sleep functions)

docs:

  • machine.SPI: bring up to date with Hardware API, make vendor-neutral
  • machine.SPI: improve descriptions of xfer methods
  • library/builtins: add docs for delattr and slice
  • library/network: reword intro paragraph
  • library/network: typo fixes, consistent acronym capitalization
  • library/index: update TOCs so builtins sorted before modules
  • utime: document ticks_cpu() in more detail
  • utime: describe new semantics of ticks_diff() (signed ring arithmetics)
  • utime: add docs for ticks_add(), improvements for other ticks_*()
  • esp8266: update for new WebREPL setup procedure
  • */quickref.rst: use new semantics of ticks_diff()
  • library/machine.Pin: update Pin docs to align with new HW API

travis:

  • integrate tools/check_code_size.sh
  • minimal: Use CROSS=1, for binary size check

examples:

  • http_server_simplistic: add "not suitable for real use" note
  • hwapi: example showing best practices for HW API usage in apps
  • hwapi: add hwconfig for DragonBoard 410c
2016-11-10 18:24
2016-10-17 12:32

Support for stream decompression in uzlib, and more ESP8266 features

This release includes some bug fixes, code clean-up, updates to the docs,
more tests, and various feature additions. The uzlib module now supports
efficient stream decompression in the form of the uzlib.DecompIO class.
Freezing of bytecode now supports floats for the ESP8266 port, as well as
complex numbers for all ports. The stmhal port has ADC working on L4
microcontrollers, fixed initialisation for DAC, and addition of the
machine.WDT class and machine.reset_cause function.

For the ESP8266 port Pin(16) now works as an input pin and the hardware
SPI peripheral is exposed as machine.SPI(1). The os.umount function is
implemented and the port supports mounting of externally connected SD
cards. The machine.WDT class is added, wlan.scan() is fixed to return all
access points, and there is support for DS18S20 devices.

py core:

  • runtime: factor out exception raising helpers
  • runtime: define mp_check_self(pred) helper macro
  • objdict: get rid of asserts (remove/replace with mp_check_self())
  • get rid of assert() in method argument checking functions
  • objtuple: in tuple_cmp_helper, use mp_check_self instead of raising
  • objstr: use mp_raise_{Type,Value}Error instead of mp_raise_msg
  • obj.h: for obj reprs A,B,C use void* explicitly for mp_obj_t typedef
  • mpconfigport.h: remove typedef of machine_ptr_t, it's no longer needed
  • sequence: allow to use bignums as indices in slice objects
  • stream.c: use mp_obj_get_type in mp_get_stream_raise
  • gc: add MICROPY_GC_CONSERVATIVE_CLEAR option to always zero memory
  • compile: don't compile assert statements when optimisations enabled
  • modstruct: use more compact mp_raise_ValueError function
  • emitglue: use more compact mp_raise_ValueError function
  • rename struct mp_code_state to mp_code_state_t
  • mkrules.mk: allow to override name of libmicropython.a
  • mpprint: fail an assertion with unsupported format specifiers
  • makeqstrdata.py: compute the qstr hash from bytes, not characters
  • if str/bytes hash is 0 then explicitly compute it
  • emitglue.c: provide mp_raw_code_load_file for any unix architecture
  • add MICROPY_USE_INTERNAL_PRINTF option, defaults to enabled

extmod:

  • modwebrepl: set_password(): raise exception for too long password
  • uzlib/: update uzlib to v2.0: new API supporting stream decompression
  • moduzlib: refactor to new stream-compatible uzlib 2.0 API
  • uzlib/: update uzlib to v2.0.1: fixes for pedantic compiler warnings
  • uzlib/: update uzlib to v2.0.2: consistently use stdint types
  • modbtree: do CHECK_ERROR after __bt_seq()
  • modubinascii: implement binascii.crc32
  • modubinascii: make crc32() support configurable
  • modframebuf: fix pixel accessor to return a 1-bit result
  • add machine_spi with generic SPI C-protocol and helper methods
  • modframebuf: fix fill and scroll when height not divisible by 8
  • moduzlib: implement zlib stream decompressor class, DecompIO
  • moduzlib: use mperrno.h for error constants
  • modframebuf: include font from stmhal directory explicitly
  • moduzlib: support wbits arg to DecompIO
  • framebuf: add the xstep!=0 case to scroll() method

lib:

  • utils/stdout_helpers: fix function signature to match py/mphal.h
  • berkeley-db-1.xx: update to upstream, fixes MacOSX build
  • utils/pyexec: qstr_pool_info() requires size_t* parameters

drivers:

  • sdcard: port the SDCard driver to new machine API, with backwards
    compatibility for pyboard

tools:

  • mpy-tool.py: support freezing float literals with obj-repr C
  • mpy-tool.py: store qstr config values in global config object
  • mpy-tool.py: compute the hash value for str/bytes objects
  • mpy-tool.py: support freezing of complex numbers

tests:

  • rename zlibd_decompress.py -> uzlib_decompress.py
  • basics: add more tuple tests to improve coverage testing
  • basics: add more list tests to improve coverage testing
  • misc/non_compliant: add tests to improve coverage testing
  • basics: add test for break from within try within a for-loop
  • basics: add a test file for overriding special methods
  • basics/special_methods: enable tests for extra special methods
  • uzlib_decompress: actually test raw DEFLATE stream
  • run-tests: disable thread/thread_lock4.py on Travis
  • run-tests: disable thread/stress_heap.py when running on Travis
  • cmdline: add test for -O option to check optimisation value
  • extmod/vfs_fat_ramdisk: add tests for VFS.umount()
  • run-tests: disable thread_gc1.py test on Travis
  • unix/extra_coverage: add test for str/bytes with invalid hash
  • extmod: add test for uzlib.DecompIO
  • extmod: add a test for framebuf module, tested by coverage build
  • extmod/uzlib_decompio: add zlib bitstream testcases
  • extmod/framebuf1: add tests for scrolling in the x-direction
  • run-tests: disable thread/stress_recurse.py test on Travis

unix port:

  • mpconfigport.h: don't include stdio.h on MacOS
  • when find'ing frozen files don't use extra slash, do follow symlinks

qemu-arm port:

  • enable MICROPY_PY_ALL_SPECIAL_METHODS

stmhal port:

  • boards: update STM32L476 pin defs to include ADC channels
  • adc.c: get ADC working on STM32L4 MCUs
  • fix timer capture/compare interrupt handling for TIM1 and TIM8
  • remove obsolete code for special handling of TIM3 irq settings
  • make ADC channel 16 available on L4 MCUs
  • update pin print to print new constants
  • modusocket: set self->nic to MP_OBJ_NULL after socket close
  • update boot.py files to use VCP instead of CDC
  • spi: factor out SPI transfer code to a single function
  • spi: support new machine SPI methods in legacy SPI object
  • add machine.WDT class
  • set STM32F7DISC CPU Frequency to 216 MHz
  • dac: fix DAC (re-)initialisation by resetting DMA
  • wdt: implement keyword args to WDT constructor
  • modmachine: implement machine.reset_cause() function, and consts
  • machine.POWER_ON is renamed to machine.PWRON_RESET
  • when find'ing frozen files don't use extra slash, do follow symlinks

cc3200 port:

  • add machine.PWRON_RESET constant (machine.POWER_ON is now deprecated)

teensy port:

  • fix execution of frozen boot.py and main.py

esp8266 port:

  • fix reading of pin object for GPIO16; Pin(16) now works as an input
  • PULL_UP is not supported on Pin(16), so raise an exception in this case
  • enable support for all special methods
  • modpybhspi: add a HSPI module for hardware SPI support
  • modmachinespi: add a factory method for SoftSPI/HSPI
  • esp_mphal: no longer disable watchdog on startup
  • modpybrtc: use 64-bit arithmetic when computing alarm expiry
  • hspi: enable duplex operation of hardware SPI
  • modous: add os.umount method to unmount a filesystem
  • modmachinewdt: implement machine.WDT class
  • modules: split onewire.py into OneWire and DS18X20 driver
  • modules/onewire: change onewire.read() to onewire.readinto()
  • modules/ds18x20.py: add support for DS18S20 devices
  • modpybspi: use generic SPI helper methods to implement SPI
  • modpybhspi: simplify HSPI driver by using 1 function for xfers
  • modmachinewdt: add .deinit() method
  • modmachine: add WDT_RESET and SOFT_RESET constants
  • modmachine: don't expose internal SoftSPI and HSPI classes
  • modmachine: simplify SPI class implementation multiplexing
  • espneopixel: disable IRQs during eps.neopixel_write
  • modnetwork: fix wlan.scan() method so it returns all networks
  • modmachine: map PWR_ON_RESET to vendor's REASON_DEFAULT_RST
  • machine.PWR_ON_RESET is renamed to machine.PWRON_RESET
  • when find'ing frozen files don't use extra slash, do follow symlinks

docs:

  • esp8266/tutorial/pins: fix typo in commands for pin input mode
  • esp8266/intro: add command to install esptool.py 1.0.1 via pip
  • library/machine.WDT: add note that WDT is only available on WiPy
  • esp8266/quickref: fix and update the SPI docs
  • esp8266: update quickref and tutorial for OneWire/DS18X20 driver
  • pyboard: update USB mouse tutorial to use VCP instead of CDC
  • pyboard: update USB mouse tutorial to use pyb.USB_HID()
  • library: add reference for pyb.usb_mode and pyb.USB_HID
  • pyboard/quickref: add links to pinouts for other pyboard variants
  • pyboard/quickref: add section on "delay and timing" for utime mod
  • esp8266/quickref: add internal links to docs for some modules
  • esp8266/quickref: update information on SPI classes
  • esp8266/quickref: further improvements for SPI subsections
  • library/machine.WDT: add that WDT is available on pyboard
  • reference/isr_rules.rst: two minor additions to docs for using ISR

misc:

  • add *.pyc to .gitignore, because Python 2 doesn't use pycache
  • build mpy-cross as part of the Travis process
2016-09-09 12:07

Many small improvements and additions, with btree support in ESP8266 port

This release brings various improvements and additions to the core,
extended modules and the ESP8266 port, as well as enhancements to the docs.
There is now a "threshold" function in the gc module for the user to
configure the garbage collector to run earlier than usual, in order to help
reduce fragmentation of the heap. The btree module is now available in the
ESP8266 port, and there is improved WebREPL file transfer: get file is now
non-blocking (this change requires an update of the client software).

py core:

  • nlrx64.S: prefix mp_thread_get_state with an underscore on Mac
  • stream: implement 2- and 3-arg write() method as an extension to CPython
  • gc: implement GC running by allocation threshold, user configurable
  • fix nlrthumb.c when DEBUG=1 is defined
  • obj: issue a warning when str and bytes objects are compared
  • mpconfig.h: fix description for MICROPY_PY_STR_BYTES_CMP_WARN
  • objstrunicode: str_index_to_ptr: should handle bytes too
  • objstrunicode: str_index_to_ptr: implement positive indexing properly
  • stream: implement generic flush() method, in terms of C-level ioctl
  • objstringio: add MP_STREAM_FLUSH ioctl and flush() method
  • objstringio: implement MP_STREAM_SEEK ioctl and add seek() method
  • stream: add adapter methods with POSIX-compatible signatures
  • mpconfig.h: add MICROPY_STREAMS_POSIX_API setting
  • py.mk: extra switches to build "embedded" BerkeleyDB BTree lib
  • mkrules.mk: allow to add more items for "clean" target using CLEAN_EXTRA
  • objstr: make .partition()/.rpartition() methods configurable
  • mpconfig.h: define MP_ALWAYSINLINE for reuse

extmod:

  • modussl: rename to modussl_axtls.c, to allow impl using other SSL libs
  • modussl_axtls: further changes to allow alternative SSL modules
  • modussl_axtls: add dummy setblocking() method
  • vfs_fat: implement rmdir() method (aliases to unlink)
  • modussl_axtls: use mp_stream_close() method
  • modwebrepl: use mp_stream_close() method
  • modbtree: check __bt_open() return value for error
  • modbtree: switch to accepting stream object instead of filename
  • modbtree: implement contains operation
  • modwebrepl: factor out "GET" iteration to write_file_chunk()
  • modwebrepl: make GET_FILE operation non-blocking
  • modbtree: open(): add option kwargs
  • modwebsocket: add readline method
  • modwebsocket: make compatible with non-default object models
  • modwebsocket: use mp_rom_map_elem_t and friends
  • modwebrepl: add GET_VER operation to query MicroPython version

lib:

  • axtls: upgrade to axTLS 1.5.4 + MicroPython patchset
  • axtls: update, fixes esp8266 build
  • utils/stdout_helpers: move from minimal/uart_extra.c for reuse
  • embed/abort_: implementation of abort_() function raising uPy exception
  • berkeley-db-1.xx: switch to "embedded" branch
  • berkeley-db-1.xx: update, sets default page size to 4096

tests:

  • add test for extended arguments to stream .write() method
  • extmod/machine_pinbase: skip if machine.PinBase is not available
  • bytes_compare: rework test for bytes <-> str comparison
  • extmod/btree1: close database at the end of test
  • unicode_subscr.py: detailed test for subscripting unicode strings
  • run-tests: make "regex'ed .exp" facility available to device tests
  • io/bytesio_ext: test for .seek()/.flush() on BytesIO
  • extmod/btree1: tests against in-memory DB (using io.BytesIO)
  • machine_mem.py: too non-portable, rework as an example for unix port
  • machine1: revamp to work with unix port (which has "umachine")
  • basics: bytes/str.partition/rpartition are now optional

mpy-cross:

  • fix Makefile to handle gc-sections linker flags on OS X
  • use binary file translation mode for creating mpy files on windows
  • fix mingw and msys2 compilation

minimal port:

  • disable MICROPY_GC_ALLOC_THRESHOLD

unix port:

  • mpthreadport: adjust minimum thread stack, and stack limit check
  • cache libaxtls.a in local build dir
  • disable MICROPY_GC_ALLOC_THRESHOLD for minimal build
  • enable MICROPY_PY_STR_BYTES_CMP_WARN
  • mpconfigport.h: include stdio.h by default
  • file: implement MP_STREAM_FLUSH ioctl
  • file: ioctl(): check that file is open before operations
  • file: fdfile_ioctl(): fix argument to check_fd_is_open()
  • file: use generic stream flush() method
  • enable websocket module
  • moduselect: allow poll.register(), etc. accept fd-like objects

stmhal port:

  • fix malloc when used with external libraries
  • make SPI NSS pin definition optional
  • fix I2C mappings for STM32F429DISC board

esp8266 port:

  • select axTLS for SSL implementation, following recent refactor
  • moduos: add rmdir() function
  • cache Xtensa-built libaxtls.a in local build dir
  • enable MICROPY_PY_STR_BYTES_CMP_WARN
  • dupterm_task_init() should be called before running _boot.py, etc
  • _boot.py: set GC alloc threshold to half of heap size
  • _boot.py: decrease GC alloc threshold to quarter of heap size
  • modpybuart: fix UART parity setting
  • axtls_helpers: remove abort_(), now in lib/embed/
  • mpconfigport.h: include sys/types.h for POSIX types definitions
  • esp_mphal: implement libc's errno
  • enable btree module
  • eagle.rom.addr.v6.ld: add Enable_QMode symbol from SDK 2.0.0
  • make APA102 driver inclusion configurable
  • makeimg.py: store firmware size as last 4 bytes of padding area
  • makeimg.py: append md5 hash to the generated binary
  • modesp: add check_fw() function to check integrity of the firmware
  • scripts/port_diag.py: include esp.check_fw() call
  • flashbdev: reserve extra sysparam sector for SDK 2.0.0 compatibility
  • scripts/inisetup: add commented-out call to esp.osdebug(None)
  • modmachine: implement idle() function
  • esp_mphal.h: add mp_hal_ticks_cpu() for reuse
  • modutime: actually implement ticks_cpu()
  • modmachine: implement dummy sleep() function
  • tutorial/intro: reword para abou -fm dio switch
  • modules/flashbdev: start filesystem at 0x90000
  • esp8266.ld: increase firmware image size to 0x90000 (576K)

docs:

  • add DHT to ESP8266 Quick Ref and Tutorial
  • fix some spelling mistakes
  • array: document array module
  • library/index: include array module in ToC
  • esp8266/intro: rename to "Getting started" from "Introduction"
  • esp8266/intro: add troubleshooting section
  • esp8266/quickref: link to installation instructions
  • esp8266/tutorial/intro: add anchor for link from quickeref
  • esp8266/intro: focus on hazards of unearthed power wrt electronics
  • uio: mention seek()/flush() support for io.BytesIO

misc:

  • logo/1bit-logo A black & white version of the logo

examples:

  • http_server*: update for buffered-like streams (read line by line)
  • embedding: example for embedding MicroPython in an app
  • embedding: add README
  • http_client*: be sure to close socket
  • network: split recv- and read-based HTTP servers

qemu-arm:

  • enable gcc LTO option for nlrthumb.c
2016-08-09 21:49

Thread support, ESP8266 memory improvements, btree module, improved docs

This release brings multi-threading support in the form of the _thread
module, which closely matches the semantics of the corresponding CPython
module. There is support for GIL and non-GIL builds; without the GIL
enabled one must protect concurrent access to mutable Python state at the
Python level using Lock objects. Threading with the GIL is enabled in
the cc3200 port on the WiPy. Threading without the GIL is enabled on the
unix port. The ESP8266 port has support for frozen bytecode (for scripts
in the modules/ subdirectory), as well as optimisations for reduced
memory usage and decreased memory fragmentation. The ESP8266 RTC also
resumes correctly after a deepsleep. An initial "btree" module has been
implemented for database support (unix port only), and the documentation
has been further improved, with pre-built PDF versions of the docs now
available.

py core:

  • parse: treat constants that start with underscore as private
  • objdict: implemented OrderedDict equality check
  • support to build berkeley db 1.85 and "btree" module
  • mpconfig.h: MP_NOINLINE is universally useful, move from unix port
  • makeqstrdefs.py: remove restriction that source path can't be absolute
  • mkrules.mk: define "lib" outside conditional block
  • rename __QSTR_EXTRACT flag to NO_QSTR
  • objtype: instance: inherit protocol vtable from a base class
  • mphal.h: if virtpin API is used, automagically include its header
  • objtype: inherit protocol vtable from base class only if it exists
  • add MP_STATE_THREAD to hold state specific to a given thread
  • add basic _thread module, with ability to start a new thread
  • modthread: properly cast concrete exception pointer to an object
  • modthread: add stack_size() function
  • modthread: add exit() function
  • modthread: implement lock object, for creating a mutex
  • modthread: add with-context capabilities to lock object
  • gc: make memory manager and garbage collector thread safe
  • modthread: satisfy unused-args warning
  • gc: fix 2 cases of concurrent access to ATB and FTB
  • modthread: be more careful with root pointers when creating a thread
  • modthread: call mp_thread_start/mp_thread_finish around threads
  • gc: fix GC+thread bug where ptr gets lost because it's not computed
  • make interning of qstrs thread safe
  • implement a simple global interpreter lock (GIL)
  • don't use gc or qstr mutex when the GIL is enabled, there is no need
  • modthread: make Lock objects work when GIL is enabled
  • mpthread.h: move GIL macros outside MICROPY_PY_THREAD block
  • modthread: allow to properly set the stack limit of a thread
  • nlrthumb: convert NLR thumb funcs from asm to C with inline-asm
  • nlrsetjmp: update to take into account new location of nlr_top
  • mpthread: include mpstate.h when defining GIL macros
  • gc: be sure to count last allocated block at heap end in stats
  • gc: calculate (and report) maximum contiguous free block size
  • builtinimport: disable "imported as namespace package" warning
  • mpconfig.h: mention MICROPY_PY_BTREE config option
  • objarray: split out header to allow direct access to object
  • rename mp_obj_type_t::stream_p to "protocol"

extmod:

  • modbtree: initial implementation of "btree" module based on BerkeleyDB
  • modbtree: handle default value and error check
  • modbtree: implement .items() iterator
  • modbtree: actually implement end key support for .items()
  • modbtree: items(): Implement "end key inclusive" flag
  • modbtree: items(): Implement DESC flag
  • modbtree: getitem() should raise KeyError for non-existing key
  • modbtree: open(): Support "in-memory" database with filename=None
  • machine_pinbase: implementation of PinBase class
  • machine_pinbase: fix nanbox build
  • modlwip: store a chain of incoming pbufs, instead of only one
  • modbtree: implement keys(), values(), items() iterators
  • modbtree: cleverly implement "for key in btree:" syntax
  • modwebsocket: add readinto() method
  • modwebrepl: add readinto() method
  • modbtree: fix unused argument warning
  • modbtree: fixes for nanbox build
  • moduos_dupterm: reserve buffer bytearray object for dupterm
  • moduos_dupterm: reuse dupterm_arr_obj for write operations

lib:

  • berkeley-db-1.xx: add Berkeley DB 1.85 as a submodule
  • berkeley-db-1.xx: update to upstream which builds for uPy
  • fatfs/option/ccsbcs: follow uPy optional features model
  • libm: format code to pass gcc v6.1.1 warning
  • libm: remove unused definition of "one"

drivers:

  • display/ssd1306: add width arg and support 64px wide displays

tests:

  • recursive_iternext: clang/Linux is even more stack-frugal than MacOS
  • bench: add testcase to compare bytes(N) vs b"\0" * N
  • add testcase for OrderedDict equality
  • add a testcase for machine.PinBase class
  • extmod: add "btree" module test
  • btree1: add testcase for iterating btree object directly
  • add tests for _thread module
  • add 3 more tests for _thread module
  • thread: remove need to sleep to wait for completion in some tests
  • thread: add tests for running GC within a thread, and heap stress
  • thread: rename thread_stress_XXX.py to stress_XXX.py
  • thread: add tests that mutate shared objects
  • thread: add test for concurrent interning of strings
  • thread: add test for concurrent mutating of user instance
  • thread: make stack-size test run correctly and reliable on uPy
  • thread: make sure that thread tests don't rely on floating point
  • thread: allow thread_sleep1 to run without floating point
  • thread: allow some tests to run on ports with not much heap
  • meminfo: update for addition of "max free sz" output
  • run-tests: If running thread tests on unix, don't run mutate ones

unix port:

  • unbreak "minimal" target by disabling FatFs
  • mpconfigport_minimal.h: clearly mark where user-define config ends
  • deprecate support for GNU Readline (MICROPY_USE_READLINE=2)
  • time to build with --gc-sections
  • move "utime" module config to C level instead of make level
  • Makefile: libffi: Build with -Os
  • alloc: add option to use uPy's alloc-exec implementation even for libffi
  • alloc: make coverage build and its overzealous warnings happy
  • disable FatFs VFS for normal build, keep enabled for coverage
  • modmachine: include PinBase class
  • modmachine: enable time_pulse_us() function
  • fix Makefile to handle gc-sections linker flags on Mac OS
  • add basic thread support using pthreads
  • file: if write syscall returns because of EINTR then try again
  • implement garbage collection with threading
  • mpthreadport: use SA_SIGINFO for GC signal handler
  • gccollect: provide declaration of exported function
  • mpthreadport: suppress compiler warning about unused arguments
  • modtime: release the GIL when sleeping
  • enable btree module
  • Makefile: make "minimal" build be minimal again
  • mpconfigport_minimal.h: allow to print a string within 1KB of heap
  • main: error out on unknown value of suffix in -X heapsize= option
  • main: improve help for -X options a bit
  • main: when preparing sys.path, allocate exact strings on uPy heap
  • disable the GIL to improve performance of non-thread code

windows port:

  • follow unix port changes regarding "utime" module
  • msvc: include machine_pinbase.c in build and enable umachine module

stmhal port:

  • add board definition files for Olimex STM32-E407
  • port of f4 hal commit 1d7fb82 to l4 hal (SD card modifications)
  • correct DMA to allow SD card on L4 MCUs
  • enable SD card on L4 MCUs

cc3200 port:

  • update FreeRTOS to v9.0.0
  • define our own FreeRTOS heap so it can go in a special segment
  • add basic threading capabilities
  • fix call to new exception to be _msg instead of _arg1
  • use xTaskCreateStatic instead of osi_TaskCreate
  • mpthreadport: make mutex statically allocated
  • mpthreadport: properly initialise the main thread's data
  • gccollect: use MP_STATE_THREAD(stack_top) to get top of stack
  • mpthreadport: scan more root pointers from thread data
  • mpthreadport: move mem alloc outside the thread_mutex lock
  • enable the GIL
  • in FreeRTOSConfig.h, comment on configSUPPORT_STATIC_ALLOCATION
  • remove .boot section attribute from osi_TaskCreate function
  • start the simplelink spawn task using the static task creator
  • shrink the FreeRTOS heap and place TCB+stack in freed location
  • allow to compile bootloader with threading enabled
  • remove obsolete singleton heart-beat object

teensy port:

  • update the README with OSX specific information and tips

esp8266 port:

  • modnetwork: use struct bss_info::ssid_len for ESSID length
  • let RTC work correctly after deepsleep
  • switch floating-point arith routines to BootROM
  • Makefile: enable --verify option for esptool.py write_flash
  • use RTC to set date & time stamps for files
  • main.c: clear the command line history when (re)booting
  • enable frozen bytecode, with scripts in modules/ subdir
  • README: describe how to build mpy-cross
  • websocket_helper.py: avoid extra string allocations
  • websocket_helper.py: fix typo in debug output
  • modpybuart: allow setting baudrate and other params
  • explicitly collect garbage in bootstrap scripts
  • switch webrepl_setup to use frozen bytecode
  • switch webrepl to use frozen bytecode
  • README: promote from "highly experimental" to "experimental"
  • main: init recently added dupterm_arr_obj port state var
  • esp_mphal: call_dupterm_read: Use readinto() method
  • esp_mphal: properly handle dupterm EOF after switching to readinto()

qemu-arm port:

  • disable gcc LTO option for nlrthumb.c

docs:

  • esp8266/tutorial/network_basics: minor typo fix, ap becomes ap_if
  • add link to PDF version of docs in sidebar
  • library/network: wipy: fix literal block indentation
  • esp.socket: remove unused file
  • ure: typo fix
  • usocket: there must be empty line after .only::
  • library/machine.Pin: mention GPIO and cross-link .value() function
  • machine.*: add "currentmodule:: machine" directive
  • pyb.*: add "currentmodule:: pyb" directive
  • machine.Pin: remove explicit target
  • machine.UART: cleanup pyboard section
  • machine.*: use proper class case in method headers
  • machine.Pin: add class designator to all constants
  • pyb.CAN: mark CAN.initfilterbanks() as classmethod explicitly
  • pyb.Pin: af_list() is a normal method, not a class method
  • pyb.ExtInt,pyb.Pin: mark up class methods as such
  • pyb.*: use proper class case in method headers
  • pyb.Pin: sort .af() and .af_list() methods together
  • builtins: enumerate all builtin functions implemented
  • library/index: add builtins.rst
  • machine.Pin: disambiguate object call method
  • machine*: remove explicit targets and "machine." prefixes on classes
  • uctypes: improve documentation
  • sys: detailed description of print_exception() diff from traceback module
  • add sphinx_selective_exclude extension suite
  • conf.py: active sphinx_selective_exclude extensions
  • rebuild docs from scratch, as required for proper only:: handling
  • select: add an article
  • sys: print_exception: Fixes/clarifications
  • conf.py: exclude cmath from modindex for wipy
  • library: fix typo in docs for usocket.listen()

examples:

  • unix/ffi_example.py: update for current "ffi" module API
  • unix/ffi_example.py: remove TODO, make output more clear
2016-07-10 19:46

内容可能含有违规信息

2016-06-03 22:45

First general release of ESP8266 port, and support for frozen bytecode

This release marks the first general release of official ESP8266 support
within the MicroPython code base. The ESP8266 port has many improvements
and additions, including: websocket and webrepl modules, deep-sleep mode,
reading on UART, enhanced I2C support, enhanced network configuration,
full sequence of start-up scripts (built-in _boot.py, boot.py and
main.py), improved filesystem support with automatic flash-size detection
as well as documentation and a tutorial.

Known issues with ESP8266 port are:

  • Basic SSL support is available but it works only with relatively short
    data lengths (a few kilobytes).
  • WebREPL over SSL is not supported.
  • Only 5 or so WebREPL sessions in succession can be started (including
    file transfer sessions), after that the board requires a hard reset.
  • File transfer over WebREPL has issues with large files (above a few
    tens of kilobytes).
  • By design, only one concurrent WebREPL connection is supported.
  • Soft reset doesn't reset the network stack.

In addition to ESP8266 support, this release brings frozen bytecode
which allows to compile bytecode offline and link it into the firmware,
completely eliminating the need for compilation (and the associated
RAM usage) at runtime. Basic async/await syntax is now supported, and
qstrs are now auto-generated in the build system.

A detailed list of changes is given below.

README:

  • explicitly point to required dependencies section
  • promote "docs" and "tests" to "major components"
  • mention support "async" keyword from Python 3.5

ACKNOWLEDGEMENTS:

  • add list of 842 backers from the ESP8266 campaign

py core:

  • modbuiltins: add comment about setting "_" special var
  • add async/await/async for/async with syntax
  • fix constant folding and inline-asm to work with new async grammar
  • emitglue: move typedef of mp_raw_code_t from .c to .h file
  • emitglue: make mp_raw_code_t* arguments constant pointers
  • makeqstrdata: factor out some code to functions that can be reused
  • add ability to have frozen persistent bytecode from .mpy files
  • makeqstrdata: add more names for escaped chars and esc non-printable
  • simplify "and" action within parser by making ident-rules explicit
  • makeqstrdata: fix rendering of qstrs that have non-printable ASCII
  • makeqstrdata: add special case to handle \n qstr
  • declare help, input, open builtins in core
  • map: change hash-table allocation policy to be less aggressive
  • makeqstrdefs: add script to automate extraction of qstr from sources
  • frozenmod: pass the source name of the frozen module to the lexer
  • rework QSTR extraction to work in simple and obvious way
  • divide "split" and "cat" phases of qstr extraction for better efficiency
  • fix bug passing a string as a keyword arg in a dict
  • move call_function_*_protected() functions to py/ for reuse
  • makeqstrdefs.py: windows compatibility
  • obj.h: when constructing a small-int cast to mp_uint_t for bit-shift
  • emitnative: use MP_OBJ_NEW_SMALL_INT instead of manual bit shifting
  • vm: "yield from" didn't handle MP_OBJ_STOP_ITERATION optimization
  • modio: rename module name to "uio" for consistency with other modules
  • modcollections: rename module name have "u" prefix for consistency

extmod:

  • add initial framebuf module
  • add generic machine.I2C class, with bit-bang I2C
  • machine_i2c: fix I2C reading by sending ack/nack at end of byte
  • machine_i2c: implement I2C memory reading/writing
  • moduos_dupterm: don't swallow exceptions in dupterm's read()/write()
  • modlwip: lwip_tcp_receive(): Properly handle EOF for non-blocking sock
  • modlwip: more debug messages for various edge conditions
  • fsusermount: in mount/mkfs, deregister VFS object on error
  • modlwip: lwip_tcp_send(): full error handling
  • modlwip: lwip_tcp_receive(): full error handling
  • modlwip: add ability to run callback on "recv" and "accept" events
  • machine_i2c: allow mp_hal_pin_obj_t to be any type, not a ptr
  • modlwip: protect recv/accept Python callback against exceptions
  • modlwip: workaround esp8266 sendto issue where 1 is returned
  • modlwip: add print_pcbs() debug function
  • modwebsocket: handle CLOSE control frame
  • modussl: throw Python exceptions in case of errors
  • modussl: support server-side SSL sockets
  • modussl: SSL_OK from ssl_read() means "no user data so far"
  • modwebrepl: module to handle WebREPL protocol
  • modwebrepl: initial implementation of "get file" operation
  • modwebrepl: keep reading data when there's something to read
  • modwebrepl: GET_FILE: Send length-prefix chunk with one write()
  • modwebrepl: add rate-limiting workaround for broken network drivers
  • modwebrepl: set debugging by default to off
  • modwebrepl: add support for password
  • modlwip: implement sendall() method for TCP sockets
  • fix typo of macro that detects if float is enabled

lib:

  • utils/printf: rework overriding printer of DEBUG_printf()
  • utils/pyexec: condition-out GC calls from pyexec
  • utils/pyhelp: extract implementation of help(obj) to a library function
  • axtls: update to the latest upstream, fix reported MacOSX build issue

drivers:

  • add SSD1306 OLED driver, with I2C and SPI interfaces

tools:

  • mpy-tool.py: new tool to work with .mpy files; currently it can freeze them
  • mpy-tool.py: add support for Python 2.7

tests:

  • add 6 tests for async await/for/with
  • add .exp files for async tests, so they can run with Python 3.4
  • fix dict1.py so it doesn't rely on the order of dict elems
  • extmod: move split-on-empty-match tests to a separate test file
  • add testcase for yielding from a stopped generator
  • run-bench-tests: process tests in alphabetical order
  • update for _io/_collections module having been renamed

minimal port:

  • add example of frozen persistent bytecode (.mpy file)
  • disable async/await syntax

unix port:

  • build with MICROPY_PY_UHASHLIB_SHA1 if already building with axTLS
  • make sure build dir exists before accessing it for freezing upip
  • Makefile: make install more compatible (BSD, etc.)

windows port:

  • msvc: implement automatic qstr generation using makeqstrdefs

stmhal port:

  • implement basic C-level pin HAL
  • use new generic I2C object in machine module
  • enable framebuf module
  • properly handle RTS/CTS flow control for buf/unbuf transfers
  • add Makefile option FROZEN_MPY_DIR to support frozen bytecode
  • for frozen bytecode generation, add dependency of qstr file
  • l4: add CMSIS files to support STM32L476
  • l4: add basic STM32L4xx HAL files
  • l4: adapt UART HAL to avoid 64-bit integer division
  • update HALCOMMITS due to change to hal
  • l4: add board definition files for STM32L476DISC
  • l4: add line to Makefile for building L4 series
  • l4: modify adc.c to add support for STM32L4 series
  • l4: modify uart.c to support L4 MCU
  • l4: modify usbd_conf.c to support L4 MCU
  • l4: modify rtc.c to support L4 MCU
  • l4: modify timer.c to support L4 MCU
  • fix machine.unique_id() function to work for all MCUs
  • l4: modify mphalport to support L4 MCU
  • l4: modify flash.c and storage.c to support L4 MCU
  • l4: add support for external interrupts/events
  • accel: raise an exception if the accel couldn't be initialised
  • use pyhelp_print_obj function
  • change i2c.scan() method to scan addresses 0x08-0x77
  • fix typo of macro that detects if float is enabled

cc3200 port:

  • use pyhelp_print_obj function
  • change i2c.scan() method to scan addresses 0x08-0x77
  • disable async/await syntax

esp8266 port:

  • enable websocket module
  • modnetwork: .config(): Check interface whose config is requested
  • modnetwork: .config(): Add "authmode" param
  • modnetwork: .config(): Add "password" param (W/O)
  • add Python modules for initial configuration
  • scripts/inisetup.py: set WPA/WPA2 AP mode with a predefined password
  • protect modpyb.h header file from multiple inclusions
  • implement basic C-level pin HAL
  • switch from using custom I2C driver to generic extmod one
  • enable framebuf module
  • in callback helpers, pop nlr_buf on successful call
  • esp_mphal: don't swallow exceptions in dupterm's read()/write()
  • esp_mphal: call_dupterm_read(): Fix order of deactivating on EOF
  • remove pin_id field from C pin object
  • add dummy entries for non-existing pins to simplify pin logic
  • add hard IRQ callbacks for pin change on GPIO0-15
  • separate 1-wire timing funcs from Python module to save iRAM
  • switch integer arith routines to BootROM
  • scripts/port_diag.py: module to collect diagnostic info
  • enable input() builtin
  • scripts/_boot: mount block device on "" instead of "/"
  • moduos: add uos.mkdir function
  • modmachine: add reset_cause() function
  • adapt port to use new auto-qstr generation
  • moduos: add dupterm_notify() function
  • esp_mphal: protect dupterm_task_handler() from recursive exec
  • README.md: update feature list for current state of affairs
  • modesp: allow esp.deepsleep to take 2nd arg for RF wake opt
  • scripts/flashbdev: use all available space in 1MB FlashROM for FS
  • modesp: add flash_size() function
  • scripts: don't try to create filesystem on 512KB devices or less
  • modnetwork: .config(): Add "channel" param
  • scripts/flashbdev: disable debug output/checks
  • scripts/_boot: print notice when initial setup is executed
  • scripts/flashbdev: correct bootloader flash size to match real size
  • modnetwork: .config(): Add "hidden ESSID" param
  • implement basic deep-sleep capabilities
  • add uart_rx_wait and uart_rx_char functions
  • implement UART.read functionality
  • uart: remove obsolete UART rx buffering code
  • esp_mphal: remove mp_hal_feed_watchdog
  • convert mp_hal_pin_obj_t from pin ptr to simple integer
  • allow GPIO16 to be used as a pin in the uPy pin HAL
  • change software SPI driver to use general pin HAL
  • scripts/websocket_helper: module encapsulating handshake sequences
  • scripts/websocket_helper: disable debug output
  • scripts/webrepl: webREPL based on C-level websocket object
  • scripts/webrepl: convert to persistent daemon
  • scripts/webrepl: don't start on import
  • scripts/webrepl: allow to override port
  • scripts/webrepl: print connection address
  • scripts/webrepl: print client address for incoming connections
  • scripts/flashbdev: use all available Flash for filesystem
  • scripts/webrepl: add "ws://" to "daemon started at" message
  • Makefile: add target to build axTLS
  • esp8266.ld: put axTLS to FlashROM
  • Makefile: override abort() when building axtls
  • axtls_helpers: helper/wrapper functions for axTLS
  • tests/onewire.py: don't run test on import
  • Makefile: support linking with axTLS built from source
  • Makefile: enable "ussl" module; axTLS should be built first using "make axtls"
  • move pyb.info() function to esp module and remove pyb module
  • move onewire.py, neopixel.py drivers from tests/ to scripts/
  • scripts/onewire.py: simplify and improve 1-wire driver
  • scripts/neopixel.py: remove test function from neopixel driver
  • set suitable values for axtls's RT_MAX_PLAIN_LENGTH & RT_EXTRA
  • README: add recently required step of 'make axtls'
  • modnetwork: make WLAN.ifconfig() read/write
  • help: implement help() builtin
  • help: add cheatsheet for basic WiFi configuration
  • enable WebREPL file transfer rate limiting
  • enable webrepl module
  • scripts: move all of initial setup to inisetup module
  • scripts/inisetup: create default boot.py in filesystem
  • scripts/webrepl: connection ack prompt is now printed by modwebrepl
  • scripts/webrepl: switch to using _webrepl object wrapper
  • scripts/webrepl: add "first connection" mode to setup password
  • README: mention WebREPL
  • Makefile: be sure to pass cross-compiling AR when building axtls
  • scripts/webrepl_setup: reject too short passwords
  • change platform name from ESP8266 to esp8266
  • modnetwork: remove deprecated wifi_mode()
  • esp_mphal: add ets_esf_free_bufs(), etc. functions
  • modesp: add esf_free_bufs() debugging function
  • modesp: add malloc() and free() functions
  • scripts/inisetup: enable WebREPL auto-start on boot
  • modnetwork: remove .mac() method, move to .config("mac")
  • scripts/inisetup: update for nic.mac() method being gone
  • scripts/neopixel.py: swap red and green in pixel accessor
  • modpybpin: use enum+array instead of struct for parsing args
  • modpybpin: use None instead of PULL_NONE for no-pull config
  • modpybpin: make pin.irq() methods take keyword args
  • tutorial: mention that esptool is available via pip
  • scripts/ntptime: add simple NTP client

docs:

  • esp: enumerate flash access functions
  • machine: start to update for esp8266 port
  • speed_python: clarify/generalize "Buffers" subsection
  • speed_python: generalize "Floating point" subsection
  • speed_python: add many more details on memoryviews
  • machine: reset_cause() has been implemented for esp8266
  • topindex.html: esp8266: Enable quickref/general on the main page
  • esp8266/general: start "General information" for esp8266
  • esp8266: add info about using deep-sleep mode to quickref
  • esp8266/tutorial: add tutorial placeholder page
  • ustruct: there's no complete "struct" module, only "ustruct" subset
  • esp8266: include usocket module reference
  • library/usocket: add link to CPython's socket module
  • usocket: socket-specific exceptions are for WiPy only
  • usocket: socket.IPPROTO_SEC is WiPy-specific
  • usocket: describe address format once at the beginning
  • network: esp8266: scan(): add note that bssid is bytes object
  • library: group MicroPython-specific modules under separate heading
  • library/index: move WiPy "micro-libraries" under corresponding heading
  • library/index: esp8266 has the same set of stdlibs as pyboard/unix
  • module "time" is actually "utime"
  • library/index: make single section for "micro-ified" modules
  • library/index: order sections from the most to least standard modules
  • Makefile: default BUILDDIR based on MICROPY_PORT
  • library: "os" module is actually "uos"
  • fix uos and utime heading underlines to be the correct length
  • library/utime: add more time functions for unix and esp8266 ports
  • utime: describe time() peculiarities in MicroPython
  • utime: describe sleep() peculiarities in MicroPython
  • library: consistently use admonitions for CPython differences
  • ubinascii: clean up grammar
  • network: esp8266: Add wlan.ifconfig() method
  • network: esp8266: Describe wlan.config() method
  • make the short port names in the port/version sidebar lowercase
  • esp8266: update quickref to reflect changes to 1-wire and NeoPixel
  • library/utime: elaborate on epochs and calendar time maintenance
  • esp8266/quickref: add info about WebREPL
  • ustruct: document pack_into(), unpack_from()
  • sys: document sys.modules
  • ustruct: fix argument formatting
  • sys: remove port-specific details from description of stdin/out/err
  • sys: clarify description of sys.exit()
  • sys: clean up print_exception() description
  • sys: describe sys.implementation
  • sys: describe sys.maxsize
  • sys: describe sys.platform is port-neutral manner
  • add _collections module reference
  • add _io module reference
  • _io and _collections were renamed to have standard "u" prefix
  • library/machine.I2C: update to reflect ESP8266 implementation
  • esp8266/general: webREPL is described in quickref for now
  • esp8266/general: add more points to "Multitude of boards" section
  • esp8266/general: fix list formatting
  • esp8266/general: add techspec section
  • esp8266/general: add "Boot process" section
  • esp8266_contents: reference general and tutorial docs
  • network: esp8266: MAC address is set via .config() method
  • esp8266: add ESP8266 tutorial
  • machine: generalize docs from just WiPy to other ports
  • machine: move WiPy-specific hardware details to its general reference
  • machine: more generic description of sleep's, WiPy details to its genref
  • machine: idle() description generalization
  • library/machine.Pin: update pin docs to reflect ESP8266 support
  • esp8266/tutorial: update pins tutorial to reflect changes in API

examples:

  • http_server_ssl.py: add HTTPS server example
2016-05-04 00:32

New MicroPython cross-compiler, and vastly improved ESP8266 port

This release adds the MicroPython cross-compiler that can generate .mpy
files (pre-compiled bytecode) which can be executed within any
MicroPython runtime/VM. The ESP8266 port is also vastly improved thanks
to a hugely successful Kickstarter campaign. This port now has an
alternative event loop implementation to allow proper Berkeley sockets
using lwIP built from source, and a greatly improved network module.
Many extension modules are now enabled (ujson, ubinascii, uctypes,
uhashlib, urandom, uheapq, ure, uzlib) and the machine module includes
Timer, Pin, PWM, ADC, I2C, SPI, and basic UART. Bignums are supported,
along with 30-bit precision floating point, and normal error messages.
There is FatFS support and uos.dupterm.

Many other improvements and bug fixes have been made to the core and
other ports. The basic test suite can now run within a 16k heap. Inline
assembler functions now support 4 arguments. The Unix port has the -i
option to start the REPL after a script is finished. The stmhal port now
exposes the flash and SD card as proper objects with the block protocol.
There is support for generic STM32F439 boards, the NUCLEO-F411RE board,
and targets to deploy via ST-LINK and OpenOCD.

py core:

  • mpprint: fix sign extension when printf'ing %u, %x and %X
  • vm: fix popping of exception block in UNWIND_JUMP opcode
  • objstr: for str.format, add nested/computed fields support
  • objstr: for str.format, don't allocate on the heap for field name
  • extend native type-sig to use 4 bits, so uint is separate to ptr
  • mpz: complete implementation of mpz_{and,or,xor} for negative args
  • mpz: add commented-out mpz_pow3_inpl function, to compute (x**y)%z
  • viper: allow casting of Python integers to viper pointers
  • viper: allow uint as index to load/store, and give better error msg
  • objarray: implement "in" operator for bytearray
  • mpstate.h: fs_user_mount is now standard, reusable uPy functionality
  • asmx64: add helper macro for generating REX_[WRXB] bits from a reg64
  • asmx64: support all 16 regs in reg to memory move instructions
  • emitnative: add check that RHS of viper store is of integral type
  • repl: check for an identifier char after the keyword
  • vm: add macros to hook into various points in the VM
  • parse: use m_renew_maybe to ensure that memory is shrunk in-place
  • malloc: provide a proper malloc-based implementation of realloc_ext
  • emitinlinethumb: use qstrs instead of char* for names of asm ops
  • add MICROPY_DYNAMIC_COMPILER option to config compiler at runtime
  • stackctrl: add mp_stack_set_top() to explicitly set stack top value
  • emitglue: get persistent bytecode working on Linux ARM platform
  • objboundmeth: allocate arg state on stack if heap alloc fails
  • use MP_SMALL_INT_POSITIVE_MASK to check if uint fits in a small int
  • fix passing of some wide int types to printf varg format list
  • objarray: fix array slice assignment when array is reallocated
  • formatfloat: fix buffer overflow when formatting tiny numbers
  • objfun: allow inline-asm functions to be called with 4 arguments
  • frozenmod: allow port to override lexer to use for frozen modules
  • parse: don't allocate an extra parse node for power exponent
  • parse: when looking up consts, check they exist before checking type
  • stream: add mp_stream_writeall() helper function
  • stream: fix object vs ptr usecase in mp_stream_writeall()
  • modio: initial implementation of io.BufferedWriter class
  • modio: implement io.BufferedWriter.flush()
  • modio: io.BufferedWriter: describe flushing policy
  • formatfloat: fix case of float format where leading digit was "10"
  • formatfloat: fix further cases of buffer overflow in formatting
  • parsenum: use pow function to apply exponent to decimal number
  • ringbuf.h: add reusable ring buffer class
  • map: prevent map resize failure from destroying map
  • move stream-related declarations from obj.h to stream.h
  • combine continuous block of emit steps into with_cleanup emit call
  • implement basic with support in native emitter
  • objarray: fix array.append so it doesn't extend if append fails
  • stream: add bigger inventory of stream ioctl's
  • stream: add Python-level ioctl() method

extmod:

  • update uzlib to 1.2.2
  • fsusermount: introduce separate mkfs() function
  • fsusermount: implement separate umount() function
  • fsusermount: change block protocol to support ioctl method
  • modmachine: truncate integers that are to be stored using mem*
  • fsusermount: expose umount as a public function
  • fsusermount: support mounting of multiple block devices
  • vfs_fat: object-oriented encapsulation of FatFs VFS
  • vfs_fat_diskio: reusable FatFs module, move from stmhal/diskio
  • vfs_fat_file: reusable FatFs module, move from stmhal/file
  • vfs_fat_ffconf: reusable FatFs module, move from stmhal/ffconf
  • vfs_fat: move listdir() method from stmhal for reuse
  • vfs_fat: add .remove() method
  • vfs_fat: add .mkdir() method
  • vfs_fat: add fat_vfs_import_stat(), reusable import stat routine
  • vfs_fat: add .rename() method
  • vfs_fat: add lexer, move from stmhal port for reuse
  • vfs_fat_lexer: make conditional on FatFs support enabled
  • modlwip: add .print() method
  • modlwip: implement dummy setsockopt()
  • modlwip: add stream protocol read method
  • modlwip: add dummy .makefile() method
  • modlwip: add stream .read() and .readline() methods
  • modlwip: check for state change during recv busy-wait loop
  • modlwip: still process remaining incoming data of a closed socket
  • modlwip: add .write() stream method
  • modlwip: support non-blocking recv()
  • modlwip: factor out "socket connected" check to a function
  • modlwip: use MICROPY_EVENT_POLL_HOOK for event polling if defined
  • modlwip: rework getaddrinfo() data passing
  • modlwip: add socket.setblocking() method
  • modlwip: lwip_tcp_receive: Properly map lwIP error to POSIX errno
  • uctypes: use mp_binary_get_val helper when extracting value
  • uctypes: finish support for FLOAT32 and FLOAT64 types
  • modwebsocket: start module for WebSocket helper functions
  • modwebsocket: implement read support
  • modlwip: add SOL_SOCKET and SO_REUSEADDR constants for setsockopt()
  • modlwip: implement setsocketopt(SO_REUSEADDR)
  • modlwip: lwip_tcp_send: handle properly send buffer full condition
  • modlwip: add lwip->POSIX error map for lwIP 1.4.0
  • modlwip: lwip_socket_setsockopt: handle option value properly
  • vfs_fat_diskio: actually support sectors != 512 with Python blockdevs
  • modwebsocket: properly check number of args to constructor
  • modure: re_exec() renamed to ure_exec() due to collison in 4.3BSD
  • modwebsocket: make sure to propagate EOF
  • modwebsocket: reset mask between packets
  • modwebsocket: add option for blocking writes to non-blk sockets
  • modwebsocket: record current fragment type (binary/text/etc.)
  • modwebsocket: allow to get type of last read data using ioctl()
  • modwebsocket: implement MP_STREAM_SET_DATA_OPTS ioctl
  • modwebsocket: split websocket-related defines for reuse
  • modlwip: fix for loss of data in unaccepted incoming sockets
  • modwebsocket: support write size beyond 125 bytes

lib:

  • fatfs: add support for sector sizes larger than 512 bytes
  • axtls: update to the latest upstream master

drivers:

  • sdcard: add support for multi-block read/write; add SD test

tests:

  • open_plus: add tests for "r+", "w+" open modes
  • pyb: add simple test for stm module on pyboard
  • run-tests: add esp8266 target
  • bytearray1: add testcases for "in" operator
  • vfs_fat_ramdisk: add test for VfsFat
  • vfs_fat_ramdisk: switch to ioctl-based blockdev API
  • vfs_fat_ramdisk: allow to override sector size
  • vfs_fat_ramdisk: skip test if can't allocate ramdisk
  • skip uctypes and urandom tests not supported byt the WiPy
  • vfs_fat_ramdisk: add .listdir() testcase
  • vfs_fat_ramdisk: add testcase for .remove()
  • vfs_fat_ramdisk: add testcase for .mkdir()
  • vfs_fat_ramdisk: allow to run in native mode (don't use "with")
  • vfs_fat_ramdisk: add testcase for .rename()
  • reduce large object allocations so tests can run with small heap
  • print_exception: use exception which prints the same regardless of config
  • recursive_iternext.py: make low-heap friendly
  • run-tests: simplify handling of newline in output from tests
  • run-tests: add cmd line option "--heapsize"
  • split large tests into smaller files, to run with a small heap
  • add new subdir "stress/" specifically for stress tests
  • add a test for argument passing to inline-asm functions
  • add test for io.BufferedWriter
  • wipy: add Timer class tests
  • float2int_fp30: variant of float2int for 30-bit stuffed float
  • string_format_fp30: variant of string_format for 30-bit stuffed float

mpy-cross:

  • add new component, a cross compiler for MicroPython bytecode
  • give a more sensible error message when file doesn't exist
  • remove setting of MICROPY_FORCE_32BIT=1 from Makefile

unix port:

  • file: stop assuming that O_RDWR == O_RDONLY | O_WRONLY
  • enable VfsFat support
  • enabled importing of persistent bytecode (.mpy files)
  • modsocket: add comment regarding close() error checking (which is none)
  • unix_mphal: hack to make uos.dupterm() actually work
  • implement -i option (inspect - start REPL after script is finished)
  • file: parse "buffering" argument of open() builtin
  • file: "encoding" arg to open() isn't kw-only
  • djgpp errno.h have no ENOTSUP, so define it to Linux value
  • freedos: strip and size names for binaries

stmhal port:

  • diskio: introduce MICROPY_HW_HAS_FLASH setting
  • move stmhal-specific FatFs routines/structs to fatfs_port.c
  • file: recast as "FatFs file" class, to support other VFS types
  • file: for self-contained usecase, don't define global types
  • improve NUCLEO-F401RE build, with UART2 as REPL
  • expose flash and SD card as proper objects with block protocol
  • add mount/umount/mkfs to os module
  • add a function for setting the pin alternate function
  • NUCLEO 401 - Add a bunch of missing pins and reorder the pins
  • CERB40 - Add pins defines for I2C3
  • NUCLEO 401 - Add definitions for I2C2 and I2C3
  • diskio: add provision for default returns for ioctl INIT/SEC_SIZE
  • improvements to the STM32F4DISC UART config settings
  • enabled importing of persistent bytecode (.mpy files)
  • make SPI use mp_hal_gpio_set_af
  • switch from dfu-util to tools/pydfu.py for default deploy method
  • add stmhal-specific README.md with extra details for this port
  • add makefile target to deploy stmhal build via ST-LINK
  • add support for generic STM32F439 board (non DISCO)
  • add makefile target and configuration to deploy via OpenOCD
  • add board definition files for NUCLEO_F411RE
  • rename STM32F401NUCLEO to NUCLEO_F401RE
  • NUCELO_F401RE cleanup
  • consistently enable USB SOF Irqs for all USB modes (FS and HS)

qemu-arm port:

  • reinitialise uPy heap and runtime at start of each test
  • enable builtin override feature, and enable more tests

cc3200 port:

  • add stmhal/builtin_open.c to build
  • fix breakage after VfsFat refactor
  • finally fix the Timer class API
  • improve robustness of the I2C driver
  • simplify the Timer API and correct the documents
  • fix "debug" build
  • improve robustness of WLAN during sleep modes
  • rename 'server' class to 'Server' for consistency
  • update WiPy software version to 1.2.0

esp8266 port:

  • modesp: implement flash_write(), flash_erase()
  • README: add hint about adding toolchain to PATH
  • modpybrtc: simplify multiplication by fixed-point value
  • switch bignum implementation from long-long to mpz
  • enable float support, using 30-bit stuffed floats
  • enable math module
  • allow Makefile's PORT variable to be overridden
  • change "soft reboot" message to work with pyboard.py
  • add network.ifconfig()
  • enable ujson, ubinascii, and uctypes modules
  • esp8266.ld: link in SDK version section
  • enable config settings helpful for debugging
  • enable uhashlib module
  • enable more features in mpconfigport.h
  • add mp_hal_delay_us function
  • add time.{sleep_ms,sleep_us,ticks_ms,ticks_us,ticks_diff}
  • reset "virtual RTC" on power on
  • modutime: support float argument to time.sleep()
  • add modmachine with mem* arrays
  • modmachine: basic implementation of Timer for OS virtual timers
  • modmachine: changing params of a timer requires disarming it first
  • etshal.h: add timer functions prototypes
  • modmachine: use etshal.h
  • modmachine: timer: Add ONE_SHOT and PERIODIC symbolic constants
  • add custom _assert() function
  • implement Pin.call() and Pin.OPEN_DRAIN mode
  • expose simple pin API at C level
  • modpybpin: add support for GPIO16
  • modmachine: add Pin class from modpyb
  • etshal.h: more prototypes of ESP8266 SDK/BootROM functions
  • support raising KeyboardInterrupt on Ctrl+C
  • uart: add uart_flush() function
  • allow Makefile's BAUD variable to be overridden
  • enable stack overflow checking
  • don't gc-collect BSS
  • enable modlwip
  • Makefile: add define for ESP8266 lwIP
  • put more code in iROM section
  • main: module to run on boot is "boot", not "main"
  • move pyb.freq to machine.freq
  • modnetwork: allow to configure STA and AP interfaces separately
  • move wifi_mode() and phy_mode() to network module
  • modnetwork: add per-interface .active() method
  • modnetwork: move config defines to the top
  • modnetwork: introduce interface .config() method
  • modnetwork: add symbolic names for network interfaces: STA_IF & AP_IF
  • add alternative event loop implementation
  • feed WDT in ets_loop_iter()
  • ets_alt_task: be sure to "pop" event before calling its handler
  • ets_alt_task: update for vendor SDK 1.5.0
  • esp_mphal: add higher-level event polling function
  • define MICROPY_EVENT_POLL_HOOK for the port
  • switch to lwIP built from source
  • store frozen modules in FlashROM
  • ets_alt_task: make FIRST_PRIO=0 to cover all task priorities
  • make mp_hal_delay_us work with new event framework
  • enable urandom module
  • add module weak link from json to ujson
  • enable more extmod's: uheapq, ure, uzlib
  • enable non-blocking stream support
  • add "socket" and "usocket" aliases for lwip module
  • enable auto-indent in REPL
  • expose pin object as a public structure for use as C pin API
  • add basic I2C driver, with init and writeto methods
  • modpybi2c: add missing include
  • clean up bit-bang I2C implementation
  • implement bit-bang I2C read, and add i2c.readfrom method
  • add onewire helper functions as C module
  • add tests/onewire.py as a driver and test code for ds18b20 dev
  • implement software SPI class
  • add PWM support
  • esppwm.c: fix IRQ handler prototype
  • put lexerstr32.o into FlashROM
  • put utils.o to FlashROM
  • link ADC class into machine module
  • add esp.neopixel_write function to bit-bang WS2812 data
  • tests: add neopixel.py test
  • put modpybi2c.o to FlashROM
  • set up UART handling task soon into init process
  • modesp: flash_write(): Writes in multiples of 4 bytes
  • modesp: flash_read(): Accept buffer to read to as a second argument
  • README: update for the current status of the port
  • enable FatFs support
  • esp8266.ld: put FatFs to FlashROM
  • deploy: Use --flash_size=8m option to esptool.py
  • moduos: add listdir() proxy for MP_STATE_PORT(fs_user_mount)[0]
  • moduos: factor out VFS method proxy helper
  • moduos: add os.remove(), proxying to VFS object
  • zero out fs_user_mount state on (soft) reset
  • support importing modules from filesystem
  • implement os.urandom function
  • add basic support for duplicating REPL output
  • enable uos.dupterm() method
  • esp_mphal: add support for debug UART-only output
  • let esp8266 "os" messages go to standard (REPL) UART
  • support synchronous wifi scanning
  • fix issue when current REPL line was garbage-collected
  • switch back to accumulating input data via ring buffer
  • implement input part of dupterm handling
  • reset term_obj on reboot
  • move PHY mode constants from modesp to modnetwork
  • disallow recursive calls to REPL
  • support dedicated REPL loop (aka pull-style)
  • switch to non event-driven REPL to support paste mode
  • uart: get ctrl-C working now that event-based REPL is disabled
  • use VM_HOOK to call ets_loop_iter within the VM
  • README: add link to docs
  • move .rodata where it belongs with -mforce-l32 help
  • bump iROM size to 512k
  • ets_alt_task: comment out debug output
  • minimize gap between Inst/DataRAM segments and FlashROM segment
  • switch back to flashing combined firmware (single file)
  • update flashing instructions in README
  • bump heap size to 24k
  • move pyb.hard_reset() to machine.reset()
  • move pyb.unique_id() to machine.unique_id()
  • modnetwork: require_if(): Report the actual interface required
  • make destination for vendor OS debug output soft-configurable
  • add initial implementation of machine.UART
  • README: add short troubleshooting section
  • switch from terse error messages to normal ones
  • implement multistage bootstrap sequence
  • add esp.freemem() and esp.meminfo() functions
  • implement mp_builtin_open() using vfs_proxy_call()

examples:

  • http_client.py, http_server.py aren't just unix, move to network/
  • http_client.py: improve CPython compatibility in stream mode
  • http_client.py: introduce main() function
  • http_server.py: refactor/simplify for Python 3.5
  • http_server.py: introduce main() function
  • http_server.py: bind to 0.0.0.0, to be accessible from other hosts
  • http_client_ssl.py: HTTPS client example

docs:

  • correct WiPy Timer docs
  • minor change to improve clarity in machine.Timer docs
  • add note on machine.Timer class regarding PWM output pins
  • correct machine.Timer code examples related to duty cycle
  • add esp8266 quick reference page, with basic info
  • esp8266: minor tweaks to quickref, Timer and I2C classes
  • add versions.html template and support code for a version sidebar
  • allow list of versions to be specified by environment variable
  • esp8266: fix indent errors, typos, and add info about REPL UART
  • update asm_thumb2_hints_tips re return type of asm funcs
  • update details on using ADCAll object for vref/vbat channels
  • add Python speed optimisation guide, including minimal viper ref
  • esp8266: update quick reference: i2c.readfrom and neopixel example
  • update asm tutorial, maximum number of allowed args is now 4
  • update pyb.I2C constructor to reflect changes in Pyboard Lite
  • mention that pyb.SPI constructor accepts "X" and "Y" arguments
  • update pyb.UART.any() to mention that it returns character count
  • topindex.html: refer to "pyb" module only for pyboard
  • add standard modules list for esp8266
  • network: esp8266: Update docs on WLAN constructor
  • more standard modules for esp8266
  • esp: remove getaddrinfo(), now in socket module as expected
  • esp8266/quickref: note that timers supported are virtual ones
  • esp8266/quickref: add note about GPIO16
  • esp8266: phy_mode() moved to network module
  • esp8266: esp.wifi_mode() replaced with network.WLAN.active()
  • esp8266: esp.mac() replaced with network.WLAN.mac()
  • correct pin interrupt example code for the WiPy
  • network: esp8266: status is WLAN object method
  • network: esp8266: .scan() is now synchronous and returns result list
  • update copyright notice
  • esp8266: esp.socket is deprecated, remove from docs
  • os: change wording to be a bit more port-neutral
  • machine: change wording to be a bit more port-neutral
  • ubinascii: document a2b_base64(), b2a_base64()
  • esp8266/quickref: add note about physical vs logical pin numbers
  • ubinascii: document non-standard "sep" argument to hexlify()
  • esp8266: Enable "machine" module docs
2016-04-11 19:18

IPv6 support in unix, bignum constant folding, urandom module, faster VCP

In this release there are many bug fixes and consolidation of previous
features. Constant folding in the parser can now operate on arbitrary
precision integers, and the inline assembler is no longer restricted to
using small-ints or 30-bits. The urandom module has been added with the
most useful random functions included. The uhashlib module now
implements SHA1. The Unix port supports IPv6. The stmhal port has much
faster USB VCP for board to PC transfers, and Timer(3) is now freed up
for general purpose use by the user.

py core:

  • frozenmod: make frozen module content be 0-terminated
  • frozenmod: store frozen module names together, to quickly scan them
  • use polymorphic iterator type where possible to reduce code size
  • make dir report instance members
  • implement dict for instances
  • objstr: in str.format, handle case of no format spec for string arg
  • parse: optimise away parse node that's just parenthesis around expr
  • change mp_obj_int_is_positive to more general mp_obj_int_sign
  • parse: improve constant folding to operate on small and big ints
  • inlinethumb: allow assembler to use big ints as args to instructions
  • inlinethumb: remove 30-bit restriction on movwt instruction
  • viper: truncate viper integer args so they can be up to 32-bit
  • emitglue: add more feature flags to .mpy persistent bytecode output
  • mpz: fix conversion of float to mpz so it works on big endian archs
  • objint: fix classification of float so it works for OBJ_REPR_D
  • change type of .make_new and .call args: mp_uint_t becomes size_t
  • change type signature of builtin funs that take variable or kw args
  • change first arg of type.make_new from mp_obj_t to mp_obj_type_t*
  • emitglue: use mp_obj_is_float instead of MP_OBJ_IS_TYPE
  • use new code pattern for parsing kw args with mp_arg_parse_all
  • add ustruct.pack_into and unpack_from
  • modmicropython: add stack_use, heap_lock and heap_unlock functions
  • inlineasm: add ability to specify return type of asm_thumb funcs
  • runtime: mp_stack_ctrl_init() should be called immediately on startup
  • formatfloat: add ability to format doubles with exponents > 99
  • builtin property: accept keyword arguments

extmod:

  • moduos_dupterm: make uos.dupterm() implementation reusable
  • moduos_dupterm: make mp_uos_dupterm_tx_strn() function reusable
  • moduos_dupterm: handle exceptions in call to dupterm's .write()
  • fix uctypes size calculation for bitfields
  • modurandom: add "urandom" module
  • modurandom: make yasmarang() function static
  • modurandom: add some extra random functions
  • moduhashlib: add support for SHA1 (based on axTLS)
  • moduhashlib: use MICROPY_PY_UHASHLIB_SHA1 config define
  • moductypes: implement assignment for scalar array

tests:

  • uctypes: test item assignment for scalar arrays
  • object_dict.py: add test for obj.dict
  • allow float tests to run when MATH_SPECIAL_FUNCTIONS is disabled
  • fix math_fun_special test so it passes with single prec float
  • remove builtin_dict test
  • add some tests for urandom module
  • update pyboard LED test
  • for pyboard, add test for I2C error handling and recovery

minimal port:

  • add enough code to run minimal build on STM32F4xx hardware

unix port:

  • unix_mphal: handle exceptions in call to dupterm's .read()
  • unix_mphal: be sure to wrap dupterm code with MICROPY_PY_OS_DUPTERM
  • modtime: strftime(): Support 2nd argument, but as time_t value
  • add socket.inet_ntop function
  • allow to build coverage build with OBJ_REPR_D
  • add option to build 64-bit NaN-boxing interpreter
  • modffi: allow to compile modffi in OBJ_REPR_D mode
  • modsocket: accept(): Make IPv6-clean
  • modsocket: sockaddr(): Handle AF_INET6 addresses

windows port:

  • enable urandom module

stmhal port:

  • make stm constants big ints when they don't fit in a small int
  • remove custom mod_machine_mem_get_{read,write}_addr functions
  • add os.statvfs
  • add support for building frozen files
  • add support for the STM32F401NUCLEO board
  • make USB CDC driver use SOF instead of TIM3 for outgoing data
  • make TIM3 available for use by the user
  • add PWM capability for LED(3) and LED(4) on pyboards
  • in HAL I2C driver, move DMA setup to after sending I2C address

docs:

  • fix readthedocs build by updating Latex params
  • set author as 'Damien P. George and contributors'
  • add link from pyboard switch tutorial to ISR rules document
  • include extra functions in time documentation for pyboard
  • several minor changes: network, pyb, ADCAll and inline asm
  • update to say that Timer(3) is free, and detail LED intensity

travis:

  • add unix NaN-boxing build to Travis builds
  • switch to Ubuntu 14.04 Trusty
2016-02-01 07:22

64-bit NaN-boxing, FreeDOS target, and PYBv1.1 and PYBLITEv1.0 boards

This release brings a new object model for 64-bit NaN-boxing on 32-bit
architectures, while allows double precision floating point numbers to
be used without allocating on the heap. Unix and Windows ports have
better handling of Ctrl-C, and there is now a FreeDOS target within the
unix Makefile. Windows (msvc) builds are now checked using Appveyor CI.
The stmhal port has new board config files for then next version of the
pyboard, PYBv1.1 and PYBLITEv1.0, as well as config files for the
STM32F429 discovery kit. There is now delayed RTC initialisation with
LSI fallback, and DMA support for the SD card. The DMA controllers are
turned off if DMA is idle for 100 msec or more, saving power.

py core:

  • mpconfig.h: allow to build without alloca() for ANSI C compliance
  • binary: make use of MP_ALIGN
  • asmx86: fix function definition to use int32_t instead of int
  • change mp_print_strn_t func type to use size_t for the str length
  • change qstr_* functions to use size_t as the type for str len arg
  • emit: change type of arg of load_const_obj from void* to mp_obj_t
  • make mp_setup_code_state take concrete pointer for func arg
  • use uintptr_t instead of mp_uint_t in MP_TAGPTR_* macros
  • gc: move away from using mp_uint_t, instead use uintptr_t and size_t
  • add MP_ROM_* macros and mp_rom_* types and use them
  • wrap all obj-ptr conversions in MP_OBJ_TO_PTR/MP_OBJ_FROM_PTR
  • add support for 64-bit NaN-boxing object model, on 32-bit machine
  • mpprint: printing of doubles is now supported (by uPy own routine)
  • gc: make GC block size be configurable
  • mpconfig: actually allow to override MICROPY_BYTES_PER_GC_BLOCK
  • fix function calls that have positional and a star-arg-with-iterator
  • modsys: implement sys.modules
  • make it easy to build without MICROPY_PY_BUILTINS_COMPLEX
  • add MICROPY_PY_BUILTINS_MIN_MAX, disable for minimal ports
  • add min/max "default" keyword argument
  • don't try to optimise for+range when args are not simple expressions
  • fix calling of parent classmethod from instance of subclass
  • add mp_get_stream_raise to factor out check for stream methods
  • mkrules.mk: don't pass COPT to linker
  • emitinlinethumb: add support for MRS instruction
  • make UNARY_OP_NOT a first-class op, to agree with Py not semantics
  • fix compiler to handle lambdas used as default arguments
  • modmath: add domain error checking to sqrt, log, log2, log10
  • objpolyiter: implement instance-polymorphic iterator type
  • gc: scan GC blocks as an array of pointers, not an array of objects
  • gc: for finaliser, interpret a pointer into the heap as concrete obj
  • gc: use size_t instead of mp_uint_t to count things related to heap
  • mpprint: implement %llu and %lld format specifiers for mp_printf
  • bc: use size_t instead of mp_uint_t to count size of state and args
  • qstr: use size_t instead of mp_uint_t when counting allocated bytes
  • qstr: change type of qstr from mp_uint_t to size_t
  • parse: replace mp_int_t/mp_uint_t with size_t etc, where appropriate
  • compile: use size_t or uintptr_t instead of mp_uint_t
  • parse: include stddef.h for definition of size_t
  • compile: simplify compilation of comprehension iterators
  • emitglue: add include of unistd.h for read function
  • add MICROPY_ENABLE_COMPILER and MICROPY_PY_BUILTINS_EVAL_EXEC opts
  • gc: when printing info, use %u instead of UINT_FMT for size_t args
  • obj: fix float constants for MICROPY_OBJ_REPR_C
  • mpprint: fix printing of 64bit integers for 64bit windows builds
  • objstr: make sure that b"%s" % b"foo" uses undecorated bytes value
  • objstr: applying % (format) operator to bytes should return bytes, not str
  • handle case of return within the finally block of try-finally
  • be more restrictive binding self when looking up instance attrs
  • map: add fast-path for hashing of map index when it is a qstr
  • gc: improve mark/sweep debug output
  • map: in map lookup, check for fixed map independent of ordered map
  • nlr: use single preprocessor symbol to check if building on Windows

extmod:

  • move fsusermount.c from stmhal for cross-port reuse
  • fsusermount: make configurable with MICROPY_FSUSERMOUNT
  • modmachine: use uintptr_t instead of mp_uint_t for address type
  • moductypes: set_aligned(): Handle INT64/UINT64
  • moductypes: sizeof operation depends on layout type of structure
  • moduhashlib: add namespace prefix for crypto-algorithms/sha256.h
  • modubinascii: add "separator" argument to hexlify()
  • modlwip: tcp_recv: Use more regular and responsive poll pattern
  • modlwip: mark some lwip_socket_obj_t's fields as volatile
  • modlwip: user proper field name and value names for socket state
  • modlwip: avoid magic numeric values in memcpy()
  • modlwip: use _ERR_BADF instead of magic number

lib:

  • utils/printf: apply workaround for static linking with uclibc
  • utils/printf: add vsnprintf alias for Clang
  • libm: allow math funcs to be used by non-Thumb archs
  • utils: add pyexec_frozen_module to load and execute frozen module

tools:

  • allow pyboard.py to work when boot.py prints things
  • add option to pyboard.py to wait for serial device to be ready
  • upgrade upip to 0.6.3; updated for _os -> uos builtin module rename
  • add C middle-processor to make builtin tables proper hash tables

tests:

  • run-tests: improve robustness of REPL tests
  • extra_coverage: update for sys.modules addition
  • run-tests: allow to skip complex tests if it's not compiled in
  • add min/max "default" agrument test
  • builtin_minmax: add testcase for lazy iterable (generator)
  • add test for "not" of a user defined class
  • add tests for %-formatting of bytes
  • add tests for stream IO errors
  • add test which demonstrates uctypes LITTLE_ENDIAN packing failure

unix port:

  • unix_mphal: use size_t instead of mp_uint_t in stdout_tx_strn decls
  • moduselect: fix bug in poll.poll() scanning loop
  • moduselect: poll.register(): Reuse freed entries in poll array
  • moduselect: support growing of poll array
  • modtime: sleep(): automatically restart after receiving EINTR
  • modtime: sleep(): return early if KeyboardInterrupt is pending
  • mpconfigport.h: for MICROPY_NO_ALLOCA=1, don't even include alloca.h
  • main: check pending exception at the end of code block execution
  • moduselect: register(): allow to call with duplicate file descriptor
  • modtermios: provide B57600 and B115200 constants only if defined
  • moduselect: implement "one-shot" flag for poll.poll()
  • rename "_os" module to "uos" for consistency with baremetal ports
  • move modmachine into unix directory
  • moduselect: make configurable with MICROPY_PY_USELECT
  • modtime: add strftime() function (only single argument is supported)
  • modos: implement ilistdir()
  • modos: allow to configure use of d_ino using _DIRENT_HAVE_D_INO
  • modos: add errno() function to get/set errno value
  • add FreeDos target
  • change define logic of _DIRENT_HAVE_D_INO to match other macros
  • unix_mphal: properly initialize struct sigaction
  • unix_mphal: just consistently set sigaction.sa_flags to 0
  • machine_mem improvements
  • properly cancel REPL input when Ctrl-C is pressed
  • unix_mphal: raise KeyboardInterrupt straight from signal handler
  • implement uos.dupterm(), conditional on MICROPY_PY_OS_DUPTERM

windows port:

  • cleanup makefile
  • support 64bit mingw-w64 builds
  • make keyboard_interrupt_obj available, it's standard feature
  • add basic support for raising KeyboardInterrupt
  • add Appveyor CI builds for msvc port
  • better handling of Ctrl-C
  • msvc: nicer handling of asserts and 'invalid' parameters
  • msvc: use different output directories depending on build type
  • msvc: use new modmachine infrastructure per changes in f925165
  • msvc: add dirent.h/.c implementation

stmhal port:

  • implement delayed RTC initialization with LSI fallback
  • put IRQs into priority order
  • turn off DMA clocks when idle for 100 msec
  • add dma support for sdcard
  • on SysTick IRQ, only process one DMA channel at a time
  • irq: add comment about SDIO priority being higher than DMA
  • irq: set all IRQ subpriorities to 0, since they aren't used
  • move flash storage idle tick handler from TIM3 to SysTick
  • in SysTick IRQ handler, make uwTick variable non-volatile
  • process storage idle tick handler in different slot to DMA
  • increase the priority of UART IRQ
  • add support for the STM32F429I-DISCO kit by STMicro
  • allow make DEBUG=1 to build
  • make stm.mem* support large integers
  • uart.any() function now returns number of bytes available
  • make uart.write() function correctly for timeout=0
  • add board config files for PYBv1.1 and PYBLITEv1.0
  • put all DMA channel & stream definitions in dma.h
  • add raise_irq_pri and restore_irq_pri functions
  • protect SD card DMA transactions against USB MSC contention
  • add rtc.init() method to force RTC to re-initialise
  • only use BASEPRI irq stuff if Cortex is M3 or higher
  • add option to free up TIM3 from USB VCP polling
  • fix uart off by 1 circular buffer size
  • execute boot.py and main.py when formatting the file system
  • print exception information in nlr_jump_failed
  • enable two USB phys to be supported together
  • timer: use mp_float_t instead of float
  • for SPI config, use HW_SPIx_SCK instead of HW_ENABLE_SPIx
  • make uart init use struct instead of array for parsing args
  • extend SPI support to fully support all SPI devices on STM32F429
  • moduselect: implement "oneshot polling" flag
  • change PLL configuration for STM32F7DISC
  • add mem8/mem16/mem32 operations to machine module
  • add pyb.irq_stats() to get statistics about IRQ calls
  • add struct qstr to block of qstrs needed for MICROPY_PY_STRUCT
  • fix usbd_conf.c for devices which don't have USB_HS at all

cc3200 port:

  • correct buffer offset in serial flash diskio module
  • add __get_BASEPRI and __set_BASEPRI inline function definitions

esp8266 port:

  • modesp: implement flash_read(offset, size_bytes) function
  • mac() function belongs to network module per the latest API
  • modesp: allow to compile out proprietary espconn stuff

docs:

  • library: add network server example
  • add discussion on interrupt handlers incl uPy specific techniques

pic16bit:

  • use global MICROPY_NO_ALLOCA setting

ports:

  • rename "machine" module to "umachine"
2015-12-31 22:43
2015-11-24 05:27

First-class REPL, ussl module, machine module for WiPy, stuffed-floats

This release brings first-class REPL support, which now has tab completion,
auto-indent, paste mode, history and _ to hold the last computed value.
There is a new ussl module, and one can now build a standalone unix binary.
The new machine API is implemented in cc3200, with the machine module and
additions to time and os modules. stmhal contains the beginnings of this
new API, while still retaining full backwards compatibility with the original
pyb API. unix also includes the new time functions, sleep_ms, sleep_us,
ticks_ms, ticks_us and ticks_diff. A new object representation is available
which stores single-precision floats within a machine word (using 30-bit
precision), and allows to use float objects without the heap (not enabled in
any port). There are also bug fixes and general improvements.

py core:

  • put compiler state on the C stack
  • objrange: bugfix for range_subscr() when index is a slice object
  • parsenum: provide detailed error for int parsing with escaped bytes
  • mpz: raise NotImplError instead of failing assertion
  • mpz: force rhs of mpz_shl_inpl/mpz_shr_inpl to be unsigned
  • mpz: fix bignum anding of large negative with smaller positive int
  • catch all cases of integer (big and small) division by zero
  • allocate parse nodes in chunks to reduce fragmentation and RAM use
  • allow to enable inline assembler without native emitter
  • fix edge case when constant-folding negation of integer
  • emitnative: raise ViperTypeError for unsupported unary ops
  • don't generate unnecessary parse nodes for assignment or kwargs
  • factor logic when creating parse node from and-rule
  • makeqstrdata.py: catch and report case of empty input file
  • rename MP_BOOL() to mp_obj_new_bool() for consistency in naming
  • add paste mode to friendly REPL, entered via CTRL-E
  • rename "Micro Python" to "MicroPython" in REPL, help, readme's and misc
  • objarray: allow to create array of void pointers, as extension to CPython
  • move constant folding from compiler to parser
  • make parser error handling cleaner, less spaghetti-like
  • allow to to build MicroPython as a static library
  • add support to call init from a builtin module on first import
  • implement ptr32 load and store in viper emitter
  • fix calc of qstr memory usage, due to new qstr chunk allocation
  • remove dependency on printf/fwrite in mp_plat_print
  • fix with+for+return bug by popping for-iter when unwinding exc stack
  • add option for inline assembler to support ARMv7-M instructions
  • add support for _ in REPL to hold last computed value
  • stream: allow to reuse is_nonblocking_error()
  • add lsl/lsr/asr opcode support to inline Thumb2 assembler
  • add mp_obj_is_float function (macro) and use it where appropriate
  • move float e/pi consts to objfloat and make mp_obj_float_t private
  • make float representation configurable with object representation
  • add object repr "C", where 30-bit floats are stuffed in obj word
  • nlrthumb: make compatible with Cortex-M0 (ARMv6M instr set)

extmod:

  • add modussl, an SSL socket wrapper module based on axTLS

lib:

  • axtls: add axtls git submodule, dependency of modussl
  • libffi: add libffi as a submodule
  • mp-readline: add n_chars argument to mp_hal_erase_line_from_cursor
  • make netutils.h available to all ports by default

drivers:

  • sdcard: allow up to 5 retries to initialise SD card

tools:

  • upip: update to 0.5.9
  • pyboard: add -c argument to run a program passed as a string

tests:

  • wipy: improve robustness of time test
  • wipy: improve robustness of rtc_irq test
  • wipy: add machine module tests
  • test slicing a range that does not start at zero
  • add further tests for mpz code
  • allow tests to pass against CPython 3.5
  • add test for evaluation order of dictionary key/value pairs
  • in pyb RTC tests, check wakeup register values
  • add more tests for viper 16/32-bit load/store, and ellipsis
  • jni: start adding modjni tests
  • extmod: add tests for sleep_ms/us(), ticks_ms/us/diff()

unix port:

  • modjni: new_jobject(): Handle null reference
  • modjni: call_method(): If name doesn't match, cleanup via goto next_method
  • modjni: call_method: Better resource release
  • modjni: call_method: Delete done local references in loop
  • modjni: implement len() for objects with java.util.List interface
  • modjni: fix method argument matching
  • modjni: propagate Java exceptions on list access
  • modjni: convert Java's IndexOutOfBoundsException to Python's IndexError
  • modjni: jobject.str/repr: Return Java .toString() value
  • modjni: jclass.str/repr: Return Java .toString() value
  • add support for building axtls dependency lib
  • modjni: after Call*Method(), Java exception should always be checked
  • modjni: allow to access fields of objects
  • modjni: py2jvalue: Support bool and None values
  • modsocket: fix usage of pointers to locals outside scope
  • add exit and paste-mode hints to shell startup banner
  • modtermios: tcsetattr: if 0 passed for "when" param, treat as TCSANOW
  • modjni: call_method: check for Java exception after method return
  • modjni: add iteration support for Java List objects
  • allow to build against Android down to 1.5
  • modos: add statvfs() function
  • unix_mphal: implement HAL_Delay() and HAL_GetTick()
  • modtime: implement sleep_ms(), sleep_us()
  • modtime: implement ticks_ms(), ticks_us() and ticks_diff()
  • modos: android Bionic lacks statvfs(), has BSD statfs()

stmhal port:

  • in RTC.wakeup, fix setting of wucksel to get correct period
  • fix RTC.wakeup so it correctly calculates WUT for large periods
  • fix USB CDC-only mode under Windows
  • enable REPL auto indent; document paste mode in help()
  • allow to set bits resolution for DAC; 8 is default, can have 12
  • make USB serial number actually be unique
  • early version of machine module for stmhal
  • add sleep_{ms,us} and ticks_{ms,us,cpu,diff} to time module
  • implement os.dupterm (was pyb.repl_uart)
  • uart: if char is not received within timeout, return EAGAIN error
  • bring Pin class close to new machine module specification
  • rtc: init uses YMD rather than backup register to detect powerup
  • enable "all special methods" configuration option

cc3200 port:

  • new irq API, affects all classes that provide the irq method
  • new WLAN API including test
  • implement support for os.dupterm()
  • rename pyb module to machine
  • disable uheapq and uhashlib
  • make auth param positional in wlan.connect
  • always reset WLAN after setting the mode
  • wiPy SW v1.0.0 release
  • in scan results rename 'auth' field to 'sec'
  • create wipy module, remove HeartBeat class
  • increase stack sizes a bit
  • refactor network module to make the server a propper object
  • WLAN class can retrieve the existing instance
  • enable REPL autoindent
  • uart.read() returns EGAIN if no chars available
  • make socket.listen([backlog]) compliant with Python 3.5
  • enable "all special methods" configuration option
  • bump version to 1.1.0

docs:

  • update esp8266 documentation to match the code
  • describe properly how MCU can be woken from pyb.standby() state
  • wipy: update all WiPy docs to reflect the new API
  • wipy: add wipy and network.server documentation
  • wipy: add wipy tutorials section
  • wipy: add usocket and ussl modules' documentation
  • wipy: several corrections to the classes in the machine module
  • wipy: remove remaining references to 'af', which is now 'alt'
  • wipy: add more tutorials and examples

misc:

  • travis: build "deplibs" in unix port
  • README: document "Ctrl-D" shell exit
  • README: document how to enable/build external dependencies
2015-10-21 23:58
C
1
https://gitee.com/lalbe/micropython.git
git@gitee.com:lalbe/micropython.git
lalbe
micropython
micropython

搜索帮助