aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-05-08tests/multi_bluetooth: Fix typo printing wrong IRQ type.Damien George
2020-05-05stm32/boards/PYBD_SF2: Put BTstack library in external QSPI XIP flash.Damien George
In the same way the nimble stack is put there.
2020-05-05zephyr: Use zephyr build system to merge configurations.Maureen Helm
The zephyr build system supports merging application-level board configurations, so there is no need to reproduce this functionality in MicroPython. If CONF_FILE is not explicitly set, then the zephyr build system looks for prj.conf in the application directory. Therefore we rename the MicroPython prj_base.conf to prj.conf. Furthermore, if the zephyr build system finds boards/$(BOARD).conf in the application directory, it merges that configuration with prj.conf. Therefore we rename all the MicroPython board .conf files and move them into a boards/ directory. The minimal configuration, prj_minimal.conf, is left in the application directory because it is used as an explicitly set CONF_FILE in make-minimal.
2020-05-05tests/thread/thread_stacksize1.py: Increase stack size for CPython.yangfl
On arm64 with CPython: >>> _thread.stack_size(32*1024) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: size not valid: 32768 bytes So increase the CPython value in the test to 512k so it runs on more systems (on modern Linux the default stack size is usually 8MB).
2020-05-03py/parse: Support constant folding of power operator for integers.Damien George
Constant expression like "2 ** 3" will now be folded, and the special form "X = const(2 ** 3)" will now compile because the argument to the const is now a constant. Fixes issue #5865.
2020-05-03esp32/partitions: Update comments in files regarding offset.Thorsten von Eicken
2020-05-03esp32: Improve support for OTA updates.Thorsten von Eicken
This commit adds several small items to improve the support for OTA updates on an esp32: - a partition table for 4MB flash modules that has two OTA partitions ready to go to do updates - a GENERIC_OTA board that uses that partition table and that enables automatic roll-back in the bootloader - a new esp32.Partition.mark_app_valid_cancel_rollback() class-method to signal that the boot is successful and should not be rolled back at the next reset - an automated test for doing an OTA update - documentation updates
2020-05-02docs/library: Fix docs for machine.WDT to specify millisecond timeout.Thorsten von Eicken
2020-05-02tests/cpydiff: Add cpydiff test for __all__ used in imported package.Jim Mussared
2020-05-02extmod/modbtree: Retain reference to underlying stream so it's not GC'd.Damien George
For ports that have a system malloc which is not garbage collected (eg unix, esp32), the stream object for the DB must be retained separately to prevent it from being reclaimed by the MicroPython GC (because the berkeley-db library uses malloc to allocate the DB structure which stores the only reference to the stream). Although in some cases the user code will explicitly retain a reference to the underlying stream because it needs to call close() on it, this is not always the case, eg in cases where the DB is intended to live forever. Fixes issue #5940.
2020-04-30docs/library: Note that machine.Pin.irq's hard arg may not be supported.Damien George
2020-04-30esp8266/mpconfigport.h: Add definitions for BEGIN/END_ATOMIC_SECTION.Damien George
These are needed to ensure correct operation of the MicroPython scheduler.
2020-04-30esp8266/machine_pin: Move pin_intr_handler to iRAM, de-support hard IRQ.Damien George
GPIO interrupts can occur when the flash ROM cache is in use and so the GPIO interrupt handler must be in iRAM. This commit moves the handler to iRAM, and also moves mp_sched_schedule to iRAM which is called by pin_intr_handler. As part of this fix the Pin class can no longer support hard=True in the Pin.irq() method, because the VM and runtime are too big to put in iRAM. Fixes #5714.
2020-04-30py/scheduler: Add option to wrap mp_sched_schedule in arbitrary attr.Damien George
So ports can put it in a special memory section if needed.
2020-04-30travis: Make sure upstream/master exists when computing size-diff check.Damien George
Explicitly add the repository as upstream and fetch the master commit. This makes this bare-arm/minimal job more robust when finding the fork-point of a PR relative to upstream/master (especially for forks of this repo).
2020-04-30all: Fix auto-enable of MICROPY_GCREGS_SETJMP to select GC behaviour.Damien George
Only enable it if MICROPY_GCREGS_SETJMP is not already defined, and no supported architecture is defined.
2020-04-29all: Factor gchelper code to one place and use it for unix & ARM ports.Jim Mussared
No functionality change is intended with this commit, it just consolidates the separate implementations of GC helper code to the lib/utils/ directory as a general set of helper functions useful for any port. This reduces duplication of code, and makes it easier for future ports or embedders to get the GC implementation correct. Ports should now link against gchelper_native.c and either gchelper_m0.s or gchelper_m3.s (currently only Cortex-M is supported but other architectures can follow), or use the fallback gchelper_generic.c which will work on x86/x64/ARM. The gc_helper_get_sp function from gchelper_m3.s is not really GC related and was only used by cc3200, so it has been moved to that port and renamed to cortex_m3_get_sp.
2020-04-29unix: Add btstack to the unix submodules list.Jim Mussared
But only when bluetooth is enabled, i.e. if building the dev or coverage variants, and we have libusb available. Update travis to match, i.e. specify the variant when doing `make submodules`.
2020-04-29extmod/modbluetooth: Fix sign compare and unused variable warnings.Jim Mussared
2020-04-29lib/btstack: Update to c8b9823 for USB HCI reset timeout fix.Jim Mussared
2020-04-29unix: Enable modbluetooth on the "dev" and "coverage" variants.Jim Mussared
And MICROPY_PY_URANDOM_EXTRA_FUNCS is enabled on "dev" so tha the Bluetooth examples all run.
2020-04-29tests/run-multitests.py: Add shortcuts for local Python instances.Jim Mussared
One can now use `-i micropython` and `-i cpython` to add instances using the `MICROPYTHON` and `CPYTHON3` variables (which can be overridden by env vars).
2020-04-29tests/multi_bluetooth/ble_gap_advertise: Fix bytes/str compare warning.Jim Mussared
2020-04-29tests/run-multitests.py: Allow filtering out lines from stdout.Jim Mussared
And use this new feature to filter out certain lines in the Bluetooth multitests.
2020-04-29unix: Add support for modbluetooth and BLE using btstack.Jim Mussared
This commit adds full support to the unix port for Bluetooth using the common extmod/modbluetooth Python bindings. This uses the libusb HCI transport, which supports many common USB BT adaptors.
2020-04-29extmod/btstack: Implement more robust init/deinit sequencing.Jim Mussared
2020-04-29stm32/main: Peform a clean shutdown of btstack on soft reset.Jim Mussared
Not just NimBLE.
2020-04-29extmod/modbluetooth: Don't hold atomic section during mp_sched_schedule.Jim Mussared
Because, for example, on unix the atomic section isn't re-entrant, and mp_sched_schedule() will try to re-acquire the atomic section.
2020-04-29stm32/Makefile: Rename SRC_LIB to LIB_SRC_C to match other ports.Jim Mussared
2020-04-29unix/modmachine: Add machine.idle(), implemented using sched_yield.Jim Mussared
Also add a definition of MICROPY_EVENT_POLL_HOOK so the unix port can build against modules that require this.
2020-04-27tests/extmod: Add btree test for errors raised by btree DB library.Damien George
This test now passes given the previous two commits.
2020-04-27py/modio: Allow uio.IOBase streams to return errno for read/write error.Damien George
This allows user code that inherits from uio.IOBase to return an errno error code from the user readinto/write function, by returning a negative value. Eg returning -123 means an errno of 123. This is already how the custom ioctl works.
2020-04-27py/stream: Remove mp_stream_errno and use system errno instead.Damien George
This change is made for two reasons: 1. A 3rd-party library (eg berkeley-db-1.xx, axtls) may use the system provided errno for certain errors, and yet MicroPython stream objects that it calls will be using the internal mp_stream_errno. So if the library returns an error it is not known whether the corresponding errno code is stored in the system errno or mp_stream_errno. Using the system errno in all cases (eg in the mp_stream_posix_XXX wrappers) fixes this ambiguity. 2. For systems that have threading the system-provided errno should always be used because the errno value is thread-local. For systems that do not have an errno, the new lib/embed/__errno.c file is provided.
2020-04-27py/objdict: Fix popitem for ordered dicts.Jim Mussared
The popitem method wasn't implemented for ordered dicts and would result in an invalid state. Fixes issue #5956.
2020-04-27extmod/nimble: Update to work with NimBLE 1.3.Jim Mussared
2020-04-27lib/mynewt-nimble: Update submodule to NimBLE release 1.3.0.Jim Mussared
2020-04-23README: Fix small typo, dfeault -> default.Krsna Mahapatra
2020-04-23all: Format code to add space after C++-style comment start.stijn
Note: the uncrustify configuration is explicitly set to 'add' instead of 'force' in order not to alter the comments which use extra spaces after // as a means of indenting text for clarity.
2020-04-23all: Remove commented-out include statements.stijn
2020-04-23esp32: Consolidate check_esp_err functions and add IDF error string.Thorsten von Eicken
This commit consolidates a number of check_esp_err functions that check whether an ESP-IDF return code is OK and raises an exception if not. The exception raised is an OSError with the error code as the first argument (negative if it's ESP-IDF specific) and the ESP-IDF error string as the second argument. This commit also fixes esp32.Partition.set_boot to use check_esp_err, and uses that function for a unit test.
2020-04-23esp32/modesp32: Add idf_heap_info(capabilities) to esp32 module.Thorsten von Eicken
This commit adds an idf_heap_info(capabilities) method to the esp32 module which returns info about the ESP-IDF heaps. It's useful to get a bit of a picture of what's going on when code fails because ESP-IDF can't allocate memory anymore. Includes documentation and a test.
2020-04-22README: Update Travis CI links to point to travis-ci.com.Damien George
MicroPython now build at the .com rather than the .org.
2020-04-22tools/check_code_size.sh: Remove unused script.Damien George
It's now replaced by tools/metrics.py.
2020-04-22travis: Use tools/metrics.py to compute size diff of minimal ports.Damien George
This is to make the Travis CI size check more robust, by not relying on the saved firmware from a previous build (which may use a different compiler, environment, etc) but rather compile both master and the PR and diff them. This size check now checks both bare-arm and minimal x86-32 builds (before it just checked minimal Cortex-M build).
2020-04-22tools/metrics.py: Use OrderedDict when reading build log.Damien George
So that the output (eg of the diff command) always has the lines in the same order.
2020-04-22tools/metrics.py: Don't build mpy-cross if not needed by any ports.Damien George
To save build time.
2020-04-22tools/metrics.py: Add option to diff to error if delta above threshold.Damien George
Useful for things like CI where the size check is automated.
2020-04-20py/makecompresseddata.py: Make compression deterministic.Damien George
Error string compression is not deterministic in certain cases: it depends on the Python version (whether dicts are ordered by default or not) and probably also the order files are passed to this script, leading to a difference in which words are included in the top 128 most common. The changes in this commit use OrderedDict to keep parsed lines in a known order, and, when computing how many bytes are saved by a given word, it uses the word itself to break ties (which would otherwise be "random").
2020-04-19docs/library: Document that char_data/notify_data are also references.Thomas Friebel
2020-04-18stm32/mboot: Expose custom DFU USB VID/PID values at makefile level.Andrew Leech
In mboot, the ability to override the USB vendor/product id's was added back in 5688c9ba09ea8f9ffeeb25bd577a08b57828ffa7. However, when the main firmware is turned into a DFU file the default VID/PID are used there. pydfu.py doesn't care about this but dfu-util does and prevents its use when the VID/PID don't match. This commit exposes BOOTLOADER_DFU_USB_VID/PID as make variables, for use on either command line or mpconfigboard.mk, to set VID/PID in both mboot and DFU files.