aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-11-30github/workflows: Run unix and qemu-arm workflows when tests change.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-11-30README: Update badges for new GitHub Actions workflows.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-11-30tests/run-tests: Update skipped tests on CI for GitHub Actions.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-11-29travis: Stop using Travis for CI.Damien George
Travis now limits the amount of free minutes for open-source projects, and it does not provide enough for this project. So stop using it and instead use on GitHub Actions. Signed-off-by: Damien George <damien@micropython.org>
2020-11-29github/workflows: Add workflows for all CI tasks, builds and tests.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-11-29tools/ci.sh: Add helper script to run CI tasks.Damien George
The aim is for this script to be used on any CI platform, as well as run locally. Signed-off-by: Damien George <damien@micropython.org>
2020-11-29py/mpprint: Prevent case fall-through when assert is disabled.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-11-29tests/extmod: Add vfs_posix.py test for uos.VfsPosix class.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-11-24extmod/nimble/modbluetooth_nimble: Fix build when l2cap unavailable.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-24tests/multi_bluetooth: Add L2CAP channels multi-test.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-24docs/library/ubluetooth.rst: Add docs for L2CAP channels.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-24extmod/modbluetooth: Add API for L2CAP channels.Jim Mussared
Also known as L2CAP "connection oriented channels". This provides a socket-like data transfer mechanism for BLE. Currently only implemented for NimBLE on STM32 / Unix. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-23extmod/machine_i2c: Add init protocol method for generic I2C bindings.Damien George
Hardware I2C implementations must provide a .init() protocol method if they want to support reconfiguration. Otherwise the default is that i2c.init() raises an OSError (currently the case for all ports). mp_machine_soft_i2c_locals_dict is renamed to mp_machine_i2c_locals_dict to match the generic SPI bindings. Fixes issue #6623 (where calling .init() on a HW I2C would crash). Signed-off-by: Damien George <damien@micropython.org>
2020-11-22nrf/README: Describe Pin numbering scheme for nRF52840.JPFrancoia
Clarify that the nRF52840's GPIO 1.00 to 1.15 maps to Pin(32-47) in MicroPython.
2020-11-18esp32,esp8266: Remove "FAT" from warning message in inisetup.py.robert
Because FAT is not any more the only filesystem used.
2020-11-18stm32/rfcore: Depend on NimBLE only when BLE enabled.Jim Mussared
This fixes the build for non-STM32WB based boards when the NimBLE submodule has not been fetched, and also allows STM32WB boards to build with BLE disabled. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-16stm32/rfcore: Don't send HCI ACL cmds while another is pending.Jim Mussared
And, for TX, the next/prev entries ane unused so set them to NULL to indicate this. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-16stm32/flash: Implement WB55 flash locking.Jim Mussared
This is needed to moderate concurrent access to the internal flash, as while an erase/write is in progress execution will stall on the wireless core due to the bus being locked. This implements Figure 10 from AN5289 Rev 3. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-16stm32/rfcore: Make RX IRQ schedule the NimBLE handler.Jim Mussared
This commit switches the STM32WB HCI interface (between the two CPUs) to require the use of MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS, and as a consequence to require NimBLE. IPCC RX IRQs now schedule the NimBLE handler to run via mp_sched_schedule. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-16tests/multi_bluetooth: Add a test for WB55 concurrent flash access.Jim Mussared
This test currently passes on Unix/PYBD, but fails on WB55 because it lacks synchronisation of the internal flash. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-16tests/multi_bluetooth: Change dict index-and-del to pop, to clear event.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13extmod/nimble: Make stm32 and unix NimBLE ports use synchronous events.Jim Mussared
This changes stm32 from using PENDSV to run NimBLE to use the MicroPython scheduler instead. This allows Python BLE callbacks to be invoked directly (and therefore synchronously) rather than via the ringbuffer. The NimBLE UART HCI and event processing now happens in a scheduled task every 128ms. When RX IRQ idle events arrive, it will also schedule this task to improve latency. There is a similar change for the unix port where the background thread now queues the scheduled task. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13extmod/modbluetooth: Re-instate optional no-ringbuf modbluetooth.Jim Mussared
This requires that the event handlers are called from non-interrupt context (i.e. the MicroPython scheduler). This will allow the BLE stack (e.g. NimBLE) to run from the scheduler rather than an IRQ like PENDSV, and therefore be able to invoke Python callbacks directly/synchronously. This allows writing Python BLE handlers for events that require immediate response such as _IRQ_READ_REQUEST (which was previous a hard IRQ) and future events relating to pairing/bonding. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13extmod/nimble: Poll startup directly rather than using NimBLE sem.Jim Mussared
Using a semaphore (the previous approach) will only run the UART, whereas for startup we need to also run the event queue. This change makes it run the full scheduler hook. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13extmod/modbluetooth: Combine gattc-data-available callbacks into one.Jim Mussared
Instead of having the stack indicate a "start", "data"..., "end", pass through the data in one callback as an array of chunks of data. This is because the upcoming non-ringbuffer modbluetooth implementation cannot buffer the data in the ringbuffer and requires instead a single callback with all the data, to pass to the Python callback. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13unix: Make mp_hal_delay_ms run MICROPY_EVENT_POLL_HOOK.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13unix: Handle pending events/scheduler in MICROPY_EVENT_POLL_HOOK.Andrew Leech
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13extmod/modbluetooth: Make UUID type accessible outside modbluetooth.c.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13tests/run-multitests.py: Add a -p flag to run permutations of instances.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13tests/multi_bluetooth: Improve reliability of event waiting.Jim Mussared
Use the same `wait_for_event` in all tests that doesn't hold a reference to the event data tuple and handles repeat events. Also fix a few misc reliability issues around timeouts and sequencing. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13tests/run-multitests.py: Fix diff order, show changes relative to truth.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-13stm32/rtc: Validate the RTC prescaler on boot and change if incorrect.Damien George
Devices with RTC backup-batteries have been shown (very rarely) to have incorrect RTC prescaler values. Such incorrect values mean the RTC counts fast or slow, and will be wrong forever if the power/backup-battery is always present. This commit detects such a state at start up (hard reset) and corrects it by reconfiguring the RTC prescaler values. Signed-off-by: Damien George <damien@micropython.org>
2020-11-13stm32/Makefile: Allow boards to extend all SRC variables.Damien George
And rename SRC_HAL -> HAL_SRC_C and SRC_USBDEV -> USBDEV_SRC_C for consistency with other source variables. Follow on from 0fff2e03fe07471997a6df6f92c6960cfd225dc0 Signed-off-by: Damien George <damien@micropython.org>
2020-11-13extmod/machine_mem: Only allow integers in machine.memX subscript.Arrowana
Prior to this change machine.mem32['foo'] (or using any other non-integer subscript) could result in a fault due to 'foo' being interpreted as an integer. And when writing code it's hard to tell if the fault is due to a bad subscript type, or an integer subscript that specifies an invalid memory address. The type of the object used in the subscript is now tested to be an integer by using mp_obj_get_int_truncated instead of mp_obj_int_get_truncated. The performance hit of this change is minimal, and machine.memX objects are more for convenience than performance (there are many other ways to read/write memory in a faster way), Fixes issue #6588.
2020-11-12esp32/machine_pin: Reset pin if init sets mode.Jonathan Hogg
This will forcibly grab the pin back from the ADC if it has previously been associated with it. Fixes #5771.
2020-11-12stm32/Makefile: Make the generation of `firmware.bin` explicit.Sébastien NEDJAR
The file `$(BUILD)/firmware.bin` was used by the target `deploy-stlink` and `deploy-openocd` but it was generated indirectly by the target `firmware.dfu`. As this file could be used to program boards directly by a Mass Storage copy, it's better to make it explicitly generated. Additionally, some target are refactored to remove redundancy and be more explicit on dependencies.
2020-11-12tools/makeqstrdefs.py: Run qstr preprocessing in parallel.Jim Mussared
This gives a substantial speedup of the preprocessing step, i.e. the generation of qstr.i.last. For example on a clean build, making qstr.i.last: 21s -> 4s on STM32 (WB55) 8.9 -> 1.8s on Unix (dev). Done in collaboration with @stinos. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-11py/binary: Fix sign extension setting wide integer on 32-bit archs.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-11-11extmod/moductypes: Fix storing to (U)INT64 arrays on 32-bit archs.Damien George
Fixes issue #6583. Signed-off-by: Damien George <damien@micropython.org>
2020-11-11py/mpz: Do sign extension in mpz_as_bytes for negative values.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-11-11lib/utils/pyexec: Add MICROPY_BOARD hooks before/after executing code.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-11-11stm32/boardctrl: Define MICROPY_BOARD_EARLY_INIT alongside others.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-11-11stm32: Add MICROPY_BOARD calls in various places in stm32_main.Damien George
For a board to have full configurability of the soft reset loop. Signed-off-by: Damien George <damien@micropython.org>
2020-11-11stm32/main: Move update_reset_mode to outside the soft-reset loop.Damien George
Running the update inside the soft-reset loop will mean that (on boards like PYBD that use a bootloader) the same reset mode is used each reset loop, eg factory reset occurs each time. Signed-off-by: Damien George <damien@micropython.org>
2020-11-05extmod/nimble/nimble.mk: Add -Wno-old-style-declaration.Jim Mussared
This is needed since -Wextra was added to the build in bef412789ea93c521bd9c2dddc22b9b3484da574 Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-11-05extmod/btstack/btstack.mk: Add -Wimplicit-fallthrough=0.Jim Mussared
This is needed since -Wextra was added to the build in bef412789ea93c521bd9c2dddc22b9b3484da574 Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-10-29tests/micropython/extreme_exc.py: Unlink alloc'd lists earlier in chain.Damien George
To help the GC collect this memory that's no longer needed after the test. Signed-off-by: Damien George <damien@micropython.org>
2020-10-29stm32: Support C++ code and user C modules written in C++.Damien George
Also build user C modules as part of the stm32 CI. Signed-off-by: Damien George <damien@micropython.org>
2020-10-29stm32/boards: Factor out common data/bss/heap/stack linker sections.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-10-29unix/Makefile: Move coverage.c and coveragecpp.cpp to coverage variant.Damien George
So that g++ is not needed to build a non-coverage unix variant. Signed-off-by: Damien George <damien@micropython.org>