Skip to content

Test Update#14

Open
maxpromer wants to merge 6514 commits into
microBlock-IDE:masterfrom
micropython:master
Open

Test Update#14
maxpromer wants to merge 6514 commits into
microBlock-IDE:masterfrom
micropython:master

Conversation

@maxpromer

Copy link
Copy Markdown
Member

No description provided.

@iPAS

iPAS commented Aug 22, 2024

Copy link
Copy Markdown

The current version (before the incoming merge) has a bug while trying to compile ports/unix.
I guess this is because of this repo is lacking behind the original which has changed the directory name from 'lib' -> 'extmod', so that AXTLS library includes a file from the wrong path.

I have to edit the code of the AXTLS library:

-------------------------- ssl/os_port_micropython.h --------------------------
index 88697f2..7d10cd9 100644
@@ -75,7 +75,7 @@ extern int mp_stream_errno;

#define TTY_FLUSH()

-#include "../../../extmod/crypto-algorithms/sha256.h"
+#include "../../../lib/crypto-algorithms/sha256.h"

#define SHA256_CTX CRYAL_SHA256_CTX
#define SHA256_Init(a) sha256_init(a)

dpgeorge and others added 29 commits May 20, 2026 22:45
Also support v5.5.4, but don't use it yet due to possible issues discussed
in #19149.

Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
Instead of unconditionally (ie when the `select` module is enabled).  This
way, a minimal board can enable the `select` module (eg for asyncio) but
still have `select.select()` disabled by default to save size.

Signed-off-by: Damien George <damien@micropython.org>
Prior to this change some of the smaller boards (eg nRF51) would have
the .py asyncio code frozen but be missing both the `select` module and
the core C-level `_asyncio` module, making `asyncio` useless.

This commit lets asyncio be configured at the makefile level, in order to
freeze the correct code.  Both the `select` and `_asyncio` modules will be
enabled if asyncio is enabled.

asyncio is now enabled by default on all boards except MICROBIT (which is
too small due to the other modules is has).  This costs about +2100 bytes
on boards that did not already have it enabled, eg PCA10028.

Signed-off-by: Damien George <damien@micropython.org>
To match other ports, and allow the `pyproject.toml` F821 ignore rule to
cover it.

Signed-off-by: Damien George <damien@micropython.org>
The UART DRE flag is always set if the DATA register is empty.  That would
lead to a TXIDLE event each time the IRQ handler was run.  To fix that,
only fire the TXIDLE event if the DRE interrupt flag is enabled.

Partially fixes the `tests/extmod/machine_uart_irq_txidle.py` test on
`ADAFRUIT_ITSYBITSY_M0_EXPRESS`.

Signed-off-by: Damien George <damien@micropython.org>
The C IRQ handler can be called with multiple IRQ flags active, eg both
RXC and DRE set.  But the Python IRQ handler should only see the events
that it registered.  So mask the flags as appropriate.

Combined with the parent commit, `tests/extmod/machine_uart_irq_txidle.py`
now passes on `ADAFRUIT_ITSYBITSY_M0_EXPRESS`.

Signed-off-by: Damien George <damien@micropython.org>
Clear TRCENA (if it was enabled for DWT CYCCNT) before
calling NVIC_SystemReset(), otherwise it spins forever.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
Signed-off-by: Damien George <damien@micropython.org>
The LPTIMER does not reset when the CPU is reset and may have state left
over, eg a timer interrupt running.  So clear that when the device starts
up.

This fixes `machine.deepsleep()` in the follow scenario: the device first
wakes via LPTIMER but then goes to deepsleep again without it, and is
unable to wake again via LPGPIO.

Signed-off-by: Damien George <damien@micropython.org>
This allows LPTIMER to wake the device from lightsleep mode.

Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
Passing in a millisecond timeout argument to `machine.lightslep()` will
configure the LPTIMER to wake the system.

Signed-off-by: Damien George <damien@micropython.org>
This allows the GPIO IRQ to be enabled even if a Python `Pin.irq()` is not
configured for that pin.

Signed-off-by: Damien George <damien@micropython.org>
To complement the existing `mp_hal_pin_config_irq_falling()`.

Signed-off-by: Damien George <damien@micropython.org>
Configure the P15_7 GPIO IRQ on the user button input so that the button
can wake the device from `machine.lightsleep()` and `machine.deepsleep()`.

(Otherwise the user needs to do it: Pin("SW").irq(trigger=Pin.IRQ_RISING).)

Signed-off-by: Damien George <damien@micropython.org>
There may be an interrupt set prior to configuring the IRQ.  So clear that
because it's usually unwanted (eg spuriously wakes device from sleep mode).

Signed-off-by: Damien George <damien@micropython.org>
The hardware I2C example showed the fallback defaults (scl=9, sda=8)
which only apply when PICO_DEFAULT_I2C is not set.  For the Pico board
the actual defaults come from the SDK and are scl=5, sda=4, matching
the SoftI2C example just above.  See ports/rp2/machine_i2c.h for the
default selection logic.

Fixes #17562.

Signed-off-by: Andrii Anoshyn <anoshyn.andrii@gmail.com>
The ``DMA.pack_ctrl()`` documentation listed ``bswap`` with a default of
``True`` but the actual default in ``DEFAULT_DMA_CONFIG`` (see
ports/rp2/rp2_dma.c) is ``False``.  Several other fields had no default
listed at all: ``ring_size``, ``ring_sel``, ``treq_sel``, ``write_err``
and ``read_err``.

* Fix ``bswap`` to document the real default of ``False``.
* Add the missing defaults for ``ring_size`` (0), ``ring_sel``
  (``False``), ``write_err`` (``False``) and ``read_err`` (``False``).
* Document the ``treq_sel`` default of ``0x3f`` (``PERMANENT``), which
  selects no external pacing and is not listed in the DREQ table in
  the RP2040 datasheet.

Fixes #18551.

Signed-off-by: Andrii Anoshyn <anoshyn.andrii@gmail.com>
The PWM section used a plain literal for the machine.PWM class name
while every other IO section on the page (Pin, UART, ADC, SPI, I2C,
etc.) links to the corresponding library page via a :ref: role. Use
the same cross-reference so the link is clickable.

Fixes #11384.

Signed-off-by: Andrii Anoshyn <anoshyn.andrii@gmail.com>
This commit takes all the separate inline assembler checks (both for
architecture and cpu-level features), and merges them into one single
script that is invoked by the test runner.

Previously, the test runner would unconditionally run at least three
feature checks on each invocation to find whether the given platform
supports the inline assembler syntax, and then would run further checks
depending on the architecture being found.  This would happen even on
architectures where it is known in advance there is no inline assembler
syntax support at all.

This change cuts down the number of feature checks being executed down
to one for each test runner invocation.  The new feature check script
will return the architecture and the inline assembler features being
found, effectively replacing the logic that was present in the test
runner.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit simplifies the code in the test runners that adds tests to
the list of skipped tests, depending on which arch features were found
during the initial feature check script execution.

Following a similar approach to the RV32 inline asm tests, tests
requiring a specific inline assembler feature will carry said feature
flag into the test name.  This allows to reject test files using a file
mask rather than keeping track of which features a test file depends on.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This allows setting the pulse width in microseconds and nanoseconds, which
is useful for certain applications.

Signed-off-by: vlad.maglasu <vlad.maglasu@vampirebyte.ro>
To reduce firmware size, so it fits with recent additions to `pyb.Timer`.

Signed-off-by: Damien George <damien@micropython.org>
Read clock speed before entering direct mode (flash access is unavailable
while QMI direct mode is enabled).

Signed-off-by: phuzzyday <phuzzyd@yahoo.ca>
Move MICROPY_HW_FLASH_STORAGE_BYTES to per-board cmake files and expose it
as both a linker symbol (to define FLASH and FLASH_FS memory regions in the
linker script) and a C compile definition (so rp2_flash.c computes the
correct storage base address).  By giving FLASH a bounded LENGTH, the
linker will error if the firmware grows into the filesystem partition.

Replace the post-build `size` command with the `-Wl,--print-memory-usage`
linker flag, which reports usage per memory region including the new
FLASH_FS region.

Signed-off-by: Denis Dowling <dpd@opsol.com.au>
The adds a board definition for the Soldered NULA Max RP2350 which has the
following features:
- RP2350 chip
- RP Radio Module 2
- MicroSD card reader
- 16MB of flash

The board contains initialization code for all said modules and settings.

Signed-off-by: Josip Šimun Kuči <josipsimunkuci@gmail.com>
Add board configuration for Adafruit Feather RP2350 board
https://www.adafruit.com/product/6000.

With a workaround in `mp_adafruit_feather_rp2350.h` for pico-sdk bug #2112.

Tested on both variants of the board (with and without 8MB PSRAM).  PSRAM
autodetection appears to work correctly.

Signed-off-by: Jacob Peck <gatesphere@gmail.com>
agatti and others added 30 commits July 5, 2026 01:11
This commit updates the entry point trampoline generation, making sure
that the requested text segment alignment is taken into account.

x86 and x64 object files generated by GCC have no forced section
alignment for the text segment, so the trampoline only needs to be
generated once as addresses won't move around when the MPY file is
assembled.  This is not the case for Clang-generated objects, which have
a section alignment of 4, and so the address calculation needs to take
this into account.

As this is still experimental, the trampoline calculation hasn't been
generalised into one single block of code.  If no section alignment is
requested then the old calculation is performed.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit introduces support for the R_ARM_GOT_PREL relocation, found
in the text segment of certain Arm native modules.

Until now this was not needed, since the only supported compiler for
linking native modules was GCC, which did not seem to ever generate such
a relocation.

With the recent work in making Clang a supported compiler as well, it
was quickly found out that such a compiler actually does generate such a
relocation type.  This relocation seem to be enough to at least make
`examples/natmod/features0` link with Clang targeting `armv7m`, and then
run the output native module on an appropriate interpreter running under
the QEMU MPS2-AN500 target.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit fixes building the `btree` module using Clang rather than
using GCC, on x86, x64, and ArmV7 targets.

The Clang standard library (libc) implementation of `memset` for x86 and
x64 depends on functions that have a non-empty data section, which is not
currently supported.  Therefore we provide our own `memset`
implementation that is good enough to let linking succeed for `x86` and
`x64` targets.  On a more general note, Clang also required some
additional flags to disable an extra warning that GCC did not seem to
raise.

On Arm targets, `memset` is not a builtin of the compiler toolchain, so
it has to be fetched from the runtime support library.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit fixes building the `deflate` module using Clang rather than
using GCC, on x86, x64, and ArmV7 targets.

The Clang standard library (libc) implementation of `memset` for x86 and
x64 depends on functions that have a non-empty data section, which is not
currently supported.  Therefore we provide our own `memset`
implementation that is good enough to let linking succeed for `x86` and
`x64` targets.

On Arm targets, `memset` is not a builtin of the compiler toolchain, so
it has to be fetched from the runtime support library.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit fixes building the `features2` module using Clang rather than
using GCC.

Parts of the floating point support code for Clang may end up in libc.a
rather than its builtins support library.  This is the case for the
armv7m target, so we have to force linking symbols from libc.a in that
case.  Depending on the toolchain, this may or may not build
successfully, but the location of the `roundf` symbol should not move
across toolchains.

This makes it work on armv6m, rv32imc, and possibly on armv7m too.  The
latter depends on whether Clang's builtins support library not relying
on features that are unsupported by `tools/mpy_ld.py`.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit fixes building the `framebuf` module using Clang rather than
using GCC, on x86, x64, and ArmV7 targets.

The Clang standard library (libc) implementation of `memset` for x86 and
x64 depends on functions that have a non-empty data section, which is not
currently supported.  Therefore we provide our own `memset`
implementation that is good enough to let linking succeed for `x86` and
`x64` targets.

On Arm targets, `memset` is not a builtin of the compiler toolchain, so
it has to be fetched from the runtime support library.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit fixes building the `re` module using Clang rather than using
GCC, on x86, x64, and ArmV7 targets.

The Clang standard library (libc) implementation of `memset` for x86 and
x64 depends on functions that have a non-empty data section, which is not
currently supported.  Therefore we provide our own `memset`
implementation that is good enough to let linking succeed for `x86` and
`x64` targets.

On Arm targets, `memset` is not a builtin of the compiler toolchain, so
it has to be fetched from the runtime support library.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit forces usage of an i686 cross-compiler for 32-bits x86 Unix
port builds, instead of relying on the "-m32" flag passed to the
currently installed GCC version.

Before this change it was not possible to build an x86 native module on
anything but an x86/x64 machine, since the scripts used the generic
"gcc" compiler installed on the system the code was built on.  Recent
Ubuntu versions (at least five years old now) provide a 32-bits x86
cross-compiler on all supported machines ("gcc-i686-linux-gnu" and
"g++-i686-linux-gnu"), and since the CI uses Ubuntu as its base OS, that
compiler is now used for x86 builds.

Installing said cross-compiler, though, conflicts with the
"gcc-multilib" and "g++-multilib" packages that are installed on the CI
image as part of the 32-bits jobs setup procedure.  This means that all
32-bits x86 builds have to be migrated to the new cross-compiler as
well.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit removes support for forced 32-bits builds of the Unix port,
as it only worked on x64 machines and x86 usage is low enough these days
to allow making changes on how the latter target is built.

Passing such flag to the Unix makefile will stop the build, as the flag
itself will be removed from MicroPython entirely (right now only the
MinGW Windows builds use it) in subsequent commits.

CI build scripts had to be updated to manually pass the necessary flags
that were once implied by MICROPY_FORCE_32BIT, for all targets that are
meant to build 32-bits binaries.

Finally, documentation for the Unix port has been updated with a section
explaining how to make x86 builds on x64 hosts work again.  Given that
the 32-bits builds now use a cross-compiler, then other machines for
which such a compiler is available can build x86 binaries too (eg.
AArch64 or RISC-V 64).

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit moves the definition of the "MICROPY_FORCE_32BIT" build flag
away from the core's Makefile definition, migrating it to the Windows
port's Makefile instead.

Both Windows and Unix ports used this flag, which was intrinsically x64
specific.  Since the Unix port is no longer using it and the Windows
port is currently limited to x86/x64 builds it makes more sense to move
that flag's support away from MicroPython's core.

This assures that MinGW builds will still operate as usual without any
changes.  Support for this flag will probably be removed from the Windows
port (and therefore from MicroPython) when Windows/Arm builds will show
up.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit adds support for the ESP32-H2 processor from Espressif in the
form of two board definitions - ESP32_GENERIC_H2 and M5STACK_NANOH2.

Completed testing on the M5StackH2:
- tested GPIO via on board LED
- tested ADC channels can be read
- I2C & SPI instantiation
- BLE packet scanner
- run_tests.py

Signed-off-by: Rafal Wadowski <rafal@wadowski.com.au>
Added pins for I2S.

Added ESP32-H2 check to reduce number of SPI peripherals.

Signed-off-by: Rafal Wadowski <rafal@wadowski.com.au>
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Raises LookupError for not implemented error handlers.

Improves repr() rendering for unicode.

Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Only accepts `utf-8`, `utf8` or `ascii`

Fixes #15849

Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Fixes: issue 3364
Fixes: issue 13084

Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
Fixes Issue 17827

Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
Prevent the test from failing by not testing known unsupported characters.
These will be documented in a cpydiff test.

Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
These are now printed as characters rather than escaped bytes.

Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.