aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-09-09nrf/main: Make mp_builtin_open signature match that in py/builtin.h.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-09-09tools/mpy-tool.py: Fix merge of multiple mpy files to POP_TOP correctly.Damien George
MP_BC_CALL_FUNCTION will leave the result on the Python stack, so that result must be discarded by MP_BC_POP_TOP. Signed-off-by: Damien George <damien@micropython.org>
2020-09-09mimxrt/boards: Add MIMXRT1064_EVK board.Albort Xue
2020-09-08stm32/boards/NUCLEO_WB55: Add Python helper code for rfcore.Jim Mussared
This allows prototyping rfcore.c improvements from Python. This was mostly written by @dpgeorge with small modifications to work after rfcore_init() by @jimmo.
2020-09-08stm32/rfcore: Enable RX IRQ on BLE IPCC channel for better performance.Jim Mussared
Before this change there was up to a 128ms delay on incoming payloads from CPU2 as it was polled by SysTick. Now the RX IRQ immediately schedules the PendSV.
2020-09-08stm32/rfcore: Refactor some helper funcs, and remove some magic numbers.Jim Mussared
Also explain what the payload fixup code is doing.
2020-09-08stm32/rfcore: Fix length matching in HCI parser.Jim Mussared
2020-09-08tests/multi_bluetooth: Make ble_gap_connect robust against event timing.Jim Mussared
2020-09-08stm32/powerctrlboot: Acquire HSEM5 on STM32WB during SystemClock_Config.Jim Mussared
This is required to allow using WS firmware newer than 1.1.1 concurrently with USB (e.g. USB VCP). It prevents CPU2 from modifying the CLK48 config on boot. Tested on WS=1.8 FUS=1.1. See AN5289 and https://github.com/micropython/micropython/issues/6316
2020-09-08stm32/boards/USBDONGLE_WB55: Add USE_MBOOT support.Jim Mussared
2020-09-08stm32/rfcore: Update rfcore.c to match how ST examples work.Jim Mussared
- Split tables and buffers into SRAM2A/2B. - Use structs rather than word offsets to access tables. - Use FLASH_IPCCDBA register value rather than option bytes directly.
2020-09-08stm32/make-stmconst.py: Add support for WB55 header files.Jim Mussared
2020-09-08extmod/nimble: Add timeout for HCI sync on startup.Jim Mussared
This allows `ble.active(1)` to fail correctly if the HCI controller is unavailable. It also avoids an infine loop in the NimBLE event handler where NimBLE doesn't correctly detect that the HCI controller is unavailable and keeps trying to reset. Furthermore, it fixes an issue where GATT service registrations were left allocated, which led to a bad realloc if the stack was activated multiple times.
2020-09-08esp32: Pin MicroPython and NimBLE tasks to core 0.Jim Mussared
MicroPython and NimBLE must be on the same core, for synchronisation of the BLE ringbuf and the MicroPython scheduler. However, in the current IDF versions (3.3 and 4.0) there are issues (see e.g. #5489) with running NimBLE on core 1. This change - pinning both tasks to core 0 - makes it possible to reliably run the BLE multitests on esp32 boards.
2020-09-08extmod/btstack: Detect HCI UART init failure.Jim Mussared
2020-09-08stm32/mpbthciport: Increase char timeout of BT HCI UART.Andrew Leech
The 2ms used previously was not long enough and it could lose HCI sync. Also print error on tx failure to make this more obvious in the future.
2020-09-08extmod/btstack: Add btstack support for _IRQ_GATTS_READ_REQUEST.Andrew Leech
2020-09-08extmod/modbluetooth: Allow using mp_hal_get_mac as a static address.Jim Mussared
Generally a controller should either have its own public address hardcoded, or loaded by the driver (e.g. cywbt43). However, for a controller that has no public address where you still want a long-term stable address, this allows you to use a static address generated by the port. Typically on STM32 this will be an LAA, but a board might override this.
2020-09-08docs/library/ubluetooth.rst: Document BLE address modes.Jim Mussared
2020-09-08tests/multi_bluetooth: Update to new config('mac') behaviour.Jim Mussared
2020-09-08extmod/modbluetooth: Implement configuration of address modes.Jim Mussared
Changes `BLE.config('mac')` to return a tuple (addr_mode, addr). Adds `BLE.config(addr_mode=...)` to set the addressing mode.
2020-09-08unix: Implement BLE H4 HCI UART for btstack/nimble.Jim Mussared
This commit adds support for using Bluetooth on the unix port via a H4 serial interface (distinct from a USB dongle), with both BTstack and NimBLE Bluetooth stacks. Note that MICROPY_PY_BLUETOOTH is now disabled for the coverage variant. Prior to this commit Bluetooth was anyway not being built on Travis because libusb was not detected. But now that bluetooth works in H4 mode it will be built, and will lead to a large decrease in coverage because Bluetooth tests cannot be run on Travis.
2020-09-08unix/Makefile: Always enable -f*-sections regardless of DEBUG setting.Jim Mussared
2020-09-08extmod/nimble: Implement NimBLE mutex.Jim Mussared
2020-09-08extmod/nimble: Make nimble_malloc work with allocated size.Jim Mussared
2020-09-08extmod/nimble: Set struct alignment correctly on 64-bit arch.Jim Mussared
2020-09-08extmod/modbluetooth: Refactor stack/hci/driver/port bindings.Jim Mussared
Previously the interaction between the different layers of the Bluetooth stack was different on each port and each stack. This commit defines common interfaces between them and implements them for cyw43, btstack, nimble, stm32, unix.
2020-09-08extmod/modbluetooth: Rename logging macro to be just DEBUG_printf.Jim Mussared
And prefix the debug message with "btstack:" or "nimble:", depending on the context. Also use correct format specifier for %zu.
2020-09-08stm32/modbluetooth_hci: Use a static mp_irq_obj_t for BT HCI UART IRQ.Jim Mussared
So that the IRQ handler does not need to be traced by the GC.
2020-09-08stm32/uart: Allow static IRQ handler registration.Jim Mussared
This will allow the HCI UART to use a non-heap mp_irq_obj_t, which avoids needing to make a root pointer for it.
2020-09-04lib/utils/mpirq: Add mp_irq_init func, and clean up unused init method.Damien George
mp_irq_init() is useful when the IRQ object is allocated by the caller. The mp_irq_methods_t.init method is not used anywhere so has been removed. Signed-off-by: Damien George <damien@micropython.org>
2020-09-04stm32/mpconfigport.h: Enable MICROPY_PY_REVERSE_SPECIAL_METHODS.Damien George
It's a useful core feature. Signed-off-by: Damien George <damien@micropython.org>
2020-09-04lib/libm: Reduce size of static two_over_pi array.Damien George
Thanks to Jeff Epler for the idea. Signed-off-by: Damien George <damien@micropython.org>
2020-09-04all: Rename "sys" module to "usys".stijn
This is consistent with the other 'micro' modules and allows implementing additional features in Python via e.g. micropython-lib's sys. Note this is a breaking change (not backwards compatible) for ports which do not enable weak links, as "import sys" must now be replaced with "import usys".
2020-09-02all: Bump version to 1.13.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-09-02tests/extmod: Add tests for verifying FAT and littlefs mtime values.Damien George
Verifies mtime timestamps on files match the value returned by time.time(). Also update vfs_fat_ramdisk.py so it doesn't check FAT timestamp of the root, because that may change across runs/ports. Signed-off-by: Damien George <damien@micropython.org>
2020-09-02unix/fatfs_port: Fix month offset in timestamp calculation.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-09-01extmod/vfs: Add option to use 1970 as Epoch.Damien George
By setting MICROPY_EPOCH_IS_1970 a port can opt to use 1970/1/1 as the Epoch for timestamps returned by stat(). And this setting is enabled on the unix and windows ports because that's what they use. Signed-off-by: Damien George <damien@micropython.org>
2020-09-01unix/modos: Support larger integer range in uos.stat fields.Damien George
On 32-bit builds these stat fields will overflow a small-int, so use mp_obj_new_int_from_uint to construct the int object. Signed-off-by: Damien George <damien@micropython.org>
2020-09-01extmod/vfs: Support larger integer range in VFS stat time fields.Damien George
On ports like unix where the Epoch is 1970/1/1 and atime/mtime/ctime are in seconds since the Epoch, this value will overflow a small-int on 32-bit systems. So far this is only an issue on 32-bit unix builds that use the VFS layer (eg dev and coverage unix variants) but the fix (using mp_obj_new_int_from_uint instead of MP_OBJ_NEW_SMALL_INT) is there for all ports so as to not complicate the code, and because they will need the range one day. Also apply a similar fix to other fields in VfsPosix.stat because they may also be large. Signed-off-by: Damien George <damien@micropython.org>
2020-08-31esp32/mphalport: Fix mp_hal_time_ns offset.Damien George
gettimeofday returns seconds since 2000/1/1 so needs to be adjusted to seconds since 1970/1/1 to give the correct return value of mp_hal_time_ns. Signed-off-by: Damien George <damien@micropython.org>
2020-08-30unix/variants: Fix fast and freedos variants so they build again.Damien George
This regressed in bd2fff66875ed5adab8ce163a7f2bdafbd0332f9 Signed-off-by: Damien George <damien@micropython.org>
2020-08-30extmod/modlwip: Fix error return for TCP recv when not connected.Damien George
This commit fixes the cases when a TCP socket is in STATE_NEW, STATE_LISTENING or STATE_CONNECTING and recv() is called on it. It now raises ENOTCONN instead of a random error code due to it previously indexing beyond the start of error_lookup_table[]. Signed-off-by: Damien George <damien@micropython.org>
2020-08-29all: Update Python code to conform to latest black formatting.Damien George
Updating to Black v20.8b1 there are two changes that affect the code in this repository: - If there is a trailing comma in a list (eg [], () or function call) then that list is now written out with one line per element. So remove such trailing commas where the list should stay on one line. - Spaces at the start of """ doc strings are removed. Signed-off-by: Damien George <damien@micropython.org>
2020-08-29tests: Split out complex reverse-op tests to separate test file.Damien George
So they can be skipped if __rOP__'s are not supported on the target. Also fix the typo in the complex_special_methods.py filename. Signed-off-by: Damien George <damien@micropython.org>
2020-08-29stm32/powerctrl.h: Include stdbool.h to get definition of bool.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-08-29LICENSE,docs: Update copyright year range to include 2020.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-08-28zephyr/README: Update required Zephyr version and mention new features.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2020-08-27extmod/machine_i2c: Fix buffer overrun if 'addrsize' is bigger than 32.Michael Buesch
The memory operation functions read_mem() and write_mem() create a temporary buffer on the local C stack for the address bytes with the size of 4 bytes. This buffer is filled in a loop from the user supplied address and address length. If the user supplied 'addrsize' is bigger than 32, the local buffer is overrun. Fix this by raising an exception for invalid 'addrsize' values. Signed-off-by: Michael Buesch <m@bues.ch>
2020-08-27tests/run-tests: Make test output directory configurable.stijn
A configurable result directory is advantageous because it enables using a dedicated location, eventually outside of the source tree, instead of forcing the output files into a fixed directory which might also contain other files already. For that reason the default output directory also has been changed to tests/results/.