Commit Graph

16614 Commits

Author SHA1 Message Date
Damien George
1100aa63c9 LICENSE,docs: Update copyright year range to include 2025.
Some checks are pending
unix port / settrace (push) Waiting to run
unix port / settrace_stackless (push) Waiting to run
unix port / macos (push) Waiting to run
unix port / qemu_mips (push) Waiting to run
unix port / qemu_arm (push) Waiting to run
unix port / qemu_riscv64 (push) Waiting to run
webassembly port / build (push) Waiting to run
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-mingw (i686, mingw32, dev) (push) Waiting to run
windows port / build-mingw (i686, mingw32, standard) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, dev) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, standard) (push) Waiting to run
windows port / cross-build-on-linux (push) Waiting to run
zephyr port / build (push) Waiting to run
Python code lint and formatting with ruff / ruff (push) Waiting to run
Signed-off-by: Damien George <damien@micropython.org>
2025-01-22 18:25:20 +11:00
Alessandro Gatti
87f04d5935 esp8266/Makefile: Fix local toolchain builds on recent Linux systems.
This commit fixes compilation for the ESP8266 port when using a local
toolchain on relatively recent Linux systems.

The documentation asks the user to delete the esptool instance that
comes with the toolchain, in favour of using the one provided by the
system.  On Linux systems that are at least two years old (looking at
the CI Ubuntu image as an example), the version of esptool installed
with the package manager isn't called `esptool.py` but just `esptool`.
The Makefile didn't take that into account and used `esptool.py` without
checking if such a command exists, making builds fail.

Now preference is given to the `esptool` command, falling back to
`esptool.py` only if the former command does not exist or it is not
available to the current user, to maintain compatibility with old
setups.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-01-22 18:20:32 +11:00
Damien George
b4f53a0e51 qemu/boards: Change boards to use a subdirectory like other ports.
Some checks failed
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
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
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (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 moves `<board>.mk` to `<board>/mpconfigboard.mk` for all qemu
boards, making it the same as other bare-metal ports.

Signed-off-by: Damien George <damien@micropython.org>
2025-01-19 12:45:37 +11:00
Damien George
6db29978ac py/mkrules.mk: Move comment about partial clones outside make rule.
Some checks failed
unix port / settrace (push) Has been cancelled
unix port / settrace_stackless (push) Has been cancelled
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
webassembly port / build (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (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
Otherwise the comment is printed each time the rule is run.

Follow up to fdd606dd53.

Signed-off-by: Damien George <damien@micropython.org>
2025-01-17 16:58:54 +11:00
Angus Gratton
84e0aca0fb docs/esp32: Defer to the download page for flashing steps.
The user already has it open, and its customised for their
particular board.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-01-17 16:54:00 +11:00
Angus Gratton
6fc18ec647 esp32/boards: Update the product name for some UM boards.
The previous deploy.md refactors revealed that these boards had a different
"product" entry in boards.json compared to the name given in the board.md
file.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-01-17 16:53:44 +11:00
Angus Gratton
600e46800d docs/esp32: Update tutorial flashing steps to match deploy.md.
Includes fixing the flashing address for newer SoCs, as reported in
discussion https://github.com/orgs/micropython/discussions/16417

Also removes some redundant or out of date information, and adds links to
the Espressif esptool docs which are quite comprehensive.

Information about ESP32_GENERIC variants is moved to the board page, as it
only applies to that board.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-01-17 16:03:45 +11:00
Angus Gratton
d89e71e6c0 tools/autobuild,esp32: Template the generation of esp32 port deploy.md.
Allows two source files (ports/esp32/boards/deploy.md and
deploy_nativeusb.md for boards with only native USB) for all esp32
installation steps, with templated chip name and flash offset inserted via
string formatting.

The new files add more text to explain the esptool.py port auto-detection,
remove the unnecessary -z feature (already enabled by default), and add
a bit of troubleshooting and port detection info.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-01-17 16:03:45 +11:00
iabdalkader
b6649b922e stm32/boards: Update Arduino boards to reserve timers and fix USB PID.
Reserve timers used for the camera, and fix USB PID because 0x055F is
reserved for MicroPython.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-01-17 14:03:05 +11:00
Angus Gratton
05eb1d8e15 stm32/boards/ARDUINO_NICLA_VISION: Fix CAN pin assignment.
The only STM32H747 pins with CAN function that are also broken out on the
board are PB8 and PB9.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-01-17 13:17:28 +11:00
Angus Gratton
21b7bd9f44 stm32/fdcan: Fix extended CAN ID filtering for stm32g4.
The memory bank addresses used for these are independent, can (and must)
enable both.

Also looks like no need to shrink these if FDCAN2 is added, the Reference
Manual is a bit unclear but looks like the peripheral's RAM multiplies out
for each additional controller.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-01-17 13:12:17 +11:00
Angus Gratton
3a60f32c9d stm32/can: Fix clearing filters on CAN3 (bxCAN).
HAL argument is ignored for CAN1, CAN2 but needed for CAN3.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-01-17 13:08:14 +11:00
Angus Gratton
221a4ecf30 stm32/pyb_can: Include requested CAN baudrate in matching error.
Some checks are pending
unix port / settrace (push) Waiting to run
unix port / settrace_stackless (push) Waiting to run
unix port / macos (push) Waiting to run
unix port / qemu_mips (push) Waiting to run
unix port / qemu_arm (push) Waiting to run
unix port / qemu_riscv64 (push) Waiting to run
webassembly port / build (push) Waiting to run
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-mingw (i686, mingw32, dev) (push) Waiting to run
windows port / build-mingw (i686, mingw32, standard) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, dev) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, standard) (push) Waiting to run
windows port / cross-build-on-linux (push) Waiting to run
zephyr port / build (push) Waiting to run
Python code lint and formatting with ruff / ruff (push) Waiting to run
This is redundant for bxCAN, but for CAN-FD with BRS it's otherwise unclear
which set of parameters (baudrate & sample_point or brs_baudrate &
brs_sample_point) failed to match. This makes finding a valid combination
extra annoying.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-01-17 12:13:17 +11:00
Angus Gratton
e8d3df51dc stm32/pyb_can: Make pyb.CAN baud calculation a little more forgiving.
Not every baudrate or sample point combination has an exact match,
but getting within 1% on sample point and .1% on baud rate should
always be good enough.

Because the search goes from shorter bit periods (lowest brp) and
increases, the first match which meets this criteria should still mostly be
the best available.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-01-17 12:13:17 +11:00
Angus Gratton
1d8943ac7b stm32/pyb_can: Fix CAN-FD BRS baud initialisation.
Was initialising using the Classic CAN bs1/bs2 value, incorrectly.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-01-17 12:13:17 +11:00
Angus Gratton
8e2da5a519 stm32/boards: Support 'FDCAN' in board pin CSVs.
Previously micros with the 'FDCAN' peripheral (as opposed to the older
'CAN' peripheral) needed to rename these pins in the CSVs for the CAN
driver to work.

The following CSVs in MicroPython still had FDCAN in them:

    $ rg -t csv -l FDCAN boards
    boards/stm32h7b3_af.csv
    boards/stm32h743_af.csv
    boards/stm32h573_af.csv
    boards/stm32h723_af.csv
    boards/stm32g0b1_af.csv

Confirmed that this allows CAN to work on NUCLEO_H723ZG board, and that at
least one board based on each of the other chips can still compile. Some of
these boards could possibly have MICROPY_HW_ENABLE_CAN set and work, now.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-01-17 12:01:42 +11:00
Glenn Strauss
f2cd1a3db6 lib/mbedtls: Update to mbedtls v3.6.2.
Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
2025-01-17 10:10:57 +11:00
peterhinch
624bd48d2f docs/reference/isr_rules: Describe issue with hard ISRs and globals.
Some checks are pending
unix port / settrace (push) Waiting to run
unix port / settrace_stackless (push) Waiting to run
unix port / macos (push) Waiting to run
unix port / qemu_mips (push) Waiting to run
unix port / qemu_arm (push) Waiting to run
unix port / qemu_riscv64 (push) Waiting to run
webassembly port / build (push) Waiting to run
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-mingw (i686, mingw32, dev) (push) Waiting to run
windows port / build-mingw (i686, mingw32, standard) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, dev) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, standard) (push) Waiting to run
windows port / cross-build-on-linux (push) Waiting to run
zephyr port / build (push) Waiting to run
Python code lint and formatting with ruff / ruff (push) Waiting to run
Signed-off-by: Damien George <damien@micropython.org>
2025-01-16 16:44:00 +11:00
iabdalkader
b79ceeca8f stm32/boards: Reserve SPI bus when it's used for external flash storage.
Reserve SPI flash bus used for storage or XIP.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-01-16 15:26:14 +11:00
iabdalkader
5fa960c719 stm32/spi: Retain the state of special SPI buses on soft reboot.
Reserved and static SPI buses must remain initialized during a soft reboot
as they may be used for SPI flash storage or XIP.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-01-16 15:26:02 +11:00
iabdalkader
a82fc718a7 stm32/mpconfigboard_common: Add MICROPY_HW_SPI_IS_STATIC macro.
A board should make this return true if the specified SPI instances should
not be deinitialized on soft-reboot.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-01-16 15:25:43 +11:00
Alessandro Gatti
a46e842807 qemu/boards/SABRELITE.mk: Remove exception for omitted tests.
This commit re-introduces `tests/extmod/vfs_rom.py` and
`tests/float/math_domain.py` to the test suite, as the issues that made
them fail have now been addressed.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-01-16 12:52:56 +11:00
Alessandro Gatti
c610199f2d py/asmarm: Fix halfword loads with larger offsets.
This commit fixes code generation for loading halfwords using an offset
greater than 255.

The old code blindly encoded the offset into a `LDRH Rd, [Rn, #imm]`
opcode, but only the lowest 8 bits would be put into the opcode itself.
This commit instead generates a two-opcodes sequence, a constant load into
R8, and then `LDRH Rd, [Rn, R8]`.

This fixes `tests/extmod/vfs_rom.py` for the qemu/SABRELITE board.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-01-16 12:52:32 +11:00
Alessandro Gatti
928c71638c py/asmarm: Fix locals address loading code generation with large imm.
This commit fixes code generation for loading a local's address if its
index is greater than 63.

The old code blindly encoded the offset into an `ADD Rd, Rn, #imm` opcode,
but only the lowest 8 bits would be put into the opcode itself.  This
commit instead generates a two-opcodes sequence, a constant load into R8,
and then an `ADD Rd, Rn, R8` opcode.

This fixes `tests/float/math_domain.py` for the qemu/SABRELITE board.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-01-16 12:51:51 +11:00
Alessandro Gatti
e84c9abfc2 qemu/Makefile: Increase GC heap size to 140KiB.
This commit increases the GC heap size from 120KiB to 140KiB, as it is
needed to make the full test suite pass on SABRELITE when ran through the
armv6 native emitter.

This is needed as the code output by the armv6 native emitter is limited to
4-bytes opcodes and thus takes more space than other ARM emitters.

To keep things aligned, the RV32 port also got its heap size increased even
though it is not needed on that platform right now.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-01-16 12:51:11 +11:00
Alessandro Gatti
3225c1bc66 qemu: Disable native emitter for the MICROBIT board.
The Micro:Bit machine definition in Qemu has soft MMU support enabled,
which is currently not compatible with the way MicroPython generates code
that needs to call back into non-emitted code.

As a stop-gap solution, the native code emitter for the MICROBIT board is
turned off.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-01-16 12:11:09 +11:00
Alessandro Gatti
1232a83555 qemu/mcu/arm: Dump exception cause and registers on machine error.
When a CPU exception is raised when emulating a Thumb-capable processor,
the default exception handler would simply enter in an endless loop without
providing any further information.

This commit adds a more complete exception handler that dumps to STDOUT the
exception cause and the status of the registers at the moment of the
exception.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-01-16 12:10:56 +11:00
Alessandro Gatti
0950f65ac4 tools/pyboard.py: Wait a bit before accessing the PTY serial port.
Some PTY targets, namely `NETDUINO2` and `MICROBIT` under Qemu, take a bit
more time to present a REPL than usual.  The pyboard tool is a bit too
impatient and would bail out before any of those targets had a chance to
respond to the raw REPL request.

Co-authored-by: Damien George <damien@micropython.org>
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-01-16 12:10:28 +11:00
Damien George
d533c9067a tools/autobuild: Don't allow a board to change its ID.
Some checks are pending
unix port / settrace (push) Waiting to run
unix port / settrace_stackless (push) Waiting to run
unix port / macos (push) Waiting to run
unix port / qemu_mips (push) Waiting to run
unix port / qemu_arm (push) Waiting to run
unix port / qemu_riscv64 (push) Waiting to run
webassembly port / build (push) Waiting to run
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-mingw (i686, mingw32, dev) (push) Waiting to run
windows port / build-mingw (i686, mingw32, standard) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, dev) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, standard) (push) Waiting to run
windows port / cross-build-on-linux (push) Waiting to run
zephyr port / build (push) Waiting to run
Python code lint and formatting with ruff / ruff (push) Waiting to run
All board IDs are now the board directory name.

Signed-off-by: Damien George <damien@micropython.org>
2025-01-15 16:48:10 +11:00
Damien George
ca71df0081 esp32/boards: Remove remaining "id" entries from board.json.
This entry was originally used to override the firmware filenames generated
by the build server, but these days all filenames should match the board
directory name.  So, remove the "id" entry and let the default be used.

This is a follow-up to 1a99f74063 (these
three boards were added after that change).

Signed-off-by: Damien George <damien@micropython.org>
2025-01-15 16:48:10 +11:00
Dryw Wade
0a9cc9014a rp2/boards/SPARKFUN_THINGPLUS_RP2350: Add SparkFun Thing Plus RP2350.
Some checks are pending
unix port / settrace (push) Waiting to run
unix port / settrace_stackless (push) Waiting to run
unix port / macos (push) Waiting to run
unix port / qemu_mips (push) Waiting to run
unix port / qemu_arm (push) Waiting to run
unix port / qemu_riscv64 (push) Waiting to run
webassembly port / build (push) Waiting to run
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-mingw (i686, mingw32, dev) (push) Waiting to run
windows port / build-mingw (i686, mingw32, standard) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, dev) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, standard) (push) Waiting to run
windows port / cross-build-on-linux (push) Waiting to run
zephyr port / build (push) Waiting to run
Python code lint and formatting with ruff / ruff (push) Waiting to run
Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
2025-01-15 11:06:40 +11:00
Alessandro Gatti
e73cf71a24 tests/extmod/re_sub.py: Fix test execution on Python 3.13.
This commit fixes a test failure for `extmod/re_sub.py` where the code,
whilst being correct, would not make the test pass due to a newer
Python version than expected.

On Python 3.13, running `tests/extmod/re_sub.py` would yield a
deprecation warning about `re.sub` not providing the match count as a
keyword parameter.  This warning would be embedded in the expected test
result and thus the test would always fail.

Co-authored-by: stijn <stijn@ignitron.net>
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2025-01-15 07:46:09 +11:00
Damien George
1b4c969ce0 tests/multi_net: Update TLS test certificates and keys.
Some checks are pending
unix port / settrace (push) Waiting to run
unix port / settrace_stackless (push) Waiting to run
unix port / macos (push) Waiting to run
unix port / qemu_mips (push) Waiting to run
unix port / qemu_arm (push) Waiting to run
unix port / qemu_riscv64 (push) Waiting to run
webassembly port / build (push) Waiting to run
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-mingw (i686, mingw32, dev) (push) Waiting to run
windows port / build-mingw (i686, mingw32, standard) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, dev) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, standard) (push) Waiting to run
windows port / cross-build-on-linux (push) Waiting to run
zephyr port / build (push) Waiting to run
Python code lint and formatting with ruff / ruff (push) Waiting to run
They expired in early January 2025.

Signed-off-by: Damien George <damien@micropython.org>
2025-01-14 14:55:30 +11:00
Damien George
6dbb7ab18f tests/README: Update TLS certificate generation instructions.
Fix the command that converts `ec_key.pem` to `ec_key.der`, and increase
the certificate validity to 10 years.

Signed-off-by: Damien George <damien@micropython.org>
2025-01-14 14:38:41 +11:00
Damien George
790986b3ed github/workflows: Use ubuntu-22.04 for unix qemu CI.
To use an older version of libffi.

Signed-off-by: Damien George <damien@micropython.org>
2025-01-14 14:06:03 +11:00
Damien George
5a5f0cb462 github/workflows: Use Python 3.11 for unix settrace jobs.
GitHub Actions has updated ubuntu-latest to 24.04, which now defaults
CPython to 3.12, which has a known regression with settrace.  Fix that by
explicitly using CPython 3.11.

Signed-off-by: Damien George <damien@micropython.org>
2025-01-14 14:02:46 +11:00
Dryw Wade
99ac8193ea rp2/boards/SPARKFUN_PROMICRO_RP2350: Add SparkFun Pro Micro RP2350.
Some checks failed
unix port / settrace (push) Failing after 0s
unix port / settrace_stackless (push) Failing after 0s
unix port / qemu_mips (push) Failing after 0s
unix port / qemu_arm (push) Failing after 0s
unix port / qemu_riscv64 (push) Failing after 0s
webassembly port / build (push) Failing after 0s
windows port / cross-build-on-linux (push) Failing after 0s
zephyr port / build (push) Failing after 0s
Python code lint and formatting with ruff / ruff (push) Failing after 0s
unix port / macos (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (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
Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
2025-01-11 14:35:41 +11:00
Dryw Wade
7964a435ea rp2/machine_bitstream: Tweak MP_HAL_BITSTREAM_NS_OVERHEAD for RP2350.
See https://github.com/micropython/micropython/issues/16190#issuecomment-2466155919

Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
2025-01-11 14:23:51 +11:00
Dryw Wade
065d45f9ec rp2/mphalport: Fix mp_hal_pin_low/high() for pin>=32.
Fixes issue #16190.

Signed-off-by: Dryw Wade <dryw.wade@sparkfun.com>
2025-01-11 14:23:40 +11:00
Damien George
495ce91cae tools/ci.sh: Run test_full for qemu port CI.
Some checks failed
unix port / settrace (push) Failing after 0s
unix port / settrace_stackless (push) Failing after 0s
unix port / qemu_mips (push) Failing after 0s
unix port / qemu_arm (push) Failing after 0s
unix port / qemu_riscv64 (push) Failing after 0s
webassembly port / build (push) Failing after 0s
windows port / cross-build-on-linux (push) Failing after 0s
zephyr port / build (push) Failing after 0s
Python code lint and formatting with ruff / ruff (push) Failing after 0s
unix port / macos (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (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
Signed-off-by: Damien George <damien@micropython.org>
2025-01-06 17:57:48 +11:00
Damien George
b2a4501461 qemu/Makefile: Add test_full target to run a comprehensive test suite.
The tests now include `--via-mpy` and `--via-mpy --emit native`, which will
test more cases of the native emitter under both ARM and RISC-V.

Signed-off-by: Damien George <damien@micropython.org>
2025-01-06 17:57:48 +11:00
Damien George
bb1e7de5c6 qemu/boards: Exclude Thumb2 tests and tests failing with native emitter.
The `asmbcc`, `asmbitops`, `asmconst` and `asmit` tests fail to compile
with mpy-cross on armv6 architecture (used by SABRELITE), so explicitly
exclude them.

The `math_domain` and `vfs_rom` tests fail when compiled to native machine
code, so also exclude those unconditionally.

Signed-off-by: Damien George <damien@micropython.org>
2025-01-06 17:57:29 +11:00
Damien George
fca8ea6c39 tests/extmod/vfs_rom.py: Import errno for test.
It's needed by the test.  This previously passed because the compiler
(actually parser) optimises away errno constants.

Signed-off-by: Damien George <damien@micropython.org>
2025-01-06 17:55:11 +11:00
Damien George
966eb00394 tests/run-tests.py: Implement getcwd on __FS hook filesystem.
This method is needed by tests like `extmod/vfs_rom.py`.

Signed-off-by: Damien George <damien@micropython.org>
2025-01-06 17:55:11 +11:00
Damien George
510e055c71 py/asmarm: Allow function state to be larger than 255.
Co-authored-by: Alessandro Gatti <a.gatti@frob.it>
Signed-off-by: Damien George <damien@micropython.org>
2025-01-06 17:55:11 +11:00
Damien George
6a90e513de py/asmarm: Fix asm_arm_ldrh_reg_reg_offset to emit correct machine code.
Prior to this fix, the assembler generated `LDRH Rd, [Rn, #imm]!`, so the
second `LDRH` from the same origin would load from the wrong base.

Co-authored-by: Alessandro Gatti <a.gatti@frob.it>
Signed-off-by: Damien George <damien@micropython.org>
2025-01-06 17:55:03 +11:00
Damien George
91e30df5f2 tests/run-tests.py: Set __main__ module to __injected_test.
When using unittest (for example) with injected mpy files, not only does
the name of the main test module need to be `__main__`, but also the
`__main__` module should correspond to this injected module.  Otherwise the
unittest test won't be detected.

Signed-off-by: Damien George <damien@micropython.org>
2025-01-06 17:48:22 +11:00
Yoctopuce
5d12df51fc py/obj: Make literals unsigned in float get/new functions.
Some checks failed
unix port / settrace (push) Failing after 0s
unix port / settrace_stackless (push) Failing after 0s
unix port / qemu_mips (push) Failing after 0s
unix port / qemu_arm (push) Failing after 0s
unix port / qemu_riscv64 (push) Failing after 0s
webassembly port / build (push) Failing after 0s
windows port / cross-build-on-linux (push) Failing after 0s
zephyr port / build (push) Failing after 0s
Python code lint and formatting with ruff / ruff (push) Failing after 0s
unix port / macos (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Has been cancelled
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (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
Fixes gcc warning when -Wsign-conversion is on.

Signed-off-by: Yoctopuce <dev@yoctopuce.com>
2025-01-02 13:36:33 +11:00
Yoctopuce
9bb6b50693 py/obj: Cast float literals to 64-bit to prevent overflow warning.
Fixes compilation warning C4307: '+': integral constant overflow.

Signed-off-by: Yoctopuce <dev@yoctopuce.com>
2025-01-02 13:33:39 +11:00
Yoctopuce
61995b53c3 extmod/moddeflate: Add missing size_t cast.
To prevent compiler warnings.

Signed-off-by: Yoctopuce <dev@yoctopuce.com>
2025-01-02 13:33:39 +11:00