Skip to content

Test Update #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4,958 commits into
base: master
Choose a base branch
from
Open

Test Update #14

wants to merge 4,958 commits into from

Conversation

maxpromer
Copy link
Member

No description provided.

@iPAS
Copy link

iPAS commented Aug 22, 2024

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)

VynDragon and others added 29 commits May 2, 2025 12:37
This enables listing all flash area partitions automagically instead of
just sotrage_partitions.  It uses the label, and the ID when not present.

Signed-off-by: Vdragon <[email protected]>
Enable Analog inputs.  Requires Zephyr >= v3.8.0.

Signed-off-by: Ayush Singh <[email protected]>
Fixes thread safety issue that could cause memory corruption on ports
with (MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL) - currently only rp2 and
unix have this configuration.

Adds unit test for TLS sockets that exercises this code path.  I wasn't
able to make this fail on rp2, the race condition window is pretty narrow
and may not have a direct impact on a quiet system.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <[email protected]>
This commit fixes three open issues related to the asyncio scheduler
exiting prematurely when the main task queue is empty, in cases where
CPython would not exit (for example, because the main task is not done
because it's on a different queue).

In the first case, the scheduler exits because running a task via
`run_until_complete` did not schedule any dependent tasks.

In the other two cases, the scheduler exits because the tasks are queued in
an event queue.

Tests have been added which reproduce the original issues.  These test
cases document the unauthorized use of `Event.set()` from a soft IRQ, and
are skipped in unsupported environments (webassembly and native emitter).

Fixes issues #16759, #16569 and #16318.

Signed-off-by: Yoctopuce dev <[email protected]>
This is a follow-up to 1e92bdd correcting
more of the instances where "Sparkfun" should be "SparkFun".

Signed-off-by: Damien George <[email protected]>
To the Microchip Web site.  Thanks to Matt Trentini for suggesting this
site.

Signed-off-by: robert-hh <[email protected]>
To make it compliant with the documentation.  The default value is 50000us.

Signed-off-by: robert-hh <[email protected]>
That is done by adding the offset to epoch, following the scheme from the
RP2 port.  RTC and `ticks_us()` are not precisely in sync, and so the
difference between `time.time_ns()/1e9` and `time.time()` will increase by
more than 9 seconds/24h.  So applications should avoid using `time.time()`
and `time.time_ns()` in the same context.

Signed-off-by: robert-hh <[email protected]>
Fixes in this commit:
- The wrong loader script was assigned for SAMD_GENERIC_D51X20, causing the
  VFS block count to be wrong.
- Change the VFS block size from 1536 to 2048.  With the setting of 1536,
  writing more that 1536 bytes at once failed.  This applies to
  SAMD_GENERIC_D51X19 and SAMD_GENERIC_D51X20.  No other SAMD51 board uses
  the internal flash for the file system.

Signed-off-by: robert-hh <[email protected]>
Changes in this commit:
- Check for the proper SFDP header.
- Use the flash size information from SFDP, if present.
- Add two more special flash chips <= 1 MByte without SFDP.  JEDEC-ID table
  for special flash types instead of a series of conditional statements.
- Add a compile flag `MICROPY_HW_SPIFLASH_SIZE` to set the size in
  `mpconfigboard.h`, which replaces getting the size from the JEDEC ID or
  the SFDP record.

Signed-off-by: robert-hh <[email protected]>
Since all QSPI flash device used by this port are defined, this code was
only used unintentionally.  Besides that it was incomplete, so better drop
it.

Note: The flash type for Mini-SAM had to be changed too.

Signed-off-by: robert-hh <[email protected]>
Going above the root directory (/../foo) now gives an error.  This is an
intentional change made by LittleFS.  It required a update of the testsuite
and is a (minor) compatibility break.

Signed-off-by: Daniël van de Giessen <[email protected]>
Getting this to work required fixing a small issue in `lfs2_util.h`, which
has been submitted upstream.

Signed-off-by: Daniël van de Giessen <[email protected]>
This ensures the check in MP_NLR_JUMP_HEAD works as expected and
nlr_jump_fail gets called so we get a bit better error message.

Signed-off-by: Daniël van de Giessen <[email protected]>
This commit adds the required functionality for a peripheral to create
services at runtime, using `BLE.register_services()`.

The feature is enabled on the nrf52840dk_nrf52840 board.

Note that the `CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION=n` option must be used
so that BLE notifications/indications can be sent even if not subscribed.

Signed-off-by: danicampora <[email protected]>
These both need to fit a pointer, so make them `intptr_t` and `uintptr_t`,
similar to other ports.

Signed-off-by: Anton Blanchard <[email protected]>
This is only a surface level refactor, some deeper refactoring would be
possible with (for example) the SDIO interface in mimxrt and stm32, or the
BTHCI interface which is is similar on supported ports. But sticking to
cases where the macros are the same across all ports.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <[email protected]>
This means the fix from dd1465e will also apply to stm32 and mimxrt ports
that use CYW43.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <[email protected]>
This is a convenient way to deploy firmware to an RP2xxx-based board.

Signed-off-by: Damien George <[email protected]>
The bit position of CHAIN_TO is not the same as on RP2040.

Signed-off-by: Damien George <[email protected]>
IOBase is quite an important building block of other parts of the system,
such as `mpremote mount` and running .mpy and native tests.

This feature costs +244 bytes of firmware size on ARM Thumb2 architectures,
which is worth the cost for the extra features it enables.

The change here means that `io.IOBase` is now enabled on all nrf boards,
(previously it was only nRF52840 and nRF9160) and also B_L072Z_LRWAN1
(there is no change to other ports or boards).

Signed-off-by: Damien George <[email protected]>
This is a workaround for this upstream issue:
raspberrypi/pico-sdk#2448

Can be removed after the next pico-sdk update.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <[email protected]>
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.

Also split out the duplicate string to a top-level array (probably the
duplicate string literal was interned, so unlikely to have any impact.)

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <[email protected]>
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <[email protected]>
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.

It would be preferable to just disable this warning, but Clang
-Wunknown-warning-option kicks in even when disabling warnings so this
becomes fiddly to apply.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <[email protected]>
The Let's Encrypt root certificate has changed so needs updating in these
tests.

Also use `bytes.fromhex()` instead of `binascii.unhexlify()`, to eliminate
the need for the `binascii` module.  Both of these features are controlled
by `MICROPY_PY_BUILTINS_BYTES_HEX`, so the test will still work on the same
targets that it previously did.

Signed-off-by: Damien George <[email protected]>
iabdalkader and others added 30 commits June 26, 2025 13:25
The firmware for this board will now be built and available automatically.

Signed-off-by: iabdalkader <[email protected]>
This check, runtime-enabled by default in gcc 13 (and existing at least
since gcc 12, but runtime-disabled) changes the stack layout in ways that
are not compatible with assumptions spread across the core code (nlr, gc,
and stack checking).

Signed-off-by: Jeff Epler <[email protected]>
This commit adds two macros that lets check whether a given value can
fit an arbitrary number of bits, either as a signed or as an unsigned
number.

The native emitter code backends perform a lot of bit size checks to see
if a particular code sequence can be emitted instead of a generic one,
and each platform backend has its own ad-hoc macros (usually one per bit
count and signedness).

With these macros there's a single way to perform those checks, plus
there's no more chance for off-by-one mask length errors when dealing
with signed numbers.

Signed-off-by: Alessandro Gatti <[email protected]>
This commit expands the implementation of Viper load/store operations
that are optimised for the RV32 platform.

Given the way opcodes are encoded, all value sizes are implemented with
only two functions - one for loads and one for stores.  This should
reduce duplication with existing operations and should, in theory, save
space as some code is removed.  Both load and store emitters will
generate the shortest possible sequence (as long as the stack pointer is
not involved), using compressed opcodes when possible.

Signed-off-by: Alessandro Gatti <[email protected]>
This commit expands the implementation of Viper load/store operations
that are optimised for the Arm platform.

Now both load and store emitters should generate the shortest possible
sequence in all cases.  Redundant specialised operation emitters have
been folded into the general case implementation - this was the case of
integer-indexed load/store operations with a fixed offset of zero.

Signed-off-by: Alessandro Gatti <[email protected]>
This commit expands the implementation of Viper load/store operations
that are optimised for the Xtensa platform.

Now both load and store emitters should generate the shortest possible
sequence in all cases.  Redundant specialised operation emitters have
been aliased to the general case implementation - this was the case of
integer-indexed load/store operations with a fixed offset of zero.

Signed-off-by: Alessandro Gatti <[email protected]>
This commit removes load/store opcode implementations that have been
made redundant in 1f5ba69.

Signed-off-by: Alessandro Gatti <[email protected]>
This commit expands the implementation of Viper load/store operations
that are optimised for the x86 platform.

Unlike other platforms, x86 already implemented all necessary
functions and all it took to expose these to Viper after the
infrastructure refactoring was to add a few defines.

Signed-off-by: Alessandro Gatti <[email protected]>
This commit expands the implementation of Viper load/store operations
that are optimised for the x86 platform.

Like x86, x64 already implemented all necessary functions and all it
took to expose these to Viper after the infrastructure refactoring
was to add a few defines.

Signed-off-by: Alessandro Gatti <[email protected]>
This commit reworks the Viper pointer boundary tests in order to make
them more accurate and easier to extend.

The tests are now easier to reason about in their output, using easier
to read values, and bit thresholds are now more configurable.  If a new
conditional code sequence is introduced, adding a new bit threshold is
just a matter of adding a value into a tuple at the beginning of the
relevant test file.

Load tests have also been made more accurate, with better function
templates to test register-indexed operations.

Signed-off-by: Alessandro Gatti <[email protected]>
This commit introduces a mechanism to customise the code that is
injected to the board when performing a test file upload and execution.

A new argument, --begin", is added so regular Python code can be
inserted in the injected fragment between the module file creation and
the effective file import.  This is needed for running larger tests
(usually ones that have been pre-compiled with
"--via-mpy --emit native") on ESP8266, as that board does not have
enough memory to fit certain blocks of code unless additional
configuration is performed.

Signed-off-by: Alessandro Gatti <[email protected]>
This commit cleans up the single entry point integer-indexed load/store
emitters that have been built by merging the single operand type
load/store functions in 1f5ba69.

To follow the same convention found in RV32 and Xtensa emitters, the
function operand size is not named after the left shift amount to apply
to the initial offset to get its true byte offset, but by a generic
"operand size".

Also, those functions were updated to use the new MP_FIT_UNSIGNED macros
to perform bit width checks when figuring out which opcode encoding is
the best one to use.

Signed-off-by: Alessandro Gatti <[email protected]>
Matches existing `Pin.irq()` API.  Both rising and falling edge work.

Signed-off-by: iabdalkader <[email protected]>
Poll events during SPI transfer (USB fails during long transfers
otherwise).  And add a timeout for the blocking transfer.

Signed-off-by: iabdalkader <[email protected]>
JavaScript code uses "Symbol in object" to brand check its own proxies, and
such checks should also work on the Python side.

Signed-off-by: Andrea Giammarchi <[email protected]>
Changes in this commit:
- Handle SerialException on Windows when device disconnects.
- Print clean 'device disconnected' message instead of stack trace.
- Fix terminal formatting issues on Linux after disconnect.
- Return disconnected state after console cleanup to avoid terminal issues.

This ensures proper disconnect messages on both platforms without showing
confusing error traces to users.

Signed-off-by: Andrew Leech <[email protected]>
This commit introduces an optional feature to provide to native emitters
the fully qualified name of the entity they are compiling.

This is achieved by altering the generic ASM API to provide a third
argument to the entry function, containing the name of the entity being
compiled.  Currently only the debug emitter uses this feature, as it is
not really useful for other emitters for the time being; in fact the
macros in question just strip the name away.

Signed-off-by: Alessandro Gatti <[email protected]>
The unix coverage variant should have all features enabled, so they can be
tested for coverage.  Therefore, enabled `MICROPY_PY_SYS_SETTRACE`.

Signed-off-by: Jeff Epler <[email protected]>
If the fields added for `MICROPY_PY_SYS_SETTRACE` are not initialized
properly, their value in a thread is indeterminate.  In particular, if the
callback is not NULL, it will be invoked as a function.

Signed-off-by: Jeff Epler <[email protected]>
When `MICROPY_PY_SYS_SETTRACE` was enabled, a crash was seen in the
qemu_mips build.  It seems likely that this was due to these added fields
not being initialized.

Signed-off-by: Jeff Epler <[email protected]>
The argument corresponding to a `%q` specifier must be of type `qstr`, not
a narrower type like `int16_t`.  Not ensuring this caused an assertion
error on one Windows x64 build.

The argument corresponding to a `%d` specifier must be of type `int`, not a
potentially-wider type like `mp_uint_t`.  Not ensuring this prevented the
function name from being printed on the unix nanbox build.

Signed-off-by: Jeff Epler <[email protected]>
This becomes redundant when the main coverage build includes settrace.

Signed-off-by: Jeff Epler <[email protected]>
The additional overhead of the settrace profiler means that the
`aes_stress.py` test was running too slowly on GitHub CI.  Double the
timeout to 60 seconds.

Signed-off-by: Jeff Epler <[email protected]>
This removes the need for an explicit `sys_settrace_features.py.exp` file.

This means that people testing locally will also need to install Python
3.11 in some way, such as with pyenv or uv, and use it during
`make VARIANT=coverage test`, or they will get failures.

When using Python from GitHub actions/setup-python, pip3 can't be wrapped
by sudo, because this invokes the operating system python instead.

Signed-off-by: Jeff Epler <[email protected]>
The IDF panic handler resets the watchdog timeout to prevent the printing
of the error message from being cut off by a WDT reset.  We use the exact
same function call in our wrapper function for the same purpose.

In IDFv5.4.2 the function used for this was changed from
`esp_panic_handler_reconfigure_wdts` to `esp_panic_handler_feed_wdts`,
specifically in this commit:
espressif/esp-idf@cd887ef

Signed-off-by: Daniël van de Giessen <[email protected]>
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.