summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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>
2025-11-22tests/run-tests.py: Add general newline normalization function.Andrew Leech
Add a general normalize_newlines() function that handles newline variations (\\r\\r\\n, \\r\\n) to \\n while preserving literal \\r characters that are part of test content. This provides a robust solution for cross-platform test compatibility, particularly addressing PTY double-newline issues that can occur with some terminal implementations. The function is applied to all test output before comparison, eliminating platform-specific newline issues. Includes a unit test to verify the normalization behavior. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2025-11-22unix: Enable compile-only mode with shared pyexec REPL.Andrew Leech
Provides support for command line `-X compile-only` option on unix port. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2025-11-22shared/runtime/pyexec: Provide support for compile-only mode.Andrew Leech
When `MICROPY_PYEXEC_COMPILE_ONLY` is enabled and the global `mp_compile_only` is True, code is compiled but not executed. Also add comprehensive tests for compile-only functionality covering both successful compilation and syntax error detection. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2025-11-22shared/runtime/pyexec: Set __file__ for file input when enabled.Andrew Leech
When `MICROPY_MODULE___FILE__` is enabled and parsing file input, set the global `__file__` variable to the source filename. This matches the behavior of the unix port and provides the current filename to the executing script. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2025-11-22unix/main: Use standard pyexec REPL for unix and windows ports.Andrew Leech
This improves REPL usage consistency across ports, by utilizing the pyexec code for the unix REPL. Only enabled when MICROPY_USE_READLINE == 1 (the default). Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2025-11-21rp2: Fix RP2350 and RP2350B pin alt functions.Phil Howard
RP2350 builds were using the incomplete `rp2_af.csv` alt function table (originally made for RP2040) which broke pins > 31 in RP2350B (48-pin QFN-80) builds: >>> machine.Pin(31) Pin(GPIO31, mode=IN, pull=PULL_DOWN) >>> machine.Pin(32) Pin(GPIO32, mode=ALT, pull=PULL_DOWN, alt=31) To fix this, separate alt-functions tables for RP2350 and RP2350B are added in this commit. UART_AUX (alt function 11) was also missing, along with XIP_CS1 and CORESIGHT_TRACE, and they are now added as well. Signed-off-by: Phil Howard <github@gadgetoid.com> Signed-off-by: Damien George <damien@micropython.org>
2025-11-21docs/library/os: Clarify ilistdir tuples size element.Alex Tran
The currently documentation for ilistdir tuples says that the size element is included based on the platform. However, this is not the case as it is included based on the filesystem type. This commit makes the according adjustment. Fixes issue #17516. Signed-off-by: Alex Tran <alex.t.tran@gmail.com>
2025-11-21py/objdict: Implement bool and len unary ops for dict views.Damien George
Currently, dict views (eg `dict.keys()`, `dict.values()`) do not implement the `bool` or `len` unary operations. That may seem like a reasonable omission for MicroPython to keep code size down, but it actually leads to silently incorrect bool operations, because by default things are true. Eg we currently have: >>> bool(dict().keys()) True which is wrong, it should be `False` because the dict is empty. This commit implements `bool` and `len` unary operations on dict views by simply delegating to the existing dict unary op function. Fixes issue #12385. Signed-off-by: Damien George <damien@micropython.org>
2025-11-21extmod/asyncio: Pass globals in __import__ call.Chris Liechti
`globals()` needs to be provided in case `__import__` is a Python function.
2025-11-21py/builtinimport: Support relative import in custom __import__ callback.Chris Liechti
The globals need to be forwarded from the caller's context. Signed-off-by: Damien George <damien@micropython.org>
2025-11-20docs/mimxrt/pinout: Use Dxx pin identifiers for Teensy boards.robert-hh
The documentation used integers to specify Teensy board pins, which match the board's silkscreen. But in Python code Dxx have to be used, since integers are not accepted as a Pin identifier. This commit changes the Pinout tables accordingly, consistent with the other MIMXRT boards. Signed-off-by: robert-hh <robert@hammelrath.com>
2025-11-20zephyr/modules: Add Zephyr FileSystem support to _boot.py.Vdragon
Signed-off-by: Vdragon <mail@massdriver.space>
2025-11-20zephyr/boards: Setup rpi_pico to use Zephyr FS instead of MPY FS.Vdragon
Use new Zephyr FS, and be a demonstration of that configuration. This is still on-disk compatible with existing filesystems on the internal flash. Signed-off-by: Vdragon <mail@massdriver.space>