17563 Commits

Author SHA1 Message Date
iabdalkader
9939565d50 stm32/boards/ARDUINO_OPTA: Reset ETH PHY on board init.
Some checks failed
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_address (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
As required by the datasheet.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-09-02 14:05:26 +10:00
Chris Mason
fc2a851202 stm32: Enable I2CTarget for STM32L4.
STM32L4 uses the same I2C controller as STM32WB.  Change `defined(STM32WB)`
to `defined(STM32L4) || defined(STM32WB) ` in relevant files.

Also remove the dummy definition of I2C2_BASE for STM32L432xx.  It's now
provided by the dummy definition in `i2cslave.h`.

Signed-off-by: Chris Mason <c.mason@inchipdesign.com.au>
Signed-off-by: Damien George <damien@micropython.org>
2025-09-02 13:45:39 +10:00
Jeff Epler
4db2cf09e0 shared/runtime/pyexec: Unconditionally reset lock depth.
Saves code size for the same functionality.

Signed-off-by: Jeff Epler <jepler@gmail.com>
2025-09-02 13:41:20 +10:00
Jeff Epler
a791f7f43c tests: Add test for heap lock in REPL.
Signed-off-by: Jeff Epler <jepler@gmail.com>
2025-09-01 21:29:05 -05:00
Jeff Epler
6ad91f25fb unix: Unlock heap before readline.
This is intended to be equivalent to the unlock in
shared/runtime/pyexec.c.

Signed-off-by: Jeff Epler <jepler@gmail.com>
2025-09-01 21:29:05 -05:00
Jeff Epler
30c1b6e3d1 unix: Don't crash if heap locked in prompt_write_history.
Signed-off-by: Jeff Epler <jepler@gmail.com>
2025-09-01 21:29:05 -05:00
Damien George
3adf016376 esp32: Revert "esp32/mpconfigport: Disable I2CTarget on ESP32-C6 to ..".
Some checks failed
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_address (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
This reverts commit 3c9546ea09.

I2CTarget now fits on ESP32-C6 because it's compiled with -Os, see commit
5b98126c21.

Signed-off-by: Damien George <damien@micropython.org>
2025-09-01 14:39:44 +10:00
Jimisola Laursen
704c70c5bb esp32/boards: Enable I2S for ESP32_GENERIC_C6 and other C6 boards.
Some checks failed
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_address (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
I2S works on the ESP32-C6, and it now has enough space to fit.

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Signed-off-by: Damien George <damien@micropython.org>
2025-08-29 14:00:30 +10:00
Angus Gratton
9a9cc79422 esp32/boards: Build ESP32-C2 and C3 with -Os instead of -O2.
Same optimisation that was applied to C6 in the parent commit, now applied
to all RISC-V boards.

    +------------+------------+------------+------------+
    | Size       | Before     | After      | Delta      |
    +------------+------------+------------+------------+
    | C2 Binary  | 1680384    | 1494224    | -186160    |
    | C2 D/IRAM  |   83710    |   79080    |   -4630    |
    | C3 Binary  | 1833328    | 1636624    | -196704    |
    | C3 D/IRAM  |  139608    |  131896    |   -7712    |
    +------------+------------+------------+------------+

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-08-29 13:35:53 +10:00
Angus Gratton
5b98126c21 esp32/boards: Reduce flash usage of ESP32-C6 boards.
Reduces ESP32_GENERIC_C6 application flash size from 2024432 to
1813216 (206KB smaller).

Also has benefit of reducing D/IRAM size, increasing free memory at
runtime (167187 to 148584, -18603 bytes).

Most of this savings comes from building with -Os instead of -O2,
but about 10KB comes from using the SPI flash functions from the ROM.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-08-29 13:35:48 +10:00
Damien George
f0d445a466 tests/multi_net: Simplify SKIP when imports don't exist.
Some checks failed
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_address (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
Signed-off-by: Damien George <damien@micropython.org>
2025-08-29 11:17:48 +10:00
Damien George
3274f0355b tests/multi_net: Require SSL cert file to be available for test to run.
These were missed in 2bba507148 because they
didn't use the `os.stat` pattern.

Signed-off-by: Damien George <damien@micropython.org>
2025-08-29 11:17:48 +10:00
Damien George
af745a5982 tests/net_inet/tls_num_errors.py: Make alloc of emg-exc-buf optional.
Some checks failed
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_address (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
The unix port doesn't have `micropython.alloc_emergency_exception_buf()`
but it's still possible to run and pass this test.  So make that call
optional.

Signed-off-by: Damien George <damien@micropython.org>
2025-08-28 23:19:20 +10:00
Damien George
dbbc7d9667 tests/run-perfbench.py: Change -p/-d arguments to -t.
And the existing "-t" option is changed to "-m" (shorthand for the
"--diff-time" option).

Signed-off-by: Damien George <damien@micropython.org>
2025-08-28 23:14:55 +10:00
Damien George
bf185c37ed tests/run-natmodtests.py: Change -p/-d arguments to -t.
Following the similar change to `run-tests.py` and `run-multitests.py`.
What was previously, eg, `-p -d /dev/ttyACM0` is now `-t a0`.

Signed-off-by: Damien George <damien@micropython.org>
2025-08-28 23:13:40 +10:00
Damien George
f62c614d3e tests/run-multitests.py: Change -i argument to -t.
Back in commit 8978102f35 (see PR #16111) the
`run-tests.py` script was changed to use an improved way of selecting the
test instance, eg:

    $ ./run-tests.py -t a0

that would run on /dev/ttyACM0.  This has been a very nice improvement,
makes it easier to specify the target.

This commit updates `run-multitests.py` to use the same scheme.  It
previously used `-i` but now that's changed to `-t`.

Signed-off-by: Damien George <damien@micropython.org>
2025-08-28 23:11:57 +10:00
Damien George
7a8ae72640 tests/run-tests.py: Factor code for device shortcuts to a function.
So it can be reused by other test runners.

Signed-off-by: Damien George <damien@micropython.org>
2025-08-28 23:11:30 +10:00
Jeff Epler
b6cd577cf6 py/mkrules.mk: Force ".pp" files to always rebuild.
These files are only built on demand for developers, and it is a quick
process.

Without FORCE, a sequence like this would leave the developer with an
outdated `main.pp` to inspect:

    make build-standard/main.pp
    touch input.h
    make build-standard/main.pp # Rebuilds now, wouldn't have before

Signed-off-by: Jeff Epler <jepler@gmail.com>
2025-08-28 23:09:32 +10:00
Jeff Epler
1671977ca4 py/parsenum: Fix parsing LLONG_MIN in longlong configuration.
Some checks failed
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_address (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
Re-organize `mp_parse_num_integer()` (for longlong) slightly so that the
most negative 64-bit integer can be parsed.

Fixes issue #17932.

Signed-off-by: Jeff Epler <jepler@gmail.com>
2025-08-28 11:31:03 +10:00
Anson Mansfield
f4f7fbf3dc py/obj: Remove unused map new/free function declarations.
These functions were removed in 6c9fca2 for v1.9.3.  This commit removes
their declarations as well.

See-also: 6c9fca2aa9
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
2025-08-28 11:16:00 +10:00
Anson Mansfield
54787dc37b tools/ci.sh: Skip unreliable thread/thread_gc1.py test in Github CI.
The `thread/thread_gc1.py` test is a constant source of spurious failures
in Github CI.

This commit adds it to the list of tests skipped when running on Github CI
using either macos, qemu_riscv64, qemu_mips, or qemu_arm, to help reduce
the overall false positive rate and improve the predictive value of the
test fail indication.

Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
2025-08-28 10:47:43 +10:00
Alessandro Gatti
ce834b8d66 tools/mpy-tool.py: Allow dumping MPY segments into their own files.
This commit lets "tools/mpy-tool.py" extract MPY segments into their own
files, one file per segment.

A pair of new command line arguments were added, namely "-e"/"--extract"
that takes a filename prefix to use as a base for the generated files'
name, and "--extract-only" that - combined with "--extract" - allows
selecting which kinds of segment should be dumped to the filesystem.

So, for example, assuming there's a file called "module.mpy", running
"./mpy-tool.py --extract segments module.mpy" would yield a series of
files with names like "segments_0_module.py_QSTR_module.py.bin",
"segments_1_module.py_META__module_.bin",
"segments_2_module.py_QSTR_function.bin", etc.  In short the file name
format is "<base>_<count>_<sourcefile>_<segmentkind>_<segmentname>.bin",
with <segmentkind> being META, QSTR, OBJ, or CODE.  Source file names
and segment names will only contain characters in the range
"a-zA-Z0-9_-." to avoid having output file names with unexpected
characters.

The "--extract-only" option can accept one or more kinds, separated by
commas and treated as case insensitive strings.  The supported kinds
match what is currently handled by the "MPYSegment" class in
"tools/mpy-tool.py": "META", "QSTR", "OBJ", and "CODE".  The absence of
this command line option implies dumping every segment found.

If "--extract" is passed along with "--merge", dumping is performed
after the merge process takes place, in order to dump all possible
segments that match the requested segment kinds.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-08-26 21:17:03 +02:00
David Schneider
8c47e446bf py/obj: Fix a comment regarding make_new slot.
Some checks failed
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_address (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
This was missed as part of the transition to make_new a mp_obj_type_t slot.

See also: 94beeabd2e

Signed-off-by: David Schneider <schneidav81@gmail.com>
2025-08-26 23:16:01 +10:00
Alessandro Gatti
c33a02fe6d tests/run-tests.py: Enable Arm inlineasm FPU tests if possible.
Some checks failed
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_address (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
This commits lifts the unconditional restriction on inline assembler FPU
tests for the Qemu platform, and makes said restriction conditional to
the lack of an available floating point unit on the running platform.

The Qemu platform supported only emulated machines that could target up
to a Cortex-M3, so an ArmV7-M target that had no support for floating
point.  With the addition of MPS2_AN500 to the list of emulated targets
the range was extended to cover up to Cortex-M7, so a floating point
unit may possibly be available and thus able to run the FPU inlineasm
tests.

For that, the test runner was changed to detect the running architecture
when checking the target capabilities; if the target reports its
MicroPython architecture to be either "armv7emsp" or "armv7emdp"
(providing single-precision and double-precision floating point unit
support respectively) then the FPU-only inline tests are not put into
the blocked tests list.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-08-26 12:27:21 +10:00
Alessandro Gatti
6c1d1f3ad4 qemu/mcu/arm/mps2.ld: Add .ARM.exidx section to the linkerscript.
This commit fixes a linking issue on certain Arm toolchains where
library code is compiled with exception support.

If a library with exception support is included in the MicroPython
build, the linker had no place to put the stack unwinding tables
necessary to perform exception handling at runtime.  This change adds a
new section to the linkerscript (and therefore the final ELF file) where
that data can be placed into.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-08-26 12:27:21 +10:00
Alessandro Gatti
6650506e06 tools/ci.sh: Extend Arm testing to include hardfp targets.
This commit lets CI extend the testing scope of the QEMU Arm target, by
letting it perform the usual battery of tests (interpreter and natmods)
also on hardfp targets.

The default board for Arm testing lacks hardware floating point support,
so natmods weren't tested in that specific configuration.  With the
introduction of the "MPS_AN500" QEMU target, now this is made possible
as said board emulates a Cortex-M7 machine with a single- and
double-precision floating point unit.

To reduce the impact on build times, the "ci_qemu_build_arm_thumb" CI
step was split in two: "ci_qemu_build_arm_thumb_softfp" and
"ci_qemu_build_arm_thumb_hardfp" - so hopefully those can run in
parallel whenever possible.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-08-26 12:27:21 +10:00
Alessandro Gatti
64cac4690f qemu/mcu/arm/errorhandler: Add ARMv7-M debug registers.
This commit extends the QEMU port's CPU error handler for the Arm target
by printing out in detail the ARMv7-M debug registers if the firmware is
compiled for such a target.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-08-26 12:27:21 +10:00
Alessandro Gatti
19be404ad8 qemu/arm: Add definition for the MPS2_AN500 machine.
This commit introduces a new target for the QEMU port called
"MPS2_AN500", an ARMv7-M machine with a Cortex-M7 CPU and
single-/double-precision floating point unit.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-08-26 12:27:21 +10:00
Alessandro Gatti
87099b5731 qemu/Makefile: Allow overriding floating point mode by boards.
This commit lets board use a different floating point mode rather than
the usual soft-float that was the original default for all QEMU-based
boards.

The configuration options are the same available in the "stm32" port.
Boards can set "MICROPY_FLOAT_IMPL" to either "float", "double", or
"none" to indicate which floating point mode they want, and optionally
"SUPPORTS_HARDWARE_FP_SINGLE" or "SUPPORTS_HARDWARE_FP_DOUBLE" can be
set to 1 to further indicate the hardware capabilities of the hardware
floating point unit, if present.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-08-26 12:27:21 +10:00
Alessandro Gatti
b0fd0079f4 tests/micropython: Make tests behave in low memory condition.
Some checks failed
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_address (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
This commit changes the "viper_ptr*_store_boundary" tests to make them
fail more gracefully in low memory conditions.

The original version of the tests compiled viper code blocks on the fly
when it needed them, making them fail at runtime on some boards that do
not come with enough memory for this test.  This clashes with
"run-tests.py"'s ability to look for a particular signature to mark
tests as skipped due to not enough memory.

Now compiled code blocks are generated at the beginning of the test
inside an appropriate exception handler.  In case of a memory error when
pre-compiling a code block, the running test exits reporting a low
memory condition to the test runner.  This allows to have clean test
runs on all platforms when it comes to viper pointer tests.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-08-26 10:47:17 +10:00
Daniël van de Giessen
1df5ee12e8 esp32/network_ppp: Stop polling if PPP was disconnected.
Some checks failed
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_address (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
When disconnecting from PPP the modem sends a confirmation. This message
is received, like all messages, through the poll() method. lwIP may then
immediately call our status callback with code PPPERR_USER to indicate
the connection was closed. Our callback then immediately proceeds to
free the PCB. Thus, during each new iteration of the loop in poll() we
must check if we haven't disconnected in the meantime to prevent calling
the pppos_input_tcpip with a PCB that is now NULL.

Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2025-08-25 23:11:33 +10:00
Daniël van de Giessen
72147c02c7 esp32/network_ppp: Stop polling if stream becomes None.
If while a polling operation is active the stream is removed we should
stop polling data from that stream.

This was already the intended behaviour, but implemented incorrectly.

Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2025-08-25 23:11:33 +10:00
Yilin Sun
053aade741 mimxrt/boards: Re-generate MIMXRT1052 clock config files.
Some checks failed
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_address (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
These were regenerated by the NXP Config tool for v2.11.

The board_init update was needed to ensure CLOCK_SetMode() is run
at the appropriate time during startup.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2025-08-25 10:48:17 +10:00
Yilin Sun
bd7342d9ec mimxrt: Restructure nxp_sdk to match official mcux-sdk.
The official mcux-sdk follows a slightly different structure to the
current nxp_sdk submodule, with many drivers moved to a common location.

To ease updating the newer versions of the SDK and/or add new families
the nxp_sdk submodule has been updated to follow the structure of
mcux-sdk, just trimmed down to families used here to considerably
reduce the size.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2025-08-25 10:48:16 +10:00
Damien George
a3f9dec788 py/mpconfig: Enable the sys module at all feature levels by default.
Some checks failed
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_address (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
This is a pretty fundamental module, and even minimal ports like unix and
zephyr minimal have it enabled.  So, enabled it by default at the lowest
feature level.

Most things in the `sys` module are configurable, and off by default, so it
shouldn't add too much to ports that don't already have it enabled (which
is just the minimal port).

Also note that `sys` is still disabled on the bare-arm port, to keep that
ultra minimal.  It means we now have bare-arm without `sys` and the minimal
port with `sys`.  That will allow different code size comparisons if/when
new `sys` features are added.

Signed-off-by: Damien George <damien@micropython.org>
2025-08-22 13:31:10 +10:00
Damien George
14e9c00cb9 py/builtinimport: Guard code needing sys.path with MICROPY_PY_SYS_PATH.
Signed-off-by: Damien George <damien@micropython.org>
2025-08-22 13:30:46 +10:00
Damien George
b5fcb33eaa py/mpconfig: Enable CRYPTOLIB, HASHLIB_MD5, HASHLIB_SHA1 if SSL enabled.
Some checks failed
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_address (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
This commit unifies the configuration of MICROPY_PY_CRYPTOLIB,
MICROPY_PY_HASHLIB_MD5 and MICROPY_PY_HASHLIB_SHA1, so they are enabled by
default if MICROPY_PY_SSL is enabled.  This matches the existing
configuration of most of the ports.

With this change, all ports remain the same except:
- reneses-ra now enables MICROPY_PY_CRYPTOLIB, MICROPY_PY_HASHLIB_MD5 and
  MICROPY_PY_HASHLIB_SHA1.
- rp2 now enables MICROPY_PY_HASHLIB_MD5.

Signed-off-by: Damien George <damien@micropython.org>
2025-08-19 21:10:00 +10:00
Damien George
989abae12c py/mpconfig: Move MICROPY_MODULE___ALL__ option to other module options.
Some checks failed
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_address (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
Signed-off-by: Damien George <damien@micropython.org>
2025-08-19 13:00:45 +10:00
Damien George
169d382248 py/mpconfig: Rename MICROPY_PY___FILE__ to MICROPY_MODULE___FILE__.
For consistency with other module-related configuration options.

Signed-off-by: Damien George <damien@micropython.org>
2025-08-19 13:00:45 +10:00
Damien George
3650196682 py/objtype: Use locals_ptr directly instead of getting it from the slot.
This is a very minor code simplification, which reduces code size by about
-8 bytes.  It should have no functional change.

Signed-off-by: Damien George <damien@micropython.org>
2025-08-19 12:58:02 +10:00
Alessandro Gatti
bd413d3d85 py/asmthumb: Fix T3 encoding of conditional branches.
This commit fixes the encoding of conditional branch opcodes emitted for
ARMv7-M targets, when the emitter decides to use the T3 encoding for
said operation.

Fields J1 and J2 are now present in the generated opcode word, along
with correcting some minor issues in bitmasks and shifts computation.

This fixes #17940.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-08-19 12:40:29 +10:00
Angus Gratton
22deeeb8db tests/stress/recursive_iternext: Rewrite to find its own limit.
Necessary on the unix port when running with sanitizers, as the newly
increased stack size can run all tests at N=5000 without raising
RuntimeError, and increasing N to fix this causes issues on other
configurations.

This way the test progressively builds a deeper data structure until it
fails with RuntimeError. This is theoretically slower, but not noticeably
so in reality.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-08-19 10:33:40 +10:00
Angus Gratton
d8672f4cde unix: Increase stack sizes if running with sanitizers.
The specific problem seems to be that the runtime "Python stack frame"
function call is several times more expensive in stack usage when running
with UBSan on older GCC (observed on gcc 11.4 as used in CI, would get
'RuntimeError: maximum recursion depth exceeded' when running some tests
with UBSan enabled.)

Other stack usage (i.e. from pushing things on the stack in Python) stays
the same. Whatever causes the usage seems to be mostly gone in later GCC
versions.

Includes a refactor to apply the same stack size multipliers
for the default thread stack size same as the main stack size.

This goes in a new port-specific header as it depends on macros
in misc.h, so can't be in mpconfigport.h.

A side effect of this is that the default thread stack size is
now doubled on ARM, same as the main stack size.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-08-19 10:33:40 +10:00
Angus Gratton
3faf229853 py/misc: Add a way to detect sanitizer builds.
Clang and gcc>=14 can use __has_feature() to detect if a sanitizer
is enabled, but older GCC has no mechanism - need to set a macro
explicitly for this to be recognised.

Necessary for increasing some resource limits in sanitizer builds.
Important not to use to avoid real issues!

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-08-19 10:33:40 +10:00
Angus Gratton
d81d56cc4d tools/ci: Add UBSan to longlong CI build.
Also rewrite the sanitizer argument variables to not assume a variant.

longlong variant currently fails in this config, due to a bug fixed
in follow-up commit.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-08-19 10:33:40 +10:00
Tico06
020eeba412 stm32/eth_phy: Fix typo in header guard macro.
Some checks failed
unix port / macos (push) Has been cancelled
unix port / qemu_mips (push) Has been cancelled
unix port / qemu_arm (push) Has been cancelled
unix port / qemu_riscv64 (push) Has been cancelled
unix port / sanitize_address (push) Has been cancelled
unix port / sanitize_undefined (push) Has been cancelled
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, dev) (push) Has been cancelled
windows port / build-mingw (i686, mingw32, standard) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, dev) (push) Has been cancelled
windows port / build-mingw (x86_64, mingw64, standard) (push) Has been cancelled
windows port / cross-build-on-linux (push) Has been cancelled
zephyr port / build (push) Has been cancelled
Python code lint and formatting with ruff / ruff (push) Has been cancelled
Typo on line 29 (PYH instead of PHY).

Compilation failing, here is the output:

    eth_phy.h:28: error: header guard 'MICROPY_INCLUDED_STM32_PHY_H'
    followed by '#define' of a different macro [Werror=header-guard]
        28 | #ifndef MICROPY_INCLUDED_STM32_PHY_H
    eth_phy.h:29: note: 'MICROPY_INCLUDED_STM32_PYH_H' is defined here;
    did you mean 'MICROPY_INCLUDED_STM32_PHY_H'?
        29 | #define MICROPY_INCLUDED_STM32_PYH_H

Signed-off-by: Tico06 <e.grammatico@gmail.com>
2025-08-18 14:07:02 +10:00
iabdalkader
c7ddf0c54f stm32/Makefile: Add .gc.blocks.table section to generated binary.
The generated binary file was missing this section, which caused a hard
fault when loading bin or dfu firmware (eg on ARDUINO_GIGA).

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-08-18 13:57:30 +10:00
Yuuki NAGAO
365329cd54 stm32/dac: Fix DAC write for MCUs that have D-Cache.
To prevent wrong DAC output, clean D-cache before starting DMA.

For more details, please refer to the following document:
https://www.st.com/resource/en/application_note/DM00272913.pdf

Signed-off-by: Yuuki NAGAO <wf.yn386@gmail.com>
2025-08-18 13:20:50 +10:00
Yuuki NAGAO
152a0782e6 stm32/dac: Add support for DAC feature on STM32G0.
DAC.write() and DAC.write_timed() are now available on STM32G0.

Tested on NUCLEO_G0B1RE.

Signed-off-by: Yuuki NAGAO <wf.yn386@gmail.com>
2025-08-18 13:17:34 +10:00
Yuuki NAGAO
1b35116c92 stm32/dac: Fix 12-bit DAC issue on STM32H5.
For STM32H5, to use 12-bit DAC, the DMA parameter should set:
- Actual DMA source datawidth to CTR1.
- The length is the amount of data to be transferred from source to
  destination in bytes.

Also, this commit modifies the (dummy) definition of DMA_CIRCULAR for
STM32H5 to prevent conflict with data width specification.

Signed-off-by: Yuuki NAGAO <wf.yn386@gmail.com>
2025-08-18 13:11:01 +10:00