summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-03-19stm32/boards/LEGO_HUB_NO6: Move robust logic to mboot.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2024-03-19stm32/mboot: Add support for a raw filesystem.Damien George
This is enabled by default if MBOOT_FSLOAD is enabled, although a board can explicitly disable it by `#define MBOOT_VFS_RAW (0)`. Signed-off-by: Damien George <damien@micropython.org>
2024-03-19py/emitnative: Implement viper unary ops positive, negative and invert.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2024-03-19py/asmxtensa: Optimise asm_xtensa_mov_reg_i32_optimised() for tiny ints.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2024-03-19py/asm: Add ASM_NOT_REG and ASM_NEG_REG macros for unary ops.Damien George
ASM_NOT_REG is optional, it can be synthesised by xor(reg, -1). ASM_NEG_REG can also be synthesised with a subtraction, but most architectures have a dedicated instruction for it. Signed-off-by: Damien George <damien@micropython.org>
2024-03-19docs/library/collections: Update deque docs to describe new features.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2024-03-19tests/basics: Split MicroPython-specific deque tests to separate file.Damien George
So that the MicroPython-specific behaviour can be isolated, and the CPython compatible test don't need a .exp file. Signed-off-by: Damien George <damien@micropython.org>
2024-03-19tools/mpy-tool.py: Fix merging of more than 128 mpy files.Damien George
The argument to MP_BC_MAKE_FUNCTION (raw code index) was being encoded as a byte instead of a variable unsigned int. That meant that if there were more than 128 merged mpy files the encoding would be invalid. Fix that by using `mp_encode_uint(idx)` to encode the raw code index. And also use `Opcode` constants for the opcode values to make it easier to understand the code. Signed-off-by: Damien George <damien@micropython.org>
2024-03-18py/objdeque: Expand implementation to be doubly-ended and support iter.Dash Peters
Add `pop()`, `appendleft()`, and `extend()` methods, support iteration and indexing, and initializing from an existing sequence. Iteration and indexing (subscription) have independent configuration flags to enable them. They are enabled by default at the same level that collections.deque is enabled (the extra features level). Also add tests for checking new behavior. Signed-off-by: Damien George <damien@micropython.org>
2024-03-16all: Update extmod, ports, examples to build with new berkeley-db lib.Damien George
This provides a MicroPython-specific berkeley-db configuration in extmod/berkeley-db/berkeley_db_config_port.h, and cleans up the include path for this library. Fixes issue #13092. Signed-off-by: Damien George <damien@micropython.org>
2024-03-16lib/berkeley-db-1.xx: Update submodule URL and version.Damien George
This updates the berkeley-db-1.xx submodule URL to a repository hosted under the micropython organisation, and makes the following changes: - Moves the berkeley-db header files to a single directory within the submodule, and references all these headers with a much fuller path, which prevents symbol clashes (eg with esp32 and queue.h). - Removes unused/non-working files from berkeley-db, which removes all symlinks in that repo (symlinks don't play well under Windows). - Allows injecting an external configuration header into berkeley-db, so the configuration doesn't have to be provided by -Dxx=yy flags to the compiler (and possibly clashing with other symbols). - Removes the advertising clause from the BSD 4-clause license of berkeley-db (see relevant commit and README.Impt.License.Change for details). Signed-off-by: Damien George <damien@micropython.org>
2024-03-16extmod/os_dupterm: Handle exception properly when it occurs in parallel.Felix Dörre
When an exception is handled and the stream is closed, but while this happens, another exception occurs or dupterm is deactivated for another reason, the initial deactivation crashes, because its dupterm is removed. Co-authored-by: Damien George <damien@micropython.org> Signed-off-by: Felix Dörre <felix@dogcraft.de>
2024-03-16nrf/boards: Enable MICROPY_HW_ENABLE_USBDEV on boards with USB CDC.Damien George
These boards were broken by 9d0d262be069089f01da6b40d2cd78f1da14de0f. Signed-off-by: Damien George <damien@micropython.org>
2024-03-15LICENSE: Add libmetal and open-amp to 3rd-party license list.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2024-03-15tools/ci.sh: Add Arduino GIGA to stm32 CI build.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-15docs/library/openamp: Document the new openamp module.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-15stm32/boards/ARDUINO_PORTENTA_H7: Enable OpenAMP.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-15stm32/boards/ARDUINO_NICLA_VISION: Enable OpenAMP.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-15stm32/boards/ARDUINO_GIGA: Enable OpenAMP.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-15stm32: Implement port backend for OpenAMP's remoteproc.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-15stm32: Implement port backend for libmetal.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-15extmod/modopenamp_remoteproc: Add new OpenAMP RemoteProc class.iabdalkader
RemoteProc provides an API to load firmware and control remote processors. Note: port-specific operations must be implemented to support this class. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-15extmod/modopenamp: Add new OpenAMP module.iabdalkader
This module implements OpenAMP's basic initialization and shared resources support, and provides support for OpenAMP's RPMsg component, by providing an `endpoint` type (a logical connection on top of RPMsg channel) which can be used to communicate with the remote core. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-15stm32/mpu: Add MPU config for shared, uncached memory region.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-15py/stream: Factor stream implementations.Damien George
So there's only one location that does the ioctl(MP_STREAM_SEEK) call. Signed-off-by: Damien George <damien@micropython.org>
2024-03-15py/stream: Add mp_stream_seek() helper function.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-15extmod/libmetal: Add MicroPython platform for libmetal.iabdalkader
Add a MicroPython platform for libmetal, based on the generic platform. The MicroPython platform uses common mp_hal_xxx functions and allows ports to customize default configurations for libmetal. Signed-off-by: Jim Mussared <jim.mussared@gmail.com> Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-15lib/libmetal: Add libmetal submodule.iabdalkader
libmetal provides an abstraction of the underlying hardware, to support other OpenAMP components. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-15lib/open-amp: Add OpenAMP submodule.iabdalkader
OpenAMP framework provides a standard inter processor communications infrastructure for RTOS and bare metal environments. There are 3 major components in OpenAMP: libmetal, remoteproc and RPMsg. libmetal provides abstraction of the low-level underlying hardware, remoteproc is used for processor Life Cycle Management (LCM) like loading firmware, starting, stopping a core etc., and RPMsg is a bus infrastructure that enables Inter Processor Communications (IPC) between different cores. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-15samd: Enable support for Python USB devices.Angus Gratton
This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-03-15rp2: Enable support for Python USB devices.Angus Gratton
This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-03-15extmod/machine_usb_device: Add support for Python USB devices.Angus Gratton
This new machine-module driver provides a "USBDevice" singleton object and a shim TinyUSB "runtime" driver that delegates the descriptors and all of the TinyUSB callbacks to Python functions. This allows writing arbitrary USB devices in pure Python. It's also possible to have a base built-in USB device implemented in C (eg CDC, or CDC+MSC) and a Python USB device added on top of that. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-03-15mimxrt: Define the MICROPY_HW_ENABLE_USBDEV macro.Angus Gratton
Previously USB was always enabled, but this created some conflicts when adding guards to other files on other ports. Note the configuration with USB disabled hasn't been tested and probably won't build or run without further work. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-03-15py/objstr: Add a macro to define a bytes object at compile time.Angus Gratton
This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-03-15mimxrt/mpconfigport: Enable cryptolib and hashlib md5.Kwabena W. Agyeman
Signed-off-by: Kwabena W. Agyeman <kwagyeman@live.com>
2024-03-15extmod/nimble: Check for active before setting address mode.Daniël van de Giessen
`BLE().config(addr_mode=...)` is not safe to call if the NimBLE stack is not yet active (because it tries to acquire mutexes which should be initialized first). Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2024-03-15extmod/modmachine: Add MICROPY_PY_MACHINE_RESET configuration option.Damien George
Disabled by default, but enabled on all boards that previously had `MICROPY_PY_MACHINE_BARE_METAL_FUNCS` enabled. Signed-off-by: Damien George <damien@micropython.org>
2024-03-15extmod/modmachine: Add MICROPY_PY_MACHINE_MEMX configuration option.Damien George
Enabled by default. Signed-off-by: Damien George <damien@micropython.org>
2024-03-15extmod/modmachine: Add MICROPY_PY_MACHINE_SIGNAL configuration option.Damien George
Enabled by default. Signed-off-by: Damien George <damien@micropython.org>
2024-03-14extmod/network_ninaw10: Fix error messages.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-14extmod/network_ninaw10: Set the proper security mode if none provided.iabdalkader
If no security mode is provided, use WPA for station and WEP for AP. Note only WEP is supported in AP mode. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-14extmod/network_ninaw10: Activate the NIC on demand.iabdalkader
Activate the NIC on calls to connect() or config() if it's not already active. This change makes the NINA NIC more in line with CYW43 and other NICs, which allow configuring the NIC before or after it is activated. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-09stm32/sdram: Fix MPU config to use MPU_CONFIG_NOACCESS.Damien George
Followup to 2345c1a04e6d8f8a7376c2c37c0f5248f7629bbb. Signed-off-by: Damien George <damien@micropython.org>
2024-03-09esp32/boards/ESP32_GENERIC_S3: Add 4MiB partitioning board variant.Stanislav Ponomarev
Added a 4MiB flash partitioning variant for ESP32S3: adds support for 4MiB discrete flash boards or ESP32-S3FH4R2 with embedded 4MiB flash based ones. Tested on the waveshare ESP32-S3 Mini w/ESP32-S3FH4R2. Signed-off-by: Stanislav Ponomarev <me@stasponomarev.com>
2024-03-08esp32/machine_uart: Always configure timeout_char setting in init().Daniël van de Giessen
If the `timeout_char` parameter is not given, we should still configure the UART to ensure the UART is always initialized consistently. So the default of 0 gets applied correctly, or if, for example, the baudrate was changed the char timeout isn't still based on the old baudrate causing weird behaviour, etc. Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2024-03-08esp32/network_lan: Add a separate argument to set PHY power pin.robert-hh
Prior to this commit, the pin defined for power would be used by the esp_idf driver to reset the PHY. That worked, but sometimes the MDIO configuration started before the power was fully settled, leading to an error. With the change in this commit, the power for the PHY is independently enabled in network_lan.c with a 100ms delay to allow the power to settle. A separate define for a reset pin is provided, even if the PHY reset pin is rarely connected. Fixes issue #14013. Signed-off-by: robert-hh <robert@hammelrath.com>
2024-03-08esp32/modmachine: Support bootloader on ESP32-S2/S3/C2/C3.Trent Piepho
On these targets it's possible to enter the bootloader by setting a bit in an RTC register before resetting. Structure it in a way that a board can still provide a custom bootloader handler. The handler here will be the default if none is provided, for any board based on the supported targets. Signed-off-by: Trent Piepho <tpiepho@gmail.com>
2024-03-08esp32/mpconfigport: Don't hang when machine.bootloader isn't supported.Trent Piepho
Currently only the Arduino Nano ESP32 defines a machine.bootloader handler for ESP32. All other boards will intentionally hang. There is no error message, nor is a NotImplementedError raised. There's no indication if Micropython has crashed, or if the bootloader was entered but USB is not working, which is a real problem the ESP32 bootloader has. It's not possible escape from this hang with ^C or any other means besides physical access to the reset pin or the ability to cycle power. Change this to only define an implementation of machine.bootloader() when there is a handler for it. Signed-off-by: Trent Piepho <tpiepho@gmail.com>
2024-03-08esp32: Add IDF-version-specific sdkconfig.Daniël van de Giessen
The new IDF v5.2 deprecated the task cleanup callback we use, so support for the new option has been implemented in the previous commit. This also requires a change in the sdkconfig, via a new variable ${SDKCONFIG_IDF_VERSION_SPECIFIC} which is used in all mpconfigboard.cmake files to include an extra sdkconfig file based on the IDF version in use. Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2024-03-08esp32: Add support for IDF version v5.2.Daniël van de Giessen
Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>