summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-10-23lib/libm_dbl: Allow building when DBL_EPSILON is defined in <float.h>.Jeff Epler
This is the case in arm-none-eabi-gcc 14.2.1 (debian trixie). This fixes a diagnostic like: ../../lib/libm_dbl/libm.h:92:9: error: "DBL_EPSILON" redefined [-Werror] /usr/lib/gcc/arm-none-eabi/14.2.1/include/float.h:114:9: note: this is the location of the previous definition when building MPS2_AN500 (qemu port). Signed-off-by: Jeff Epler <jepler@unpythonic.net>
2025-10-23all: Simplify mp_int_t/mp_uint_t definition.Jeff Epler
Assuming proper C99 language support, we can select "the int type as big as a pointer" (most of the time) or "the 64-bit int type" (nanboxing with REPR_D), and then define everything else automatically. This simplifies port configuration files. And the types can still be overridden if needed. Signed-off-by: Jeff Epler <jepler@unpythonic.net>
2025-10-23tools/ci.sh: Cross build 64-bit windows on Linux.Jeff Epler
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
2025-10-23README: Define and describe the port Tier levels.Damien George
MicroPython has quite a few ports now (20 of them), but not all are in the same stage of development. This commit attempts to define port Tier levels and assign a Tier to each of the existing ports. The main aim here is to set expectations for the level of support and development each port gets. And also lower the bar of entry for new ports so they can enter at a low Tier and gradually rise up to Tier 1. See prior art here: - https://peps.python.org/pep-0011/ - https://doc.rust-lang.org/rustc/target-tier-policy.html - https://docs.zephyrproject.org/latest/project/release_process.html#hardware-support-tiers Signed-off-by: Damien George <damien@micropython.org> Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-10-22zephyr/boards: Add NXP MIMXRT1020 EVK board.Ned Konz
This board has plenty of RAM, flash, and peripherals, including Ethernet. It also has a microSD slot, which also works. Access to the REPL is via UART1, which is available via the DAPLink connector J23. Signed-off-by: Ned Konz <ned@metamagix.tech>
2025-10-22zephyr/boards: Add XIAO BLE NRF52840 SENSE board.Ned Konz
This commit adds Zephyr support for the XIAO BLE NRF52840 SENSE board from Seeed Studio. It also provides a good example of a richer Zephyr port than the default, adding: - Frozen modules (including asyncio, upysh, aioble and aiorepl). - Enough MicroPython features to support using aioble (at least for the `temp_sensor.py` example). - JSON, random, re, struct, etc. Signed-off-by: Ned Konz <ned@metamagix.tech>
2025-10-22zephyr: Add erase block size to FlashArea.areas entries.Ned Konz
This commit changes the values in the `FlashArea.areas` dictionary from simple integer IDs to (ID, erase-block-size) tuples. `_boot.py` was changed to use the newly available erase block size. Signed-off-by: Ned Konz <ned@metamagix.tech>
2025-10-22zephyr: Mount all disks and flash partition, formatting if necessary.Ned Konz
Existing C code in `main.c` only mounts a flash filesystem if one exists, and doesn't do anything if the 'storage' partition is not formatted. This commit moves the mounting logic from `main.c` to frozen code using `modules/_boot.py` and adds the formatting of a previously unformatted partition if the mount fails. Every available disk (in the newly added `DiskAccess.disks` tuple) will be mounted on separate mount points (if they're formatted), and the 'storage' flash partition (if any) will be mounted on /flash (and will be formatted as LFS2 if necessary). Also, `sys.path` will be updated with appropriate 'lib' subdirectories for each mounted filesystem. The current working directory will be changed to the last `DiskAccess.disk` mounted, or to /flash if no disks were mounted. Then `boot.py` and `main.py` will be executed from the current working directory if they exist. Thanks to @VynDragon for the logic in `zephyr/zephyr_storage.c`. Signed-off-by: Ned Konz <ned@metamagix.tech>
2025-10-22tools/ci.sh: Init micropython-lib submodule for zephyr build.Damien George
The zephyr port doesn't have a Makefile so can't run `make submodules`. Instead they must be explicitly initialized. Signed-off-by: Damien George <damien@micropython.org>
2025-10-20tests/run-tests.py: Allow port:<dev> specification in run-multitests.py.Damien George
This moves the `port:<dev>` check for the test instance to the `convert_device_shortcut_to_real_device()` helper function, which means that `run-multitests.py` can use this specification. Signed-off-by: Damien George <damien@micropython.org>
2025-10-20tests/extmod/time_res.py: Properly skip functions not in time module.Damien George
If `time.time` doesn't exist, it tries to use `globals()['time']` which is the time module itself, and that causes the test to fail. Instead it should just skip `time.time`. Signed-off-by: Damien George <damien@micropython.org>
2025-10-20tests/net_hosted/ssl_verify_callback.py: Skip if no verify_callback.Damien George
axTLS does not implement the `verify_callback` attribute. Signed-off-by: Damien George <damien@micropython.org>
2025-10-20tests/net_inet/tls_text_errors.py: Add exp file to run on axTLS.Damien George
axTLS will print a warning, and the added .exp file will skip that line. Signed-off-by: Damien George <damien@micropython.org>
2025-10-20tests/net_inet/tls_num_errors.py: Switch to tls mod and require mbedTLS.Damien George
This test is very specific to mbedTLS and how it raises errors when the heap is locked. Signed-off-by: Damien George <damien@micropython.org>
2025-10-20tests/net_inet: Skip tests on axTLS when necessary.Damien George
These tests cannot run with axTLS, eg on esp8266. Signed-off-by: Damien George <damien@micropython.org>
2025-10-20tests/net_inet/resolve_on_connect.py: Convert to use unittest.Damien George
This makes it clear what this test is expected to return/do. Signed-off-by: Damien George <damien@micropython.org>
2025-10-20tests: Move ports/esp32/resolve_on_connect.py to net_inet.Damien George
The main reason for moving this test is that it needs internet connection to pass. So putting it in `net_inet` makes sure it's alongside other tests that need the internet. Also, it's a general test that could eventually run on other ports, if/when they support doing an address resolution as part of `socket.connect()`. Signed-off-by: Damien George <damien@micropython.org>
2025-10-20tests/run-tests.py: Raise OSError on invalid file open for injected FS.Damien George
This makes sure that `open()` raises `OSError(ENOENT)` if the test script attempts to open a file that does not exist. For example, the test `tests/ports/esp32/check_err_str.py` attempts to do this and this test currently fails when run with `--via-mpy` because the injected filesystem lets a file by any name be opened. The fix here tries to be as minimal as possible, so includes a size optimisation for `stat()` to use a fixed 10-tuple. It also fixes the `OSError` argument, which should be positive. Signed-off-by: Damien George <damien@micropython.org>
2025-10-20github/workflows: Free up more disk space on zephyr workflow.Damien George
Zephyr CI is currently failing, because the runner is out of space. Free up some more space using the existing plugin. Fixes issue #18290. Signed-off-by: Damien George <damien@micropython.org>
2025-10-17esp32/boards: Apply additional IRAM savings.Angus Gratton
Saves approx 19KB on ESP32-C6 and 11KB on ESP32-C2, meaning IDF V5.5.1 builds now have more free RAM than V5.4.2. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-10-17esp32: Update to use ESP-IDF v5.5.1.Damien George
Tested with ESP32_GENERIC, ESP32_GENERIC_C3, ESP32_GENERIC_C6 and ESP32_GENERIC_S3 firmware, using the full test suite. There do not seem to be any regressions. Signed-off-by: Damien George <damien@micropython.org>
2025-10-15esp32/boards: Add new board variant for esp32c2 devices with 2MiB flash.Florent
Factors out the space-saving config options from `sdkconfig.d2wd` to a new `sdkconfig.flash_2MiB` file, and uses that in the new C2 FLASH_2M variant. Signed-off-by: Florent <florent@frizoncorrea.fr>
2025-10-15esp32: Update tools/metrics_esp32.py to use JSON output.Angus Gratton
Much cleaner. Also add deltas to the output table for easier interpretation. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-10-13zephyr/boards: Add PocketBeagle 2 rev A1 m4 support.Ayush Singh
Same configuration as rev A0. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-10-13zephyr/boards: Add PocketBeagle 2 rev A0 m4 support.Ayush Singh
Add support for PocketBeagle 2 rev A0 m4. Since it has 256K of SRAM (split into 192K instruction and 64K data regions), some things need to be disabled in MicroPython to make it fit. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-10-13zephyr/modzsensor: Add set/get sensor attributes to zsensor.Ned Konz
This commit adds `Sensor.attr_set()` and `Sensor.attr_get_*()` methods that are necessary to set various sensor attributes if they haven't been set statically in the device tree. This is needed, for example, because the LSM6DS3TR-C sensor on the XIAO BLE NRF52840 SENSE board will not work with `zsensor` because it doesn't have any default configuration for sampling frequency. Various `SENSOR_ATTR_*` constants from `zephyr/incude/zephyr/drivers/sensor.h` have been added as `ATTR_*` constants in the `zsensor` module. Signed-off-by: Ned Konz <ned@metamagix.tech>
2025-10-13zephyr/machine_adc: Add ADC support.Ned Konz
This commit adds support for ADC peripherals in the Zephyr port. As is typical for Zephyr, the ADC channel setup is done in the devicetree (typically using an overlay). This code requires ADC channels to be listed in the io-channels property of the zephyr,user root node. Signed-off-by: Ned Konz <ned@metamagix.tech>
2025-10-11zephyr: Add boards files for rp2350's m33 on pico 2.Vdragon
Adds overlay and conf for RPi Pico2 ARM cpu on the zephyr port. Signed-off-by: Vdragon <mail@massdriver.space>
2025-10-11zephyr: Remove defaulting to newlib.Vdragon
Remove CONFIG_NEWLIB_LIBC=y, as it seems it is now unecessary. Signed-off-by: Vdragon <mail@massdriver.space>
2025-10-10docs/develop/porting: Use mp_cstack_init_with_sp_here in docs.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-10-10mpy-cross/main: Replace mp_stack calls with mp_cstack_init_with_sp_here.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-10-10samd/main: Replace mp_stack_set calls with mp_cstack_init_with_top.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-10-10renesas-ra/main: Replace mp_stack_set with mp_cstack_init_with_top.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-10-10qemu/main: Replace mp_stack calls with mp_cstack_init_with_sp_here.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-10-10esp8266/boards: Replace stackctrl.o with cstack.o in obj file list.Damien George
This was missed in d441788975a6dfb277ad9a3d54d651ae48817d16. Signed-off-by: Damien George <damien@micropython.org>
2025-10-10powerpc/main: Replace mp_stack calls wih mp_cstack_init_with_sp_here.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-10-10nrf/main: Replace mp_stack_set calls with mp_cstack_init_with_top.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-10-10mimxrt/main: Replace mp_stack_set calls with mp_cstack_init_with_top.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-10-10cc3200/mptask: Replace mp_stack_set_top with mp_cstack_init_with_top.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-10-10alif/main: Replace mp_stack_set with mp_cstack_init_with_top.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-10-10zephyr/main: Replace mp_stack_set with mp_cstack_init_with_sp_here.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-10-10stm32/main: Remove unused include of stackctrl.h.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2025-10-10stm32/boards/OPENMV_N6: Switch to object REPR_C.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-10-08tools/ci: Fix typo of pipefail.Angus Gratton
Regression from 449866cb0af3fc547df6538a6552517cc8974616. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-10-08tools/ci.sh: Re-add IGNORE_ERRORS to ci_code_size_build.Jeff Epler
It was removed (possibly inadvertently) in 4c55b0879b38b373b44e84552d6754b7842b5b72 Signed-off-by: Jeff Epler <jepler@unpythonic.net>
2025-10-08tools/ci.sh: Return to old branch after code_size_build.Jeff Epler
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
2025-10-08tools/metrics.py: Allow pre_cmd to set up environment.Jeff Epler
This is a necessary step to allow cleanly building the xtensa port during CI, as it's undesirable to apply the esp-idf environment settings while building other ports. PRE_CMD_<letter> can be used to override the command, or add a command if not otherwise specified. Note that <letter> is case sensitive. Signed-off-by: Jeff Epler <jepler@unpythonic.net>
2025-10-08tools/ci.sh: Let code_size_build be customized via environment.Jeff Epler
For instance, to compare HEAD to origin/master on only the minimal x86 build, use PORTS_TO_CHECK=m REFERENCE=origin/master tools/ci.sh code_size_build Signed-off-by: Jeff Epler <jepler@unpythonic.net>
2025-10-08tools/metrics.py: When cleaning also clean mpy-cross.Jeff Epler
Changes of interest could be in emitted mpy frozen files. Signed-off-by: Jeff Epler <jepler@unpythonic.net>
2025-10-08tools/ci.sh: Exit with error if zcat fails during ci_esp8266_setup.Jeff Epler
Signed-off-by: Jeff Epler <jepler@unpythonic.net>