summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-05-09py/emitinlinethumb: Refactor string literal as array initializer.Angus Gratton
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-05-09extmod/moductypes: Refactor string literal as array initializer.Angus Gratton
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 <angus@redyak.com.au>
2025-05-09rp2: Add temporary workaround for GCC 15.1 build failure.Angus Gratton
This is a workaround for this upstream issue: https://github.com/raspberrypi/pico-sdk/issues/2448 Can be removed after the next pico-sdk update. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-05-09py/mpconfig: Enable io.IOBase at core feature level.Damien George
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 <damien@micropython.org>
2025-05-09rp2/rp2_dma: Fix default value used in pack_ctrl on RP2350.Damien George
The bit position of CHAIN_TO is not the same as on RP2040. Signed-off-by: Damien George <damien@micropython.org>
2025-05-09rp2/Makefile: Add deploy target that uses picotool load.Damien George
This is a convenient way to deploy firmware to an RP2xxx-based board. Signed-off-by: Damien George <damien@micropython.org>
2025-05-08rp2,extmod/cyw43: Move the LWIP responder fix into common CYW43 config.Angus Gratton
This means the fix from dd1465e7 will also apply to stm32 and mimxrt ports that use CYW43. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-05-08extmod,alif,mimxrt,rp2,stm32: Create common cyw43 driver config header.Angus Gratton
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 <angus@redyak.com.au>
2025-05-07zephyr/mpconfigport: Fix mp_int_t and mp_uint_t to work on 64-bit archs.Anton Blanchard
These both need to fit a pointer, so make them `intptr_t` and `uintptr_t`, similar to other ports. Signed-off-by: Anton Blanchard <antonb@tenstorrent.com>
2025-05-07zephyr/modbluetooth_zephyr: Allow BLE to create services at runtime.danicampora
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 <danicampora@gmail.com>
2025-05-07py/makeversionhdr.py: Change utcfromtimestamp() to fromtimestamp().Jos Verlinde
The former is deprecated. Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
2025-05-07py/modthread: Initialize thread state nlr_top to NULL.Daniël van de Giessen
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 <daniel@dvdgiessen.nl>
2025-05-07lib/littlefs: Reuse existing CRC32 function to save space.Daniël van de Giessen
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 <daniel@dvdgiessen.nl>
2025-05-07lib/littlefs: Update LittleFS to v2.10.2.Daniël van de Giessen
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 <daniel@dvdgiessen.nl>
2025-05-07samd/samd_qspiflash: Remove the attempt to handle a unknown device.robert-hh
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 <robert@hammelrath.com>
2025-05-07samd/samd_spiflash: Improve the flash type detection.robert-hh
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 <robert@hammelrath.com>
2025-05-07samd/boards/SAMD_GENERIC_D51xxx: Fix VFS settings for internal flash.robert-hh
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 <robert@hammelrath.com>
2025-05-07samd/modtime: Change time.time_ns() to follow the RTC time.robert-hh
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 <robert@hammelrath.com>
2025-05-07samd/machine_i2c: Add the timeout keyword argument to the constructor.robert-hh
To make it compliant with the documentation. The default value is 50000us. Signed-off-by: robert-hh <robert@hammelrath.com>
2025-05-07samd/boards/SAMD_GENERIC_Dxxx: Add Microchip URL to board.json.robert-hh
To the Microchip Web site. Thanks to Matt Trentini for suggesting this site. Signed-off-by: robert-hh <robert@hammelrath.com>
2025-05-07docs,ports: Fix SparkFun capitalization.Malcolm McKellips
This is a follow-up to 1e92bdd206f6f87ba65ea05c5b2623fca0b926cd correcting more of the instances where "Sparkfun" should be "SparkFun". Signed-off-by: Damien George <damien@micropython.org>
2025-05-07extmod/asyncio: Fix early exit of asyncio scheduler.Yoctopuce dev
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 <dev@yoctopuce.com>
2025-05-02tests/extmod: Rename ssl tests that only use the tls module.Angus Gratton
Signed-off-by: Angus Gratton <angus@redyak.com.au>
2025-05-02py/malloc: Add mutex for tracked allocations.Angus Gratton
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 <angus@redyak.com.au>
2025-05-02zephyr/boards: Enable ADC on beagleconnect_freedom.Ayush Singh
Enable Analog inputs. Requires Zephyr >= v3.8.0. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-05-02docs/zephyr: Add zephyr FlashArea IDs docs.Vdragon
Signed-off-by: Vdragon <mail@massdriver.space>
2025-05-02zephyr: Introduce auto-listing of FlashArea Partitions.Vdragon
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 <mail@massdriver.space>
2025-05-02zephyr: Create ability to use device_next with CDC ACM as REPL.Vdragon
This enables using the newer USB stack and its CDC ACM for the REPL. To switch to it, board file must contain `CONFIG_USB_DEVICE_STACK_NEXT=y` and `CONFIG_USBD_CDC_ACM_CLASS=y`. In the case of a board that is a platform that supports the older device stack, `CONFIG_USB_DEVICE_STACK=n` may be necessary. Signed-off-by: Vdragon <mail@massdriver.space>
2025-05-02tools/mpremote: For mip install, use hash to skip files that exist.Damien George
When using `mip install`, if a file that needs to be downloaded already exists locally, then the hash of that local file will be computed and if it matches the known hash of the remote file it will not be downloaded. Hashes in mip are guaranteed unique, so this change should never leave stale files on the filesystem. This behaviour follows that of the `mip` package in `micropython-lib`. Signed-off-by: Damien George <damien@micropython.org>
2025-05-02tools/ci.sh: Update URL for xtensa-lx106-elf-standalone.tar.gz.Damien George
The https://github.com/jepler/esp-open-sdk repository has been removed, so use the file hosted at micropython.org (it's the same file). Signed-off-by: Damien George <damien@micropython.org>
2025-05-01tests/ports/rp2: Tune rp2.DMA test so it runs in all configurations.Damien George
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 <damien@micropython.org>
2025-05-01tests/ports/rp2: Convert rp2.DMA test to a unittest.Damien George
This test is rather complicated and benefits from being a unittest. Signed-off-by: Damien George <damien@micropython.org>
2025-05-01tests/net_hosted: Only run network loopback test on supported targets.Damien George
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 <damien@micropython.org>
2025-04-30zephyr/boards: Add nrf9151dk board configuration.Patrick Joy
Add support for the nrf9151dk. This DK has a GD25WB256 32mb external QSPI flash chip. Signed-off-by: Patrick Joy <patrick@thinktransit.com.au>
2025-04-30zephyr/boards: Add nrf5340dk board configuration.Patrick Joy
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 <patrick@thinktransit.com.au>
2025-04-30zephyr: Create options to enable frozen modules.Vdragon
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 <mail@massdriver.space>
2025-04-30zephyr/boards: Enable PWM on beagleconnect_freedom.Ayush Singh
Enable PWM config for bcf. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-04-30docs/zephyr: Add quick reference for PWM support.Ayush Singh
Add docs for PWM support. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-04-30zephyr/machine_pwm: Implement PWM support.Ayush Singh
Implement PWM support using standard zephyr APIs, exposed as the standard MicroPython `machine.PWM` class. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-04-29zephyr: Upgrade to Zephyr v4.0.0.Maureen Helm
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 <maureen.helm@analog.com> Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
2025-04-29zephyr: Remove reference to CONFIG_MMC_VOLUME_NAME for v4.0.Detlev Zundel
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 <dzu@member.fsf.org>
2025-04-29zephyr: Fix call to thread_analyzer_print for v4.0.Detlev Zundel
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 <dzu@member.fsf.org> Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2025-04-29zephyr: Fix prj.conf for v4.1-rc1.Detlev Zundel
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 <dzu@member.fsf.org>
2025-04-26tools/mpremote: Prevent deletion of /remote files via rm -r.Jos Verlinde
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 <jos_verlinde@hotmail.com>
2025-04-26tools/mpremote/tests: Add test for rm -r on /remote vfs.Jos Verlinde
Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
2025-04-26tools/mpremote: Fix possibly-missing EOPNOTSUPP errno name.Anson Mansfield
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
2025-04-26tools/mpremote: Refactor error handling to apply generally to any errno.Anson Mansfield
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 <amansfield@mantaro.com>
2025-04-26tools/mpremote/tests: Add tests for errno behavior.Anson Mansfield
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
2025-04-24unix/coveragecpp: Verify struct-initializing macros' C++-compatibility.stijn
Add code using all relevant macros to make sure they initialize structs correctly. Signed-off-by: stijn <stijn@ignitron.net>
2025-04-24py: Make struct-initializing macros compatible with C++.stijn
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 <stijn@ignitron.net>