aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-05-15nrf/mphalport: Remove need for "syntax unified" in mp_hal_delay_us.Damien George
Because it can confuse older versions of gcc. Instead use the correct instruction for Thumb vs Thumb-2 (sub vs subs) so the assembler emits the 2-byte instruction. Related to commit 1aa9ff914194824a78a8b010572ad7083c1bb4ec.
2020-05-15nrf/Makefile: Don't use -fno-builtin for Cortex-M0 builds.Damien George
So that error string compression is optimised correctly (it needs strcmp to be optimised away by the compiler).
2020-05-15extmod/vfs_lfsx: Fix import_stat so it takes into account current dir.Damien George
CPython semantics require searching the current directory if the import is not absolute (when "" is in sys.path). Fixes issue #6037.
2020-05-15stm32/boards: Add board config for Nucleo-F412ZG development board.Thomas Roberts
2020-05-15stm32: Add support for F412 MCUs.Thomas Roberts
2020-05-14esp8266/boards: Allow configuring btree/FAT/LFS2 support when building.Rafael Römhild
Prior to e0905e85a7ad2961aa9192f6130565860e531ad3 it was possible to disable btree support on build. This patch allows to configure btree support on make again and also the two new introduced options for FAT and LFS2 filesystems.
2020-05-14py/nativeglue.h: Rename "setjmp" entry to "setjmp_" to avoid any clash.Damien George
Because some compilers may define setjmp to something. Fixes issue #6032.
2020-05-11extmod/nimble: Make error code mapping default to MP_EIO.Thomas Friebel
Before this change, any NimBLE error that does not appear in the ble_hs_err_to_errno_table maps to return code 0, meaning success. If we miss adding an error code to the table we end up returning success in case of failure. Instead, handle the zero case explicitly and default to MP_EIO. This allows removing the now-redundant MP_EIO entries from the mapping.
2020-05-11README: Change --help option to -h to match micropython executable.Hannah Suarez/hcs0
The behaviour was changed in 83439e38fc025bda79eec0096b8cc60379757206
2020-05-11extmod/modbluetooth: Add support for changing the GAP device name.Damien George
This commit allows the user to set/get the GAP device name used by service 0x1800, characteristic 0x2a00. The usage is: BLE.config(gap_name="myname") print(BLE.config("gap_name")) As part of this change the compile-time setting MICROPY_PY_BLUETOOTH_DEFAULT_NAME is renamed to MICROPY_PY_BLUETOOTH_DEFAULT_GAP_NAME to emphasise its link to GAP and this new "gap_name" config value. And the default value of this for the NimBLE bindings is changed from "PYBD" to "MPY NIMBLE" to be more generic.
2020-05-11stm32/README: Reorg DFU flashing instructions with addition for PYBD.Thorsten von Eicken
2020-05-09esp32/modsocket: Fix getaddrinfo to raise on error.Thorsten von Eicken
This commit fixes the behaviour of socket.getaddrinfo on the ESP32 so it raises an OSError when the name resolution fails instead of returning a [] or a resolution for 0.0.0.0. Tests are added (generic and ESP32-specific) to verify behaviour consistent with CPython, modulo the different types of exceptions per MicroPython documentation.
2020-05-09tests/run-tests: Skip REPL feature checks when running via pyboard.py.Damien George
2020-05-09py/parse: Make mp_parse_node_extract_list return size_t instead of int.Damien George
Because this function can only return non-negative values, and having the correct return type gives more information to the caller.
2020-05-09tests/run-multitests.py: Add TRACE banner and move TEST output to end.Damien George
To make it easier to understand the output when both -s and -t are used.
2020-05-08esp8266/uart: Move a few functions from iRAM to iROM.Damien George
They call functions in iROM so do not need to be in iRAM.
2020-05-08esp8266/esp_mphal: Move most functions in esp_mphal.c from iRAM to iROM.Damien George
The ones that are moved out of iRAM should not need to be there, because either they call functions in iROM (eg mp_hal_stdout_tx_str), or they are only ever called from a function in iROM and not from an interrupt (eg ets_esf_free_bufs). This frees up about 800 bytes of iRAM.
2020-05-08esp8266/boards: Move py/pairheap.c code from iRAM to iROM.Damien George
It doesn't need to be in iRAM.
2020-05-08esp8266: Clean up Pin intr handler by moving all code to machine_pin.c.Damien George
The macro MP_FASTCODE is used to explicitly place required functions in iRAM, instead of needing a separate .c file.
2020-05-08py/scheduler: Convert mp_sched_full and mp_sched_num_pending to macros.Damien George
So they are guaranteed to be inlined within functions like mp_sched_schedule which may be located in a special memory region.
2020-05-08extmod/vfs_lfsx: Fix rename to respect cur dir for new path.robert
If the new name start with '/', cur_dir is not prepened any more, so that the current working directory is respected. And extend the test cases for rename to cover this functionality.
2020-05-08extmod/vfs_lfsx: Normalize path name in chdir.robert
This change scans for '.', '..' and multiple '/' and normalizes the new path name. If the resulting path does not exist, an error is raised. Non-existing interim path elements are ignored if they are removed during normalization.
2020-05-08extmod/vfs_lfsx: Fix path handling in uos.stat() to consider cur dir.robert
This fixes the bug, that stat(filename) would not consider the current working directory. So if e.g. the cwd is "lib", then stat("main.py") would return the info for "/main.py" instead of "/lib/main.py".
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.