summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-03-25mimxrt: Enable default devices for I2C, SPI and UART.robert-hh
Since all boards are configured to have a I2C(0), SPI(0) and UART(1), these can be set as default devices, allowing the instantiation of I2C(), SPI(), UART() without an id argument. Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25mimxrt/machine_i2c: Support the timeout keyword argument.robert-hh
Set the default timeout to 50000 us. The default used to be 0, causing the NXP I2C driver to silently stop working in case of a non-responding device. Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25mimxrt/machine_uart: Fix rx/tx buffer allocation bug.robert-hh
The buffer would be reset on every call to `uart.init()`. If no sizes were given, the buffer would be set to the default size 256. That made problems e.g. with PPP. Also, the RX buffer was not stored at the UART object and not visible to GC as being in use. Then a `gc.collect()` would eventually free the buffer. This commit fixes those issues, keeping the buffer size if not deliberately changed and allocating new buffers only if the size was changed. Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25mimxrt/hal/qspi_nor_flash_config: Use a safe common CS timing.robert-hh
The flash devices used by the MIMXRT board are specified either with 3ns or 5 ns CS setup and hold time. Since a single configuration file is used for all boards, use 5ns instead of 3ns to be safe, even if there were no problems so far. Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25mimxrt/machine_uart: Remove duplicate init and make IRQ optional.robert-hh
Changes: - The duplicate LPUART_Init call was not needed, just an edit fail. - Allow a port to disable UART.irq(). Some code for configuration stays, but the respective UART IRQ is not enabled. Calling uart.irq() will cause an exception by extmod/machine_uart.c. Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25mimxrt/mpconfigport: Enable PPP for boards with lwIP.robert-hh
PPP is now enabled on all boards with Ethernet support. PPP could be enabled for other boards without Ethernet like the Teensy 4.0 as well in a second step. Enabling for MIMXRT101x boards is hardly possible due to the large RAM demand of lwIP. Tested with a Teensy 4.1 board and a SimCom A7608 GPRS/LTE modem. Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25mimxrt/mpconfigport: Enable support for exFAT.robert-hh
There is plenty of room in the MIMXRT board flash, so it can be enabled. Tested with: - MIMXRT1176_EVK - MIMXRT1061 (Teensy 4.1) - MIMXRT1010 (Olimex RT1010) Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-25mimxrt/machine_adc: Add ADC.read_uv() method.robert-hh
Matching the generic documentation. Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-17mimxrt/boards/MAKERDIARY_RT1011_NANO_KIT: Add new Makerdiary board.robert-hh
This is a board based on the i.MX RT1011 in breadboard-friendly shape. A good basic board with 16M flash and regular pinout, providing access to many GPIO_nn and GPIO_AD_nn Pins. Signed-off-by: robert-hh <robert@hammelrath.com>
2025-03-17tools/ci.sh: Do not assume the Python interpreter is called "python".Alessandro Gatti
This commit removes the assumption made by the CI scripts that the system-provided python executable is simply named "python". The scripts will now look for a binary called "python3" first, and then fall back to "python" if that is not found. Whilst this is currently the case for the CI environment, there are no guarantees for this going forward. For example minimal CI environments set up by some developers, using the same base OS, have their python executable called "python3". Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-03-17tools/ci.sh: Build Xtensa natmods as part of the CI process.Alessandro Gatti
This commit expands the CI tests by checking whether the example native modules are able to be built for the Xtensa architecture. This was made possible by the changes to mpy_ld that allow symbol resolution across standard compiler-provided libraries. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-03-17tools/mpy_ld.py: Allow linking static libraries.Volodymyr Shymanskyy
This commit introduces an additional symbol resolution mechanism to the natmod linking process. This allows the build scripts to look for required symbols into selected libraries that are provided by the compiler installation (libgcc and libm at the moment). For example, using soft-float code in natmods, whilst technically possible, was not an easy process and required some additional work to pull it off. With this addition all the manual (and error-prone) operations have been automated and folded into `tools/mpy_ld.py`. Both newlib and picolibc toolchains are supported, albeit the latter may require a bit of extra configuration depending on the environment the build process runs on. Picolibc's soft-float functions aren't in libm - in fact the shipped libm is nothing but a stub - but they are inside libc. This is usually not a problem as these changes cater for that configuration quirk, but on certain compilers the include paths used to find libraries in may not be updated to take Picolibc's library directory into account. The bare metal RISC-V compiler shipped with the CI OS image (GCC 10.2.0 on Ubuntu 22.04LTS) happens to exhibit this very problem. To work around that for CI builds, the Picolibc libraries' path is hardcoded in the Makefile directives used by the linker, but this can be changed by setting the PICOLIBC_ROOT environment library when building natmods. Signed-off-by: Volodymyr Shymanskyy <vshymanskyi@gmail.com> Co-authored-by: Alessandro Gatti <a.gatti@frob.it>
2025-03-14shared/runtime/pyexec: Add helper function to execute a vstr.iabdalkader
Add `pyexec_vstr()` to execute Python code from a vstr source. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-03-14tests/multi_pyb_can: Add multitests for pyboard CAN controller.Angus Gratton
Currently only classic CAN, but tests run on both the stm32 classic CAN controller and the FD-CAN controller with the same results. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-03-14stm32/can: Refactor can.h API to not depend on pyboard can types.Angus Gratton
This is necessary for the machine.CAN implementation to use the same low-level functions. Includes some refactoring around FIFO selection as there was a footgun where CAN_FIFO0/1 are 0/1 but FDCAN_RX_FIFO0/1 are not. Added an explicit type for non-hardware-specific FIFO numbering. Also moved responsibility for re-enabling CAN receive interrupts into the higher layer (pyb_can.c layer) after calling can_receive(). Also includes this behaviour change for FDCAN boards: - Fix for boards with FDCAN not updating error status counters (num_error_warning, num_error_passive, num_bus_off). These are now updated the same as on boards with CAN Classic controllers, as documented. - Previously FDCAN boards would trigger the RX callback function on error events instead (passing undocumented irq numbers 3, 4, 5). This behaviour has been removed in favour of the documented behaviour of updating the status counters. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-03-13stm32/boards/ARDUINO_PORTENTA_H7: Enable 4MiB ROMFS part in ext flash.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-03-13stm32/boards/ARDUINO_NICLA_VISION: Enable 4MiB ROMFS part in ext flash.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-03-13stm32/boards/ARDUINO_GIGA: Enable 4MiB ROMFS partition in ext flash.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-03-13esp8266: Rename ROMFS partition config variables to include "part0".Damien George
For consistency with the stm32 port. Signed-off-by: Damien George <damien@micropython.org>
2025-03-13stm32: Rename ROMFS partition config variables to start at index 0.Damien George
Change ROMFS partition configuration variables to use index 0 as the starting partition number (instead of index 1). Reasons to do this: - `vfs.rom_ioctl()` numbers the partitions starting from 0 - `mpremote romfs -p <partition id>` numbers the partitions starting from 0 Signed-off-by: Damien George <damien@micropython.org>
2025-03-13rp2/boards/SEEED_XIAO_RP2350: Add new Seeed XIAO board definition.Lesords
Signed-off-by: Lesords <2385342343@qq.com>
2025-03-13rp2/boards/SPARKFUN_XRP_CONTROLLER_BETA: Fix XRP Controller Beta URL.Dryw Wade
Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
2025-03-13rp2/boards/SPARKFUN_XRP_CONTROLLER: Add SparkFun XRP Controller.Dryw Wade
Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
2025-03-13rp2/boards/WEACTSTUDIO_RP2350B_CORE: Add WeAct Studio RP2350B Core.Matt Trentini
Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
2025-03-13rp2/boards/SPARKFUN_IOTREDBOARD_RP2350: Add support for IoT RedBoard.Alex Brudner
Signed-off-by: Alex Brudner <alex.brudner@sparkfun.com> Signed-off-by: Malcolm McKellips <malcolm.mckellips@sparkfun.com>
2025-03-13rp2/modrp2: Fix rp2.bootsel_button() function for RP2350.Phil Howard
Co-authored-by: graham sanderson <graham.sanderson@raspberrypi.com> Signed-off-by: Phil Howard <github@gadgetoid.com>
2025-03-13esp32/machine_pin: Fix availability of USB Serial/JTAG pins on ESP32-C6.Angus Gratton
Similar to parent commit, allow using USB Serial/JTAG pins for other purposes but only if this feature is disabled in the build config. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-03-13esp32/machine_pin: Fix logic clearing USB_SERIAL_JTAG_USB_PAD_ENABLE.Garry W
When we don't use USB JTAG, we want to use the two USB pins (D+/D-) as GPIO. So, do clear USB_SERIAL_JTAG_USB_PAD_ENABLE when USB SERIAL JTAG is not enabled Signed-off-by: Garry W <32130780+garywill@users.noreply.github.com> Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-03-13esp32/machine_pwm: Correctly stop LEDC timer.garywill
The ESP32 PWM (LEDC) timer wasn't correctly stopped. `ledc_timer_rst()` is for resetting the timer counter to zero, not for stopping the timer. The correct way to stop a pwm timer is to pause it, then configure it with `deconfigure = true`. Signed-off-by: garywill <garywill@disroot.org>
2025-03-13esp32/boards: Enable machine.SDCard on all boards.Angus Gratton
This increases binary size by about 4KB on C3, probably a bit less on S2. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-03-13esp32/machine_sdcard: Add SDCard SPI mode support for ESP32-S2,C3,C6.Angus Gratton
These micros don't have full SDMMC host support, but they can initialise the SDCard in SPI mode. A bit limited on C3 and C6 as they only have one host SPI peripheral. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-03-13esp32/machine_sdcard: Add SDCard pin assignments for ESP32-S3 support.Angus Gratton
Previously ESP32-S3 SDMMC could only use fixed pin assignments, however the ESP-IDF defaults don't match common boards. The chip also supports using GPIO Matrix to assign any pin. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-03-13esp32: Remove the ESP32 ringbuffer linker workaround.Angus Gratton
Reverts workaround added in acbdbcd9. According to the linked ESP-IDF issue this was only a problem for ESP-IDF V5.0.x, and support for versions older than V5.2 was dropped in 6e5d8d009. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-03-13esp32: Merge the per-SoC "main" components back together.Angus Gratton
Removes redundant metadata from each, shouldn't otherwise change any build output. Reverts the split originally added in e4650125. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-03-12extmod/network_cyw43: Add WPA3 security constants.Damien George
These are now supported by cyw43-driver. Signed-off-by: Damien George <damien@micropython.org>
2025-03-12lib/cyw43-driver: Update driver to latest version v1.1.0.Damien George
Includes various fixes and improvements to the WLAN driver, in particular: - Add WPA3 STA and AP support. - Attempt to reconnect to AP in response to validation error. - Update 43439 BT firmware for Data Length Extension fix. Signed-off-by: Damien George <damien@micropython.org>
2025-03-07zephyr/machine_timer: Add machine.Timer class implementation.danicampora
Simple `machine.Timer` implementation in-line with the rest of the MicroPython ports. Note: Only virtual timers are supported (not linked to any particular hardware peripheral). Tested with the nRF5340 and the nRF52840. Signed-off-by: danicampora <danicampora@gmail.com>
2025-03-06unix/main: Add coverage test for mounting ROMFS filesystem at startup.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-03-06esp8266/boards: Add FLASH_2M_ROMFS variant with 320k ROM partition.Damien George
The same as the 2M flash variant but with a 320KiB ROM partition. Signed-off-by: Damien George <damien@micropython.org>
2025-03-06esp8266: Implement vfs.rom_ioctl with support for external flash.Damien George
Not enabled by default on any board. For a board to enable ROMFS it must: - Add `#define MICROPY_VFS_ROM (1)` to its `mpconfigboard.h` file. - Add a FLASH_ROMFS partition to the linker script and expose the partition with: _micropy_hw_romfs_start = ORIGIN(FLASH_ROMFS); _micropy_hw_romfs_size = LENGTH(FLASH_ROMFS); Signed-off-by: Damien George <damien@micropython.org>
2025-03-06esp32: Implement vfs.rom_ioctl with support for external flash.Damien George
Not enabled by default on any board. For a board to enable ROMFS it must: - Add `#define MICROPY_VFS_ROM (1)` to its `mpconfigboard.h` file. - Use `partitions-4MiB-romfs.csv` as its partitions file (or a similar partitions definition that has an entry labelled "romfs"). Signed-off-by: Damien George <damien@micropython.org>
2025-03-06rp2: Implement vfs.rom_ioctl with support for external flash.Damien George
Not enabled by default on any board. A board can enable a ROMFS partition by defining `MICROPY_HW_ROMFS_BYTES` in its `mpconfigboard.h` file. For example: #define MICROPY_HW_ROMFS_BYTES (128 * 1024) The ROMFS partition is placed at the end of the flash allocated for the firmware, giving less space for the firmware. It then lives between the firmware and the read/write filesystem. Signed-off-by: Damien George <damien@micropython.org>
2025-03-06stm32/boards: Enable ROMFS partitions on PYBD_SFx boards.Damien George
Using unused and previously inaccessible external QSPI flash. Signed-off-by: Damien George <damien@micropython.org>
2025-03-06stm32: Implement vfs.rom_ioctl with support for internal/external flash.Damien George
This commit implements `vfs.rom_ioctl()` to query, erase and write both internal and external flash, depending on how the board configures its flash memory. A board can configure ROM as follows. To use internal flash memory: #define MICROPY_HW_ROMFS_ENABLE_INTERNAL_FLASH (1) To use external flash memory (QSPI memory mapped): #define MICROPY_HW_ROMFS_ENABLE_EXTERNAL_QSPI (1) #define MICROPY_HW_ROMFS_QSPI_SPIFLASH_OBJ (&spi_obj) Then the partition must be defined as symbols in the linker script: _micropy_hw_romfs_part1_start _micropy_hw_romfs_part1_size And finally the partition needs to be enabled: #define MICROPY_HW_ROMFS_ENABLE_PART1 (1) There's support for a second, optional partition via: _micropy_hw_romfs_part2_start _micropy_hw_romfs_part2_size #define MICROPY_HW_ROMFS_ENABLE_PART1 (1) Signed-off-by: Damien George <damien@micropython.org>
2025-03-06tools/mpremote: Add romfs query, build and deploy commands.Damien George
These commands use the `vfs.rom_ioctl()` function to manage the ROM partitions on a device, and create and deploy ROMFS images. Signed-off-by: Damien George <damien@micropython.org>
2025-03-06py/runtime: Automatically mount ROMFS as part of mp_init.Damien George
This is put in `mp_init()` to make it consistent across all ports. Signed-off-by: Damien George <damien@micropython.org>
2025-03-06extmod/vfs: Add mp_vfs_mount_romfs_protected() helper.Damien George
This function will attempt to create a `VfsRom` instance and mount it at location "/rom" in the filesystem. Signed-off-by: Damien George <damien@micropython.org>
2025-03-06extmod/modvfs: Add vfs.rom_ioctl function and its ioctl constants.Damien George
This is a generic interface to allow querying and modifying the read-only memory area of a device, if it has such an area. Signed-off-by: Damien George <damien@micropython.org>
2025-03-06py/objarray: Add MP_DEFINE_MEMORYVIEW_OBJ convenience macro.Damien George
This allows defining a `memoryview` instance, either statically or on the C stack. Signed-off-by: Damien George <damien@micropython.org>
2025-03-06nrf/modules: Fix access of read-only buffer in Flash.writeblocks.Damien George
When writing to flash, the source buffer only needs to be read-only, not writable. This fix allows passing in `bytes` and other read-only buffer objects. Signed-off-by: Damien George <damien@micropython.org>