summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-10-02docs/zephyr: Update docs to reflect device name changes.Maureen Helm
Zephyr v3.2.0 deprecated the devicetree label property as a base property, which had been used as the device name string for device_get_binding(). The device name string is now the devicetree node name appended with its unit-address. Update Zephyr port documentation to reflect this change. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2024-10-02zephyr: Replace zephyr.h with kernel.h.Maureen Helm
Zephyr v3.2.0 deprecated include/zephyr/zephyr.h in favor of include/zephyr/kernel.h since it only included that header. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2024-10-02zephyr: Update include paths to use the zephyr namespace.Maureen Helm
Zephyr v3.1.0 moved all public headers to include/zephyr. Updates a few Zephyr include paths that were missed in 4fd54a475661953946e9e3c3f962b20619c82240. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2024-09-27py/parse: Remove old esp32 compiler workaround.Alessandro Gatti
The ESP32 port contains a workaround to avoid having a certain function in `py/parse.c` being generated incorrectly. The compiler in question is not part of any currently supported version of ESP-IDF anymore, and the problem inside the compiler (well, assembler in this case) has been corrected a few years ago. This commit removes all traces of that workaround from the source tree. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-09-26rp2/machine_uart: Fix dropped UART REPL bytes on soft reset.Angus Gratton
Necessary to fix "mpremote run" over hardware UART. Bisect shows bug was introduced by d420b4e4, but looks like made more complex by 01c046d2. Specifically: resetting and re-initialising the REPL UART during soft reset clears the FIFO before it's done printing the "MPY: soft reboot" line. Fixed by adding a UART TX flush in the deinit path. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-26py/mpz: Skip separators when running out of digits to print.Alessandro Gatti
This commit fixes the addition of a stray separator before the number when printing an MPZ-backed integer and the first group is three digits long. This fixes #8984. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-09-26shared/tinyusb: Use new persistent-tx-fifo configure interface.Damien George
The old configuration option has been removed from TinyUSB. Signed-off-by: Damien George <damien@micropython.org>
2024-09-26lib/tinyusb: Update to version 0.17.0.Damien George
Includes support for RP2350, and improvements for ESP32. Signed-off-by: Damien George <damien@micropython.org>
2024-09-26ports: Fix lwIP config setting to disable DHCP ARP check.Damien George
lwIP was recently updated in a89ac9e24a566e45bd3ffa7ef9e61e1d994616ea to STABLE-2_2_0_RELEASE, and this introduced a change in the configuration variable `DHCP_DOES_ARP_CHECK`, renaming it to `LWIP_DHCP_DOES_ACD_CHECK`. This commit fixes the ports lwIP settings to use the new configuration option. Without this option, connecting to a WiFi access-point takes about 12.5 seconds. With this option (ie disabling DHCP ARP checks) connecting takes about 4 seconds. Tested on an RPI_PICO_W and PYBD_SF2. Signed-off-by: Damien George <damien@micropython.org>
2024-09-26unix/alloc: Don't trace executable memory for GC pointers.Damien George
This tracing was originally needed for three reasons: 1. To trace object/raw-code pointers embedded in native code, eg from @micropython.native functions. 2. To trace pointers to BSS/rodata from relocated viper code. 3. For libffi tracing. The tracing in point 1 was made unnecessary long ago in commit 7d4b6cc868ebf0e1cc5dfe5276b22e1b857c411b (see also commit bbccb0f630dc9b2769a891c2c28fbbe810284225 which removed scanning of native code on the esp8266 port). Since the previous commit, point 2 is no longer needed. For point 3, this was made unnecessary in the recent commit 97966254577167f4c50200af1af89109a275da1c. Signed-off-by: Damien George <damien@micropython.org>
2024-09-26py/persistentcode: Explicitly track native BSS/rodata when needed.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2024-09-26extmod/vfs_blockdev: Implement common helper for read and write.Angus Gratton
- Code size saving as all of these functions are very similar. - Resolves the "TODO" of the plain read and write functions not propagating errors. An error in the underlying block device now causes VFatFs to return EIO, for example. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-26extmod/vfs_blockdev: Check block device function positive results.Angus Gratton
A positive result here can result in eventual memory corruption as littlefs expects the result of a cache read/write function to be 0 or a negative integer for an error. Closes #13046 This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-26renesas-ra/usb: Use interrupt rather than polling for USB task.Andrew Leech
Most ports using TinyUSB now schedule the USB tasks from the USB interrupt. This commit updates the renesas-ra port to use this new pattern. Signed-off-by: Andrew Leech <andrew@alelec.net>
2024-09-26renesas-ra/extint: Fix issue with Pin.irq not triggering.Takeo Takahashi
Fixes issue #15272. Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
2024-09-26renesas-ra/boards: Add configuration.xml for auto-generated files.Takeo Takahashi
* configuration.xml: Generated by RA Smart Configurator for FSP 4.4. Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
2024-09-26renesas-ra/README: Add basic details about board autogen files.Andrew Leech
The renesas-ra port board definitions contain auto-generated files which are not easy to understand for someone unfamiliar with the port. This commit adds some notes to the README to assist other developers who want to work on these. The configuration.xml file for the `ARDUINO_PORTENTA_C33` was provided by @iabdalkader. Signed-off-by: Andrew Leech <andrew@alelec.net>
2024-09-24stm32/boards/ARDUINO_GIGA: Update board config files.iabdalkader
To remove duplicate HAL macros. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-09-24stm32/boards/ARDUINO_NICLA_VISION: Update board config files.iabdalkader
Changes are: - Add pre/post stop mode entry macros. - Make SE05X pin accessible. - Remove duplicate HAL macros. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-09-24stm32/boards/ARDUINO_PORTENTA_H7: Update board config files.iabdalkader
Changes are: - Add pre/post stop mode entry macros. - Make SE05X pin accessible. - Remove duplicate HAL macros. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-09-24stm32/boards/ARDUINO_OPTA: Add support for the Arduino Opta board.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-09-24stm32/powerctrl: Add pre/post stop mode entry macros.iabdalkader
These allow a board to perform actions before/after stop mode. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-09-24stm32/uart: Add UART RX/CTS pin pull config options.iabdalkader
The UART driver enables a pull-up on RX/CTS pins by default. This can cause UART to fail to receive in certain situations, eg with RS485 transceivers. This commit adds compile-time configuration options to set the pull mode on the RX and CTS pins of each UART. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-09-23tools/ci.sh: Report code size for `VIRT_RV32` as well.Alessandro Gatti
This commit adds the `VIRT_RV32` board to the list of targets for calculating code size changes as part of the CI pipeline. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-09-23tools/metrics.py: Add VIRT_RV32 to the code size metrics.Alessandro Gatti
This commit adds the Qemu-based RISC-V 32 bits `VIRT_RV32` board to the list of ports/boards to be built for measuring code size changes. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-09-23github/workflows: Update Ubuntu images for code size CI tasks.Alessandro Gatti
This updates the Ubuntu OS image the code size CI tasks run on, from 20.04-LTS to 22.04-LTS. This is needed because 20.04 didn't have packages that are needed to build RISC-V 32 code. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-09-23gitignore: Add ffi_lib.so to the gitignore list.Alessandro Gatti
When testing the Unix port with FFI tests enabled, the FFI helper library that's built as part of the testing process is not removed after the tests session end. This commit adds the built library to the gitignore list, so it doesn't mark the sourcetree as dirty if a test run for the Unix port was started in the past. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-09-23unix/modffi: Restrict uint32_t values to 32 bits.Alessandro Gatti
This commit clears the upper 32 bits of returned `uint32_t` values, which are handled as `unsigned int`s by the MicroPython runtime and thus could be extended to 64 bits on some platforms. RV64 holds 32-bit values as signed integers when held in registers, but the code handling the FFI unsigned int case did not take this into account. That introduced test failures when a 32-bit value had its most significant bit set, as when performing the value extension from 32 to 64 bits, the upper half of the value would be filled with ones. On 32 bit platforms this change should be converted to a no-op, and on other 64 bit platforms that aren't RISC-V it shouldn't hurt as the value being manipulated is expected to only hold valid bits in its lower half. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-09-23tools/ci.sh: Let RV64 use a source-built version of libffi.Alessandro Gatti
This commit lets the RV64 port use the version of libffi that is bundled as a submodule in the MicroPython source tree, as the packaged libffi library coming from Ubuntu's RISC-V repository trashes foreign function call results on exit. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-09-23unix/modffi: Clean up FFI closures memory management.Alessandro Gatti
This commit removes custom FFI closures alloc/free functions, in favour of using the tracked allocation facility to allocate memory for FFI callback objects. This stems from linking issues in the Arm port when updating LibFFI to the latest stable version, as the overridden alloc/free functions didn't replace LibFFI's (unlike in other ports). The original code did no effective cleanup for allocated callback objects, so there is no real impact when switching allocation strategy. The tracked allocation feature used to be enabled only if the Bluetooth stack integration was enabled. This commit also enables tracked allocation support if FFI support is enabled. Co-authored-by: Damien George <damien@micropython.org> Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-09-23lib/libffi: Update libffi to 3.4.6.Alessandro Gatti
Libffi is updated to the latest stable version (v3.4.6) as the version of libffi that was linked by the repository predates the introduction of RISC-V processors (both 32 and 64 bits). This is necessary as the packaged version of libffi used by the CI for RISC-V 64 turned out to simply not work correctly, whilst a source-built version of libffi worked just fine. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-09-20esp32/boards/UM_RGBTOUCH_MINI: Fix compile error with missing modules.Seon Rozenblum
Signed-off-by: Seon Rozenblum <seon@unexpectedmaker.com>
2024-09-19py/objringio: Add micropython.RingIO() interface for general use.Andrew Leech
This commit adds a new `RingIO` type which exposes the internal ring-buffer code for general use in Python programs. It has the stream interface making it similar to `StringIO` and `BytesIO`, except `RingIO` has a fixed buffer size and is automatically safe when reads and writes are in different threads or an IRQ. This new type is enabled at the "extra features" ROM level. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2024-09-19esp32/boards/OLIMEX_ESP32_EVB: Add Olimex ESP32 EVB board definition.shiggy
This is for boards not covered by the Olimex ESP32 PoE implementation. The major setting is about the PHY interface configuration. Tested with esp-idf v5.0.4 and Olimex ESP32 EVB boards. Signed-off-by: shiggy <mail@shiggytech.de>
2024-09-19esp32/boards: Add UM_OMGS3 and UM_RGBTOUCH_MINI board definitions.Seon Rozenblum
This adds two new UM boards: OMGS3 and RGB Touch Mini. Also fixed the NanoS3 deploy info. Signed-off-by: Seon Rozenblum <seon@unexpectedmaker.com>
2024-09-19esp32/boards/UM_FEATHERS3NEO: Add FeatherS3 Neo board definition.Seon Rozenblum
Signed-off-by: Seon Rozenblum <seon@unexpectedmaker.com>
2024-09-19tests/ports/unix: Update and extend the modffi integer tests.Michael Sawyer
Added the "long" modffi tests. The tests could not be added to the existing ffi_types test because two .exp files were required for the 32-bit and 64-bit results. Code common to both the ffi_types and type "long" tests was factored into ffi_int_base. ffi_types was renamed to ffi_int_types to group the related tests under the "ffi_int" prefix. Signed-off-by: Michael Sawyer <mjfsawyer@gmail.com>
2024-09-19unix/modffi: Fix signed integer cast in return_ffi_value.Michael Sawyer
Casting an ffi_arg to a signed int may truncate the value. E.g., when the ffi_arg is 64-bit and the signed int is 32-bit. Also, casting an ffi_arg to a larger signed type will not sign extend the value. E.g., when the ffi_arg is 32-bit and the larger signed type is int64_t. If the value is signed, it should be cast to ffi_sarg, which is the same size as ffi_arg. Signed-off-by: Michael Sawyer <mjfsawyer@gmail.com>
2024-09-19tools/mpy_ld.py: Support jumping more than 2k on armv6m architectures.Damien George
Native .mpy files targetting armv6m (eg RP2040) cannot currently have more than about 2kiB of native code (between the start of the file and the init function). This commit fixes that by using bigger jumps to jump to the init function. Signed-off-by: Damien George <damien@micropython.org>
2024-09-19tools/ci.sh: Clean up the Unix port's Arm target.Alessandro Gatti
The Unix port's Arm target CI steps have been updated to be more in line with the other targets (the MicroPython binary doesn't need an environment variable to be set in order to run now). Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-09-19tools/ci.sh: Add missing FFI helper for CI RV64 Unix builds.Alessandro Gatti
The FFI helper definition was accidentally omitted when committing the necessary shell code for building RV64 Unix builds in the CI environment. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-09-19tools/ci.sh: Clean up the Unix port's MIPS target.Alessandro Gatti
The Unix port's MIPS target CI steps have been updated to be more in line with the other targets (the MicroPython binary now runs as a dynamic executable), and the test exceptions for ffi have been lifted. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-09-19tests/run-tests.py: Remove --write-exp and --list-tests options.Damien George
Removing the now-unused (see previous commit for details) `--write-exp` and `--list-tests` options helps to simplify the rather complex logic in `run-tests.py`. Signed-off-by: Damien George <damien@micropython.org>
2024-09-19all: Remove tinytest component.Damien George
With the recent qemu (d9a0fdda9a7b0db55c1115b55bb1b83cd5ce739c and 0426934969d06aa649ba903f5408cb331b5b9c2d) and zephyr (05cad7b56f5d460db26a468a05bfdeabe4a656db) changes to how their tests are run, two things became unused: - The tinytest framework, which embedded a set of tests and their expected output within firmware, so these tests could be run stand-alone. - The `--write-exp` and `--list-tests` options to `tests/run-tests.py`, which were needed primarily to generated the expected test output for tinytest (also the associated `tests/run-tests-exp.py/.sh` scripts are now unused). This commit removes the tinytest component and all its helper code. This eliminates a maintenance burden. Signed-off-by: Damien George <damien@micropython.org>
2024-09-19shared/tinyusb: Only run TinyUSB on the main thread if GIL is disabled.Angus Gratton
If GIL is disabled then there's threat of a race condition if some other code specifically requests USB processing (i.e. to unblock stdio), while a scheduled TinyUSB callback is already running on another thread. Relies on the change in the parent commit, where scheduler is restricted to main thread if GIL is disabled. Fixes #15390 - "TinyUSB callback can't recurse" exceptions on rp2 when using _thread module and USB serial I/O. Adds a unit test for stdin functioning correctly in threads (fails on rp2 port without this fix). This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-19py/scheduler: Only run callbacks on the main thread if GIL is disabled.Angus Gratton
Otherwise it's very difficult to reason about thread safety in a scheduler callback, as it can run at any time on any thread - including racing against any bytecode operation on any thread. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-19rp2/modules: Fix FatFS boot script to detect invalid FAT filesystem.iabdalkader
This change helps detect if the filesystem is invalid, by also including the first mount attempt within the try-except. Then the FAT is reformatted if needed. Fixes issue #15779. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-09-19rp2/machine_pin_cyw43: Include check for CYW43_GPIO.ZodiusInfuser
The `#if` check only checks that `MICROPY_PY_NETWORK_CYW43` and `MICROPY_HW_PIN_EXT_COUNT` are defined. This is a reasonable assumption for the Pico W, but causes conflicts if someone wants to attach an external IO expander to their Pico W and have its pins appear as Pin objects. This commit addresses this by adding the additional checks, letting board builds include wireless but separately choose whether the external IO pins come from the cyw43 or not. Signed-off-by: Christopher Parrott <chris@pimoroni.com>
2024-09-19rp2: Increase ext pins from 10 to 32.ZodiusInfuser
To allow more pins when other ways are used to provide external GPIO (ie not via cyw43). Signed-off-by: Christopher Parrott <chris@pimoroni.com>
2024-09-19rp2: Add board-level hooks to main, and MICROPY_SOURCE_BOARD cmake var.ZodiusInfuser
Signed-off-by: Christopher Parrott <chris@pimoroni.com>