summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-12-02rp2/mpconfigport: Enable MD5, SHA1 and cryptolib on all boards.Damien George
This fixes a regression introduced by PR #17926 / commit b5fcb33eaa682bb666c839cd4fb301175cc3564f which accidentally disabled `hashlib.sha1` and the `cryptolib` module on rp2 boards that don't have networking enabled, eg RPI_PICO. `hashlib.md5` is enabled to keep the configuration the same as boards that do have networking enabled. Signed-off-by: Damien George <damien@micropython.org>
2025-12-02rp2/rp2_pio: Fix support for pin wrapping and RP2350B upper-bank pins.Anson Mansfield
On RP2350B where there are more than 32 pins, using `pio_sm_set_pins_with_mask()` and `pio_sm_set_pindirs_with_mask()` is not correct because their arguments are `uint32_t` and higher bits get lost when `pio.gpio_base(16)` is used. This commit fixes the issue by using the 64-bit API functions on RP2350B. It also makes sure pin wrapping is supported, i.e. using [30, 31, 0, 1] or [46, 47, 16, 17] as contiguous pin ranges for a PIO program. Fixes issue #16199. Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
2025-12-01rp2/rp2_dma: Properly close DMA channels.Dryw Wade
Clears the control registers and aborts the closed channel upon a call to `.close()` and `.__del__()` (GC collect). Fixes issue #18446. Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
2025-12-01rp2: Add HSTX alternate function.Dryw Wade
A follow up to 40df95357c7b3270dc60421a0078fd73b122473f / PR #17692, this commit adds the HSTX alternate pin function for GPIO12-19 on the RP2350. Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
2025-12-01rp2/main: Add guard around machine_i2s_init0().David Lechner
Add a #if MICROPY_PY_MACHINE_I2S guard around the call to machine_i2s_init0() in ports/rp2/main.c. This matches the existing guard around machine_i2s_deinit_all() in the same function. Signed-off-by: David Lechner <david@pybricks.com>
2025-12-01rp2/boards/WEACTSTUDIO_RP2350B_CORE: Add board.pinout.Matt Trentini
This adds an ANSI-rendered pinout for the WeAct Studio RP2350B Core board. Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
2025-12-01esp32/boards/SOLDERED_NULA_MINI: Add new board definition.Josip Šimun Kuči
Add support for the upcoming Soldered NULA Mini ESP32C6 board by Soldered Electronics. Signed-off-by: Josip Šimun Kuči <josipsimunkuci@gmail.com>
2025-12-01esp32/mphalport: Enable D-cache flushing on P4 for native code.Damien George
This is necessary to get native code running on the ESP32-P4. Signed-off-by: Damien George <damien@micropython.org>
2025-12-01py/emitglue: Add hook for RV32 arch to flush D-cache for native emitter.Damien George
Eventually this cache flushing mechanism should be generalised to work the same way for all architectures. But for now, this allows ESP32 RV32 SoCs to flush the D-cache whenn needed. Signed-off-by: Damien George <damien@micropython.org>
2025-12-01esp32/usb_serial_jtag: Flush usb_serial_jtag TXFIFO from ISR.Angus Gratton
This was necessary to un-wedge the USJ TX path on ESP32-P4, I think because the bootloader prints a lot on this chip. I think it might be possible to hit it on other chips, though. The implementation is based on the ESP-IDF driver, which will always add an extra flush when the TXFIFO is empty in case the host is expecting a ZLP. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-12-01esp32/boards/ESP32_GENERIC_P4: Add board definition for ESP32P4.Vincent1-python
Includes a base variant with LAN, and C5_WIFI and C6_WIFI variants with LAN, WiFi and BLE. And builds this board in the esp32 CI, to cover the P4 support. Signed-off-by: Vincent1-python <pywei201209@163.com> Signed-off-by: Angus Gratton <angus@redyak.com.au> Signed-off-by: Damien George <damien@micropython.org>
2025-12-01esp32: Add support for ESP32-P4.Vincent1-python
This commit adds support for ESP32-P4 SoCs. Signed-off-by: Vincent1-python <pywei201209@163.com> Signed-off-by: Angus Gratton <angus@redyak.com.au> Signed-off-by: Damien George <damien@micropython.org>
2025-11-30esp32: Support building with network and/or bluetooth disabled.Angus Gratton
(and a smaller binary size as a result) Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-11-30shared/tinyusb: Remove USBD_RHPORT constant.Angus Gratton
TinyUSB defines TUD_OPT_RHPORT which is the same thing, make shorter definition RHPORT in the two files which use it. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-11-30pyproject.toml: Update ruff configuration to target Python 3.8.Jos Verlinde
As per 4c9ce826cbfbd99cff10cc933064f87a13bee4ac the tests now target Python 3.8 syntax and features, so update the ruff configuration to match. Changes in this commit: - Update to Python 3.8 syntax. - Ignore import not at top of module warnings. - Exclude common SDK folders. - Exclude cpydiff test with intentional error. Also see: https://github.com/micropython/micropython-lib/pull/1059 Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
2025-11-30tools/ci.sh: Build all stm32 MCU families in stm32 CI functions.Damien George
Currently the CI for stm32 only tests building about half of the available MCU families. This commit adds the remaining families to the stm32 CI jobs. Signed-off-by: Damien George <damien@micropython.org>
2025-11-30tools/ci.sh: Install latest ARM toolchain for stm32 CI.Damien George
This is needed to build Cortex-M55 (STM32N6) based boards. Signed-off-by: Damien George <damien@micropython.org>
2025-11-30stm32/usbd_conf: Fix build for boards with USB disabled.Damien George
Some boards (eg NUCLEO_G0B1RE and NUCLEO_G474RE) have USB disabled but still configure MICROPY_HW_USB_FS/HS for the cases where USB does get enabled. Such a configuration should not build any of the code in `usbd_conf.c`, nor the USB interrupt handlers. Signed-off-by: Damien George <damien@micropython.org>
2025-11-29stm32/rtc: Make sure RTC is using LSE on N6 MCUs.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-11-29stm32: Fix init sequence of USB hardware and TinyUSB stack.Damien George
This commit fixes the initialization sequence for TinyUSB when enabled on the stm32 port: - Following other ports, `mp_usbd_init()` should be called just after running `boot.py`, to give the user a chance to configure USB. - Hardware initialization (via `pyb_usbd_init()`) should only occur once, the first time TinyUSB is started up. This is achieved by adding a hook to the shared TinyUSB bindings to call `pyb_usbd_init()`, and only do the hardware init if TinyUSB was not already initialized. Also, `pyb_usbd_init()` is renamed `mp_usbd_ll_init()` to make it match with the rest of the stared TinyUSB binding code. Signed-off-by: Damien George <damien@micropython.org>
2025-11-29stm32/usbd_conf: Clean up USBD hardware initialization functions.Damien George
Break the FS and HS initialization routines out into separate functions, and call them as necessary from the TinyUSB or STM USB helper functions. Signed-off-by: Damien George <damien@micropython.org>
2025-11-29shared/tinyusb: Add optional port-specific hook on USBD init.Damien George
This allows a port to do hardware initialization just before the TinyUSB stack is brought up. That means the hardware is only turned on when it's needed. Signed-off-by: Damien George <damien@micropython.org>
2025-11-29stm32/boards/WEACTSTUDIO_MINI_STM32H743: Add WeAct H743VI board support.Yuuki NAGAO
This change adds WeAct Studio Mini STM32H743 board support to the STM32 port. Some of the work from PR #12540 is combined here. WeAct Studio Mini STM32H43 board: https://github.com/WeActStudio/MiniSTM32H7xx This board uses STM32H743VI: https://www.st.com/en/microcontrollers-microprocessors/stm32h743vi.html Signed-off-by: Yuuki NAGAO <wf.yn386@gmail.com>
2025-11-27stm32/boards/STM32F469DISC: Add board.json file.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-11-27stm32/boards/STM32F469DISC: Add new board definition files.Mike Tolkachev
Signed-off-by: Mike Tolkachev <contact@miketolkachev.dev>
2025-11-27stm32: Add support for STM32F469xx MCUs.Mike Tolkachev
Signed-off-by: Mike Tolkachev <contact@miketolkachev.dev>
2025-11-27stm32/mpconfigboard_common: Define TinyUSB MCU type for N6.iabdalkader
Allows using TinyUSB stack on N6. Note there's still an issue with TinyUSB on the N6: `pyb_usbd_init()` can't be called multiple times (on soft-reboot). Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-11-27github/workflows: Test mpy-cross debug emitter.Alessandro Gatti
This commit adds a new workflow step to the CI, to test the debug emitter provided by mpy-cross. The checks being done are limited to make sure that the debug emitter does not crash and emits opcodes for a simple test file that is guaranteed to work for all configurations. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-11-27py/compile: Allow NULL emitter table entries.Alessandro Gatti
This commit fixes a regression introduced in 1b92bda5b8e5e2db8e57c4b7134930e52bc5207a, where a new architecture was added to mpy-cross but it had no matching native emitter exists. The result was that the architecture emitter entry point would be correctly calculated according to the native architecture index, but if the emitters entry points table was not updated to match the new number of architectures an out of bound access may be performed. Unfortunately adding RV64IMC shifted the debug emitter index further down the table, and that table wasn't updated to reflect the lack of an emitter for RV64. Adding a NULL entry there would cause a NULL pointer access as there was no need to perform any check about the emitter entry point function's validity until now. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-11-26zephyr: Add support for GC split-heap.Vdragon
Adds the ability to use PSRAM and non-contiguous memory. Example usage, add this to dts overlay: / { heap_psram { compatible = "micropython,heap"; size = <DT_SIZE_M(4)>; memory-region = <&psram>; }; heap_sram1 { compatible = "micropython,heap"; size = <DT_SIZE_K(140)>; memory-region = <&sram1>; }; }; Signed-off-by: Vdragon <mail@massdriver.space>
2025-11-26zephyr: Allow a custom dts.Vdragon
Allows using custom DTS things such as bindings. Signed-off-by: Vdragon <mail@massdriver.space>
2025-11-26docs/library: Add machine.DAC documentation.Matt Trentini
Fixes issue #7915. Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
2025-11-26docs/library: Fix typos under I2CTarget irq method description.Alex Tran
There were a few typos in the documentation for the `I2CTarget.irq` method description where `IRQ_ADDR_MATCH_READ` was used, however `IRQ_ADDR_MATCH_WRITE` should have been used. Fixes issue #18470. Signed-off-by: Alex Tran <alex.t.tran@gmail.com>
2025-11-26docs/library: Document OrderedDict.popitem()'s CPython differences.Jos Verlinde
Fixes issue #18370. Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
2025-11-26tools/ci.sh: Add zsh and fish shell completion support.Alessandro Gatti
This commit adds custom command completion functions for both the zsh and fish shell. The behaviour for those new completions follow the existing completion for the bash shell, including the way to generate the completion alias (with appropriately named command line switches). Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-11-26unix/modsocket: Add IP ADD and DROP MEMBERSHIP to socket constants.Alex Tran
Add the IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP to modsocket in the Unix port so that the directives take on the values defined in the system headers. This is needed because the values of these directives are different for MacOS vs other Unix systems. Fixes issue #8456. Signed-off-by: Alex Tran <alex.t.tran@gmail.com>
2025-11-26github/workflows: Bump actions/checkout from 5 to 6.dependabot[bot]
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
2025-11-25tests/multi_espnow: Add test case for espnow rate changes.Angus Gratton
Uses constants added in previous commit. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-11-25esp32,docs: Add constants and documentation for espnow data rates.Angus Gratton
Changes are: - Add constants for some of the supported ESP-NOW data rates. - Add constants for switching an ESP32 WLAN radio in/out of Long Range mode. - Document the new constants and their usage. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-11-25esp32/modespnow: Fix espnow rate setting.Angus Gratton
Only set the rate on interfaces that are active. It seems ESP-IDF 5.4.x or so added checks that the interface is enabled, whereas previous versions silently did nothing. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-11-25esp32/README: Update the README details to account for newer chips.Angus Gratton
Noted while adding C2 support that some of these comments are a bit out of date. Spun out to its own commit, and also mention C5 as well. This change also adds some recommendation on which ESP32 board to pick, as we occasionally see issues or questions that would be non-issues on a board with more RAM (and for small production or personal projects the savings of picking a cheaper ESP32 chip are basically neglible). This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-11-24shared/tinyusb: Remove macro guard for tx_overwritabe_if_not_connected.Damien George
It's now available in the version of TinyUSB used by this repository. Also, update to the newer `tud_cdc_configure_t` struct name and newer `tud_cdc_configure()` function name. Signed-off-by: Damien George <damien@micropython.org>
2025-11-24lib/tinyusb: Update to version 0.19.0-24.Damien George
This is 0.19.0 plus the following changes: - remove obsolete dcd_esp32sx - fix for HID stylus descriptor and HID example - typos, docs and generator scripts - MTP fix - DWC2 enumeration when EP0 size=8 - DWC2 fix for EP0 IN - stm32 FSDEV IRQ remapping fix - DWC2 ZLP fix The reason we need the extra 24 commits is due to a bug with TinyUSB's handling of zero-length-packets in the DWC2 (Synopsis) backend, which affects the stm32 port. That's fixed by https://github.com/hathach/tinyusb/pull/3293 Signed-off-by: Damien George <damien@micropython.org>
2025-11-24nrf/drivers/usb: Provide macros for nrf errata.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-11-24tools/mpy-tool.py: Add Compiler Explorer JSON output.Anson Mansfield
This commit adds a `--json` option to `mpy-tool.py`, in order to generate Compiler-Explorer-compatible JSON annotation information for the bytecode disassembly. Some of this information might be theoretically possible to parse out from the text itself, but not all of it is, e.g. disambiguating child references with non-unique simple names. Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
2025-11-24shared/tinyusb: Add macro to override TinyUSB callbacks.iabdalkader
Add wrapper macros that by default expand to the callback name. Users can define this macro to add a prefix (e.g., mp_) to callback implementations, to redirect or completely override MicroPython's TinyUSB callbacks. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-11-22shared/runtime/pyexec: Set PYEXEC_FORCED_EXIT flag for SystemExit.Andrew Leech
When `MICROPY_PYEXEC_ENABLE_EXIT_CODE_HANDLING` is enabled, `SystemExit` now sets the `PYEXEC_FORCED_EXIT` flag in addition to the exit code. This allows the REPL to properly detect and exit when SystemExit is raised, while still preserving the exit code in the lower bits. Fixes `repl_lock.py` test which expects REPL to exit on `SystemExit`. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2025-11-22unix: Enable exit code handling for sys.exit().Andrew Leech
Enable `MICROPY_PYEXEC_ENABLE_EXIT_CODE_HANDLING` to propagate `sys.exit()` exit codes properly. Update `convert_pyexec_result()` to handle return values where pyexec returns the exit code with `PYEXEC_FORCED_EXIT` flag set for `SystemExit`. Extract the exit code from the lower 8 bits when the flag is set, otherwise return as-is (0 for success, 1 for exception). Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2025-11-22shared/runtime/pyexec: Call mp_hal_stdio_mode_orig/raw as appropriate.Damien George
This ensures that ctrl-C works on the unix port when executing code at the REPL. Signed-off-by: Damien George <damien@micropython.org>
2025-11-22unix/main: Replace execute_from_lexer with pyexec in do_file and do_str.Andrew Leech
Consolidates file and string execution to use the standard pyexec interface for consistency with other ports. Simplify execute_from_lexer for remaining usage: Remove unused LEX_SRC_VSTR and LEX_SRC_FILENAME cases, keeping only LEX_SRC_STR for REPL and LEX_SRC_STDIN for stdin execution. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>