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,705 commits into
base: master
Choose a base branch
from
Open

Test Update #14

wants to merge 4,705 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)

dpgeorge and others added 29 commits March 5, 2025 12:23
For a given MicroPython firmware/executable it can be sometimes important
to know how it was built, which variant/board configuration it came from.

This commit adds a new field `sys.implementation._build` that can help
identify the configuration that MicroPython was built with.

For now it's either:
* <VARIANT> for unix, webassembly and windows ports
* <BOARD>-<VARIANT> for microcontroller ports (the variant is optional)

In the future additional elements may be added to this string, separated by
a hyphen.

Resolves issue #16498.

Signed-off-by: Damien George <[email protected]>
Simple implementation in-line with the rest of the MicroPython ports

Tested on the nRF52832 and the nRF5340.

Signed-off-by: danicampora <[email protected]>
This allows running `py/makeqstrdata.py` with MicroPython itself.

Signed-off-by: Volodymyr Shymanskyy <[email protected]>
Signed-off-by: Angus Gratton <[email protected]>
This allows running mpy-tool using MicroPython itself.

An appropriate test is added to CI to make sure it continues to work.

Signed-off-by: Volodymyr Shymanskyy <[email protected]>
Signed-off-by: Angus Gratton <[email protected]>
Signed-off-by: Volodymyr Shymanskyy <[email protected]>
Signed-off-by: Angus Gratton <[email protected]>
This commit introduces the ability to obtain a list of stations
connected to the device when in soft-AP mode.

A new parameter ("stations") to pass to WLAN.status is supported,
returning a tuple of (bssid, ipv4) entries, one per connected station.
An empty tuple is returned if no stations are connected, and an
exception is raised if an error occurred whilst building the python
objects to return to the interpreter.

Documentation is also updated to cover the new parameter.

This fixes #5395.

Signed-off-by: Alessandro Gatti <[email protected]>
When writing to flash, the source buffer only needs to be read-only, not
writable.  This fix allows passing in `bytes` and other read-only buffer
objects.

Signed-off-by: Damien George <[email protected]>
This allows defining a `memoryview` instance, either statically or on the
C stack.

Signed-off-by: Damien George <[email protected]>
This is a generic interface to allow querying and modifying the read-only
memory area of a device, if it has such an area.

Signed-off-by: Damien George <[email protected]>
This function will attempt to create a `VfsRom` instance and mount it at
location "/rom" in the filesystem.

Signed-off-by: Damien George <[email protected]>
This is put in `mp_init()` to make it consistent across all ports.

Signed-off-by: Damien George <[email protected]>
These commands use the `vfs.rom_ioctl()` function to manage the ROM
partitions on a device, and create and deploy ROMFS images.

Signed-off-by: Damien George <[email protected]>
This commit implements `vfs.rom_ioctl()` to query, erase and write both
internal and external flash, depending on how the board configures its
flash memory.

A board can configure ROM as follows.

To use internal flash memory:

    #define MICROPY_HW_ROMFS_ENABLE_INTERNAL_FLASH (1)

To use external flash memory (QSPI memory mapped):

    #define MICROPY_HW_ROMFS_ENABLE_EXTERNAL_QSPI (1)
    #define MICROPY_HW_ROMFS_QSPI_SPIFLASH_OBJ (&spi_obj)

Then the partition must be defined as symbols in the linker script:

    _micropy_hw_romfs_part1_start
    _micropy_hw_romfs_part1_size

And finally the partition needs to be enabled:

    #define MICROPY_HW_ROMFS_ENABLE_PART1 (1)

There's support for a second, optional partition via:

    _micropy_hw_romfs_part2_start
    _micropy_hw_romfs_part2_size

    #define MICROPY_HW_ROMFS_ENABLE_PART1 (1)

Signed-off-by: Damien George <[email protected]>
Using unused and previously inaccessible external QSPI flash.

Signed-off-by: Damien George <[email protected]>
Not enabled by default on any board.  A board can enable a ROMFS partition
by defining `MICROPY_HW_ROMFS_BYTES` in its `mpconfigboard.h` file.  For
example:

    #define MICROPY_HW_ROMFS_BYTES (128 * 1024)

The ROMFS partition is placed at the end of the flash allocated for the
firmware, giving less space for the firmware.  It then lives between the
firmware and the read/write filesystem.

Signed-off-by: Damien George <[email protected]>
Not enabled by default on any board.  For a board to enable ROMFS it must:

- Add `#define MICROPY_VFS_ROM (1)` to its `mpconfigboard.h` file.

- Use `partitions-4MiB-romfs.csv` as its partitions file (or a similar
  partitions definition that has an entry labelled "romfs").

Signed-off-by: Damien George <[email protected]>
Not enabled by default on any board.  For a board to enable ROMFS it must:

- Add `#define MICROPY_VFS_ROM (1)` to its `mpconfigboard.h` file.

- Add a FLASH_ROMFS partition to the linker script and expose the partition
  with:

    _micropy_hw_romfs_start = ORIGIN(FLASH_ROMFS);
    _micropy_hw_romfs_size = LENGTH(FLASH_ROMFS);

Signed-off-by: Damien George <[email protected]>
The same as the 2M flash variant but with a 320KiB ROM partition.

Signed-off-by: Damien George <[email protected]>
Simple `machine.Timer` implementation in-line with the rest of the
MicroPython ports.

Note: Only virtual timers are supported (not linked to any particular
hardware peripheral).

Tested with the nRF5340 and the nRF52840.

Signed-off-by: danicampora <[email protected]>
Includes various fixes and improvements to the WLAN driver, in particular:
- Add WPA3 STA and AP support.
- Attempt to reconnect to AP in response to validation error.
- Update 43439 BT firmware for Data Length Extension fix.

Signed-off-by: Damien George <[email protected]>
These are now supported by cyw43-driver.

Signed-off-by: Damien George <[email protected]>
Removes redundant metadata from each, shouldn't otherwise change
any build output.

Reverts the split originally added in e465012.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <[email protected]>
Reverts workaround added in acbdbcd.

According to the linked ESP-IDF issue this was only a problem for ESP-IDF
V5.0.x, and support for versions older than V5.2 was dropped in 6e5d8d0.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <[email protected]>
Previously ESP32-S3 SDMMC could only use fixed pin assignments, however the
ESP-IDF defaults don't match common boards. The chip also supports using
GPIO Matrix to assign any pin.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <[email protected]>
These micros don't have full SDMMC host support, but they can initialise
the SDCard in SPI mode.

A bit limited on C3 and C6 as they only have one host SPI peripheral.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <[email protected]>
This increases binary size by about 4KB on C3, probably a bit less on S2.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <[email protected]>
The ESP32 PWM (LEDC) timer wasn't correctly stopped.  `ledc_timer_rst()` is
for resetting the timer counter to zero, not for stopping the timer.

The correct way to stop a pwm timer is to pause it, then configure it with
`deconfigure = true`.

Signed-off-by: garywill <[email protected]>
When we don't use USB JTAG, we want to use the two USB pins (D+/D-) as
GPIO. So, do clear USB_SERIAL_JTAG_USB_PAD_ENABLE when USB SERIAL JTAG is
not enabled

Signed-off-by: Garry W <[email protected]>
Signed-off-by: Angus Gratton <[email protected]>
iabdalkader and others added 30 commits April 22, 2025 12:50
Update the cyw43 configuration to use the new BTHCI UART backend provided
by cyw43-driver.

Signed-off-by: iabdalkader <[email protected]>
It has been completely replaced by equivalent code in cyw43-driver.

Signed-off-by: iabdalkader <[email protected]>
Brings it into sync with a matching change to micropython-lib (which was
much older).  Includes one small automatic fix.

Signed-off-by: Angus Gratton <[email protected]>
These functions are only available when `MICROPY_PY_BUILTINS_BYTES_HEX` is
enabled.

Signed-off-by: Damien George <[email protected]>
This commit makes a slight change to the vfs_posix test suite to let it
pass on Android.

On Android, non-root processes can perform most filesystem operations
only on a restricted set of directories.  The vfs_posix test suite
attempted to enumerate the filesystem root directory, and said directory
happens to be restricted for non-root processes.  This would raise
an EACCES OSError and terminate the test with a unexpected failure.

To fix this, rather than enumerating the filesystem root directory the
enumeration target is the internal shared storage area root - which
doesn't have enumeration restrictions for non-root processes.  The path
is hardcoded because it is guaranteed to be there on pretty much any
recent-ish device for now (it stayed the same for more than a decade for
compatibility reasons).  The proper way would be to query the storage
subsystem via a JNI round-trip call, but this introduces too much
complexity for something that is unlikely to break going forward.

Signed-off-by: Alessandro Gatti <[email protected]>
The output of 'idf.py size' has changed, plus some other cleanups around
build dir name, etc.  Can now run on v5.2.2 and v5.4.1, probably other
versions.

Signed-off-by: Angus Gratton <[email protected]>
Because the `wbits` parameter was only added to `zlib.compress` in
CPython 3.11.  Using `zlib.compressobj` makes the code compatible with much
older CPython versions.

Fixes issue #17140.

Signed-off-by: Damien George <[email protected]>
This updates lwIP from STABLE-2_2_0_RELEASE, which was released in
September 2023.  The latest STABLE-2_2_1_RELEASE was released in February
2025.

Signed-off-by: Damien George <[email protected]>
This requires explicitly naming and initializing all members so add that
where needed and possible.  For MP_DEFINE_NLR_JUMP_CALLBACK_FUNCTION_1
this would require initializing the .callback member, but that's a bit
of a waste since the macro is always followed by a call to
nlr_push_jump_callback() to initialize exactly that member, so rewrite
the macro without initializers.

Signed-off-by: stijn <[email protected]>
Add code using all relevant macros to make sure they initialize
structs correctly.

Signed-off-by: stijn <[email protected]>
This rewrites the code that previously manually emitted and caught various
OSError subclasses with equivalent code that uses the errno name dictionary
to do this generically, and updates the exception handler in do_filesystem
to catch them in a similarly-generic fashion using os.strerror to retrieve
an appropriate error message text equivalent to the current messages.

Note that in the CPython environments where mpremote runs, the call to the
OSError constructor already returns an instance of the corresponding mapped
exception subtype.

Signed-off-by: Anson Mansfield <[email protected]>
Removes the risk of inadvertently deleting files on the host by preventing
the deletion of files via `rm -r` on the `/remote` vfs mount point.

Fixes issue #17147.

Signed-off-by: Jos Verlinde <[email protected]>
The (deprecated) kconfig option NET_SOCKETS_POSIX_NAMES was removed in
commit abad505bdeed6102061767f45acd63323973f564 so remove it from our
configuration.

As the option has been deprecated longer, this also works for v3.7 and
v4.0 the other still supported versions.

Signed-off-by: Detlev Zundel <[email protected]>
Commit 1b6e0f64796dfd6f86a8679ea6d24e1fca1e63a8 for Zephyr v4.0.0
changed the function "thread_analyzer_print" to require a cpu argument
and allow thread analysis on each cpu separately. The argument is
ignored when THREAD_ANALYZER_AUTO_SEPARATE_CORES=n which is the
default on single core machines.

Promote this change to the MicroPython zephyr module.

Signed-off-by: Detlev Zundel <[email protected]>
Signed-off-by: Maureen Helm <[email protected]>
Commit 07a8e3253a2d8a2076c9c83c4ed4158fa3fbb2a2 removes
CONFIG_MMC_VOLUME_NAME from the Kconfig space. Instead we need to use
the device tree to find the "disk-name" property of "zephyr,mmc-disk"
devices.

Signed-off-by: Detlev Zundel <[email protected]>
Updates the Zephyr port build instructions. The CI is updated to use
Zephyr docker image 0.27.4, SDK 0.17.0 and the latest Zephyr release
tag.

Tested on max32690fthr and frdm_k64f.

Signed-off-by: Maureen Helm <[email protected]>
Signed-off-by: Detlev Zundel <[email protected]>
Implement PWM support using standard zephyr APIs, exposed as the standard
MicroPython `machine.PWM` class.

Signed-off-by: Ayush Singh <[email protected]>
Add docs for PWM support.

Signed-off-by: Ayush Singh <[email protected]>
Enable PWM config for bcf.

Signed-off-by: Ayush Singh <[email protected]>
Enables the ability to use frozen modules in the zephyr port.

Enabled by adding `CONFIG_MICROPY_FROZEN_MODULES` to the board
configuration file.  Manually set manifest path with
`CONFIG_MICROPY_FROZEN_MANIFEST`.

Signed-off-by: Vdragon <[email protected]>
Add support for the nrf5340dk.  This DK has a MX25R64 8mb external QSPI
flash chip.

Compile using:

    $ west build -b nrf5340dk/nrf5340/cpuapp

Signed-off-by: Patrick Joy <[email protected]>
Add support for the nrf9151dk.  This DK has a GD25WB256 32mb external QSPI
flash chip.

Signed-off-by: Patrick Joy <[email protected]>
Only a few ports have TCP/IP loopback enabled in their network stack, and
this test will only pass on those ports.  There's not really any good way
to do a feature check for loopback mode without actually running the test
and seeing if it passes/fails, so add an explicit check that the test is
running on a port known to support loopback.

(Enabling loopback on lwIP, eg RPI_PICO_W, costs +568 code and +272 bss and
is a rarely used feature, so not worth unconditionally enabling.)

Signed-off-by: Damien George <[email protected]>
This test is rather complicated and benefits from being a unittest.

Signed-off-by: Damien George <[email protected]>
Changes in this commit:
- Allow the DMA instance to be any instance, not just DMA(0); eg WLAN may
  be using DMA(0).
- Make the DMA timing test run a little faster by preloading `dma.active`.
- Run the DMA timing test 10 times and take the average time taken as the
  test result, to eliminate any big effects of caching.
- Change the expected time to `range(30, 80)` to cover RP2040, RP2350,
  RISC-V variants, and both bytecode and native emitter.
- Add a `sleep_ms(1)` after waiting for the IRQ to fire, so that any
  scheduled code gets a chance to run when the test is compiled with the
  native emitter.

With these changes this test passes reliably on RPI_PICO, RPI_PICO_W,
RPI_PICO2, RPI_PICO2_W, RPI_PICO2-RISCV and RPI_PICO2_W-RISCV, in both
bytecode and native emitter mode, with and without WLAN enabled.

Signed-off-by: Damien George <[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.