summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-07-12py/scheduler: De-inline and fix race with pending exception / scheduler.Jim Mussared
The optimisation that allows a single check in the VM for either a pending exception or non-empty scheduler queue doesn't work when threading is enabled, as one thread can clear the sched_state if it has no pending exception, meaning the thread with the pending exception will never see it. This removes that optimisation for threaded builds. Also fixes a race in non-scheduler builds where get-and-clear of the pending exception is not protected by the atomic section. Also removes the bulk of the inlining of pending exceptions and scheduler handling from the VM. This just costs code size and complexity at no performance benefit. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-07-11stm32/sdram: Include boardctrl.h for fatal-error handler.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-07-08stm32/boardctrl: Allow boards to override fatal-error handler.Damien George
To override it a board must define MICROPY_BOARD_FATAL_ERROR to a function that takes a string message and does not return. Signed-off-by: Damien George <damien@micropython.org>
2022-07-08esp8266/boards: Enable reverse-special-methods on GENERIC board.Damien George
It increases the firmware size by 292 bytes. Addresses issue #5897. Signed-off-by: Damien George <damien@micropython.org>
2022-07-08esp32/modmachine: Fix machine.freq to allow maximum 160MHz on ESP32-C3.Damien George
Fixes issue #8824. Signed-off-by: Damien George <damien@micropython.org>
2022-07-08tools/mpremote: Don't be verbose when using cat command.Damien George
Fixes issue #8828. Signed-off-by: Damien George <damien@micropython.org>
2022-07-08tools/pyboard.py: Add verbose option to filesystem_command.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-07-08drivers/lps22h: Use machine.idle for power saving.iabdalkader
All machine modules should have an idle function.
2022-07-08nrf/modmachine: Add machine.idle() function.iabdalkader
This improves the compatibility of the nrf port machine module with common drivers, by adding a machine.idle() alias for lightsleep.
2022-07-07nrf/boards/arduino_nano_33_ble: Add Arduino Nano 33 BLE sense board.iabdalkader
2022-07-07drivers/lps22h: Add LPS22HB/HH pressure sensor driver.iabdalkader
2022-07-07drivers/lsm9ds1: Add LSM9DS1 IMU driver.iabdalkader
2022-07-07drivers/hts221: Add HTS221 humidity sensor driver.iabdalkader
2022-07-05nrf/Makefile: Drop unused MPY_CROSS and MPY_TOOL variables.David Lechner
These variables are no longer used in the nrf Makefile and can be removed. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-05stm32/mboot: Remove redundant code in mboot_state_change function.Damien George
This code was made redundant in 87fbceef2649b15d40cc8aaf4e5957af537ce9af Signed-off-by: Damien George <damien@micropython.org>
2022-07-05unix/moduos: Include errno.h.David Lechner
The file `ports/unix/moduos.c` uses `errno` so it needs to include `errno.h`, otherwise a compiler error can occur. Signed-off-by: David Lechner <david@pybricks.com>
2022-07-05esp32,esp8266: Rename WLAN dhcp_hostname config to hostname.IhorNehrutsa
But retain old name for backwards compatibility.
2022-07-05rp2/boards/ARDUINO_NANO_RP2040_CONNECT: Add urequests module.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-07-05rp2/CMakeLists: Don't override cyw43-driver unless necessary.Jim Mussared
This supresses a warning from pico-sdk when the board isn't using this driver. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-07-05rp2/CMakeLists: Give error if required submodules are missing.Jim Mussared
Ensure that nimble and cyw43-driver are initialised when the board requires it. Also make these work with `make submodules`. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-07-05rp2/Makefile: Regenerate cmake if generated Makefile missing.Jim Mussared
`CMakeCache.txt` can exist even if cmake failed. Use `Makefile` instead. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-07-05rp2/mpconfigport: Factor core event handling to EVENT_POLL_HOOK_FAST.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-07-05rp2/main: Set default AP auth mode to WPA2_AES_PSK.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-07-05extmod/network_cyw43: Add "security" config option to get/set auth mode.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-07-05lib/cyw43-driver: Update cyw43-driver to fix ap_auth mode setting.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-07-05rp2/boards/GARATRONIC_PYBSTICK26_RP2040: Change pico-sdk board name.Damien George
This follows a similar renaming in pico-sdk. Signed-off-by: Damien George <damien@micropython.org>
2022-07-02stm32/Makefile: Fix setting of define that enables WIZNET5K driver.Jim Mussared
Commit 9670a156dabc1c751a6b02ef280daccf5a0ed213 missed one renaming of MICROPY_PY_WIZNET5K to MICROPY_PY_NETWORK_WIZNET5K which prevented the Wiznet interface from being enabled. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-06-30rp2/boards/PICO_W: Add new Pico W board, an RP2040 with WiFi.Damien George
Work done in collaboration with Graham Sanderson and Peter Harper. Signed-off-by: Damien George <damien@micropython.org>
2022-06-30rp2: Integrate CYW43xx WiFi driver.Damien George
This includes: - Configuration file for the cyw43-driver. - Integration of cyw43-driver into the build, using lwIP. - Enhancements to machine.Pin to support extension IO pins provided by the CYW43xx. - More mp-hal pin helper functions. - mp_hal_get_mac_ascii MAC address helper function. - Addition of rp2.country() function to set the country code. A board can enable this driver by setting MICROPY_PY_NETWORK_CYW43 in their cmake snippet. Work done in collaboration with Graham Sanderson and Peter Harper. Signed-off-by: Damien George <damien@micropython.org>
2022-06-30rp2/mpnetworkport: Convert network task scheduling to use PendSV IRQ.Damien George
It is more reliable and scales better when more components need it. Work done in collaboration with Graham Sanderson and Peter Harper. Signed-off-by: Damien George <damien@micropython.org>
2022-06-30rp2/rp2_flash: Add asserts for size of flash filesystem partition.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-06-30rp2/lwip_inc: Enable lwIP status callback.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-06-30rp2/mbedtls: Enable some more mbedtls options.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-06-30lib/pico-sdk: Update to version 1.4.0.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-06-30lib/cyw43-driver: Add new submodule for CYW43xx WiFi driver.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-06-30extmod/modnetwork: Include cyw43-driver header if it's enabled.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-06-30extmod/network_cyw43: Support new cyw43-driver.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-06-30extmod/vfs: Prevent uninitialized variable warning for path_out.Damien George
The warning can appear when building in Release mode on the rp2 port. Signed-off-by: Damien George <damien@micropython.org>
2022-06-30py/mkrules.cmake: Improve printing of git-submodules error.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-06-30rp2/mpthreadport: Ensure core1 doesn't hold gc lock in deinit.Jim Mussared
Prior to this commit the following code would lock up the device when Ctrl-D is entered at the REPL: import gc, _thread def collect_thread(): while True: gc.collect() _thread.start_new_thread(collect_thread, []) Fixes part of #8494. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-06-30rp2/modmachine: Implement lightsleep() with optional sleep period.Damien George
This gets basic machine.lightsleep([n]) behaviour working on the rp2 port. It supports: - Calling lightsleep without a specified period, in which case it uses xosc dormant mode. There's currently no way to wake it up from this state, unless you write to raw registers to enable a GPIO wake up source. - Calling lightsleep with a period n in milliseconds. This period must be less than about 72 minutes and uses timer alarm3 to wake it up. The RTC continues to run during lightsleep, but other peripherals have their clock turned off during the sleep. It doesn't yet support longer periods than 72 minutes, or waking up from GPIO IRQ. Measured current consumption from the USB port on a PICO board is about 1.5mA when doing machine.lightsleep(5000), and about 0.9mA when doing machine.lightsleep(). Addresses issue #8770. Signed-off-by: Damien George <damien@micropython.org>
2022-06-29tests/micropython: Add test for builtin execfile() function.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-06-29unix/variants/dev: Allow all config options to be overridden.Damien George
They can be overridden on the make command line, for example. Signed-off-by: Damien George <damien@micropython.org>
2022-06-29unix/variants/coverage: Change config to use ROM level everything.Damien George
This ROM level is not yet fully defined, but it at least enables MICROPY_PY_SYS_TRACEBACKLIMIT. The coverage build should have everything enabled, so it makes sense to use this ROM level for it. Signed-off-by: Damien George <damien@micropython.org>
2022-06-29unix/variants: Enable remaining options on dev,coverage from ROM extra.Damien George
So that the default configuration for the dev and coverage variants includes all options set by MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES. Note that enabling MICROPY_PY_SYS_STDIO_BUFFER on unix doesn't do anything because unix doesn't use shared/runtime/sys_stdio_mphal.c. Signed-off-by: Damien George <damien@micropython.org>
2022-06-29unix/variants: Move setting of MICROPY_PY_USELECT to port config file.Damien George
The default is the same as before: MICROPY_PY_USELECT=0 and MICROPY_PY_USELECT_POSIX=1. But now this can be easily overridden at the make command-line using, eg: make VARIANT=dev CFLAGS_EXTRA=-DMICROPY_PY_USELECT=1 Signed-off-by: Damien George <damien@micropython.org>
2022-06-28py/builtinhelp: Don't show help for an MP_MODULE_ATTR_DELEGATION_ENTRY.Damien George
Otherwise it can lead to a crash. Fixes issue #8816. Signed-off-by: Damien George <damien@micropython.org>
2022-06-28tests: Fix run-perfbench parsing "no matching params" case.Angus Gratton
Signed-off-by: Angus Gratton <gus@projectgus.com>
2022-06-28tests: Add an explanation of run-perfbench.py.Angus Gratton
Also changes this file to a Markdown file. Signed-off-by: Angus Gratton <gus@projectgus.com>
2022-06-28esp32/network_wlan: Don't raise exception when scan returns no results.Damien George
Prior to this commit, running scan() without any APs available would give: >>> wl.scan() Traceback (most recent call last): File "<stdin>", line 1, in <module> RuntimeError: Wifi Unknown Error 0x0102 Signed-off-by: Damien George <damien@micropython.org>