summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-10-19esp32/boards: Update UM board image names for consistency.Seon Rozenblum
Signed-off-by: Seon Rozenblum <seon@unexpectedmaker.com>
2023-10-18py/modthread: Initialise nlr_jump_callback_top on threads.Jim Mussared
The main thread gets this because the thread state is in bss, but subsequent threads need this field to be initialised. Also added a note to mpstate.h to help avoid missing this in the future. Fixes issue #12695. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-10-17mimxrt/modmachine: Add support for machine.deepsleep.Kwabena W. Agyeman
Signed-off-by: "Kwabena W. Agyeman" <kwagyeman@live.com>
2023-10-17mimxrt/machine_rtc: Add RTC alarm/wakeup functionality.Kwabena W. Agyeman
Following the documented Python machine.RTC API. Signed-off-by: "Kwabena W. Agyeman" <kwagyeman@live.com>
2023-10-17mimxrt/boards: Define missing SNVS pins for all processors.Kwabena W. Agyeman
Signed-off-by: "Kwabena W. Agyeman" <kwagyeman@live.com>
2023-10-17github/workflows: Pin ruff to 0.1.0 and change flags for new version.Jim Mussared
The `--format` flag was changed to `--output-format` in the recent update. Pin to this version to prevent further updates from breaking (e.g. through new rules or other changes). This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-10-17stm32/powerctrl: Add support for frequency scaling with HSI on H5 MCUs.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-10-17stm32/boards/STM32H573I_DK: Enable ETH and DAC peripherals.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-10-17stm32/eth: Add Ethernet support for H5 MCUs.Rene Straub
This commit implements Ethernet support for STM32H5. Changes are: - Add Cortex-M33 MPU code. Ethernet driver requires MPU to define cache strategy for DMA buffers (descriptors and frames). - Add support for STM32H5 Ethernet controller. The controller is mostly compatible with the STM32H7. However the descriptor layout is different. - Adapt clocking and reset for STM32H5. Tested on NUCLEO-H563ZI and STM32H573I-DK, using ping and iperf3. TCP rates of 80-90 Mbits/sec were achievable. Signed-off-by: Rene Straub <rene@see5.ch> Signed-off-by: Damien George <damien@micropython.org>
2023-10-17stm32/boards/ARDUINO_GIGA: Fix name of pins in board init.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-10-16rp2/cyw43_configport: Use m_tracked_calloc and m_tracked_free.robert-hh
When using malloc and free there were out-of-memory situations depending on the arm-none-eabi package version. This commit changes malloc/free to use the MicroPython GC heap instead. Signed-off-by: robert-hh <robert@hammelrath.com> Signed-off-by: Damien George <damien@micropython.org>
2023-10-16stm32/boards/ARDUINO_GIGA: Add QSPI fix/workaround to early init.iabdalkader
This workaround fixes an issue with some production boards that have an older QSPI flash part revision, which can't handle floating pins. Note those pins can be reconfigured and reused later. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-10-16docs/library/io: Remove io.FileIO and io.TextIOWrapper.Thomas Ackermann
FileIO and TextIOWrapper were removed in e65d1e69e88268145ff0e7e73240f028885915be. Remove them also from the documentation. Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
2023-10-16extmod/modframebuf: Remove FrameBuffer1 from natmod build.Jim Mussared
This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-10-16extmod/modframebuf: Fix FrameBuffer get-buffer implementation.Jim Mussared
This wasn't correctly accounting for the bits-per-pixel and was returning a bufinfo struct with the incorrect length. Instead, just forward directly to the underlying buffer object. Fixes issue #12563. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-10-16extmod/modframebuf: Validate FrameBuffer bounds against input buffer.Jim Mussared
This ensures that the buffer is large enough for the specified width, height, bits-per-pixel, and stride. Also makes the legacy FrameBuffer1 constructor re-use the FrameBuffer make_new to save some code size. Fixes issue #12562. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-10-16docs/reference/mpyfiles: Document change in .mpy sub-version.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-10-16py/persistentcode: Bump .mpy sub-version.Damien George
This is required because the previous commit changed the .mpy native ABI. Signed-off-by: Damien George <damien@micropython.org>
2023-10-16py/dynruntime: Add mp_get_buffer.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-10-16py/obj: Generalise mp_get_buffer so it can raise if a flag is set.Damien George
This allows mp_get_buffer_raise() to be changed to a simple inline function that in the majority of cases costs the same (in code size) to call as the original mp_get_buffer_raise(), because the flags argument is a constant. Signed-off-by: Damien George <damien@micropython.org>
2023-10-13py/objboundmeth: Optimise check for types in binary_op.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-10-13tests/basics/boundmeth1.py: Add tests for bound method equality/hash.Ned Konz
This commit adds tests for bound method comparison and hashing to support the changes in the previous commit. Signed-off-by: Ned Konz <ned@productcreationstudio.com>
2023-10-13py/objboundmeth: Support comparing and hashing bound methods.Daniël van de Giessen
This behaviour matches CPython. It's useful to be able to store bound method objects in dicts/sets, and compare for equality, eg when storing them in a list and using list.remove(). Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2023-10-13extmod/asyncio: Emit errors to stderr, not stdout.Matthias Urlichs
Sometimes these are different file descriptors, not to mention the Unix port, so use stderr to distinguish these error messages. CPython prints to stdout, but it does it via a call to the logging module. We don't want to introduce a dependency on logging, so printing to stderr is a good alternative. One can override default_exception_handler() if needed.
2023-10-12extmod/moductypes: Validate that uctypes.struct addr argument is an int.Damien George
Fixes issue #12660. Signed-off-by: Damien George <damien@micropython.org>
2023-10-12py/builtinevex: Handle invalid filenames for execfile.Jim Mussared
If a non-string buffer was passed to execfile, then it would be passed as a non-null-terminated char* to mp_lexer_new_from_file. This changes mp_lexer_new_from_file to take a qstr instead (as in almost all cases a qstr will be created from this input anyway to set the `__file__` attribute on the module). This now makes execfile require a string (not generic buffer) argument, which is probably a good fix to make anyway. Fixes issue #12522. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-10-12ports: Make all ports skip execution of main.py if boot.py fails.robert-hh
That can be caused e.g. by an exception. This feature is implemented in some way already for the stm32, renesas-ra, mimxrt and samd ports. This commit adds it for the rp2, esp8266, esp32 and nrf ports. No change for the cc3200 and teensy ports. Signed-off-by: robert-hh <robert@hammelrath.com>
2023-10-11tools/ci.sh: Ensure enough commits are fetched for a common ancestor.Andrew Leech
This commit updates the ci script to automatically fetch all upstream if the common commit hasn't been found; this should preserve the speed of CI checks for most PR's, and use a reliable but slow fetch if needed for older ones. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2023-10-10esp32,esp8266: Rename MICROPY_ESPNOW to MICROPY_PY_ESPNOW.Glenn Moloney
For consistency with other Python-level modules. Also add the corresponding missing preprocessor guard to esp32/modespnow.c, so that this port compiles if MICROPY_PY_ESPNOW and MICROPY_PY_NETWORK_WLAN are set to 0. Fixes #12622. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
2023-10-09mimxrt/led: Fix LED init call from main, and simplify led_init.robert-hh
led_init() was not called, and therefore the machine.LED class seemed not to work. led_init() now uses mp_hal_pin_output() to configure the pin. Signed-off-by: robert-hh <robert@hammelrath.com>
2023-10-09py/vm: Don't emit warning when using "raise ... from None".Matthias Urlichs
"Raise SomeException() from None" is a common Python idiom to suppress chained exceptions and thus shouldn't trigger a warning on a version of Python that doesn't support them in the first place.
2023-10-06README.md: Update CI badges.Jim Mussared
- Fix URL for the unix badge. - Add stm32 CI badge. - Add docs CI badge (linking to the documentation) - Make docs CI run on push (so we get a badge generated). This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-10-06all: Switch to new preview build versioning scheme.v1.22.0-previewJim Mussared
See https://github.com/micropython/micropython/issues/12127 for details. Previously at the point when a release is made, we update mpconfig.h and set a git tag. i.e. the version increments at the release. Now the version increments immediately after the release. The workflow is: 1. Final commit in the cycle updates mpconfig.h to set (X, Y, 0, 0) (i.e. clear the pre-release state). 2. This commit is tagged "vX.Y.0". 3. First commit for the new cycle updates mpconfig.h to set (X, Y+1, 0, 1) (i.e. increment the minor version, set the pre-release state). 4. This commit is tagged "vX.Y+1.0-preview". The idea is that a nightly build is actually a "preview" of the _next_ release. i.e. any documentation describing the current release may not actually match the nightly build. So we use "preview" as our semver pre-release identifier. Changes in this commit: - Add MICROPY_VERSION_PRERELEASE to mpconfig.h to allow indicating that this is not a release version. - Remove unused MICROPY_VERSION integer. - Append "-preview" to MICROPY_VERSION_STRING when the pre-release state is set. - Update py/makeversionhdr.py to no longer generate MICROPY_GIT_HASH. - Remove the one place MICROPY_GIT_HASH was used (it can use MICROPY_GIT_TAG instead). - Update py/makeversionhdr.py to also understand MICROPY_VERSION_PRERELEASE in mpconfig.h. - Update py/makeversionhdr.py to convert the git-describe output into semver-compatible "X.Y.Z-preview.N.gHASH". - Update autobuild.sh to generate filenames using the new scheme. - Update remove_old_firmware.py to match new scheme. - Update mpremote's pyproject.toml to handle the "-preview" suffix in the tag. setuptools_scm maps to this "rc0" to match PEP440. - Fix docs heading where it incorrectly said "vvX.Y.Z" for release docs. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-10-06all: Bump version to 1.21.0.v1.21.0Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-10-05rp2: Implement time.time_ns with time_us_64 so it has us resolution.Damien George
Currently on rp2 the time.time_ns() function has only seconds resolution. This commit makes it have microsecond resolution, by using the output of time_us_64() instead of the RTC. Tested that it does not drift from the RTC over long periods of time. Signed-off-by: Damien George <damien.p.george@gmail.com>
2023-10-05esp8266/boards/ESP8266_GENERIC: Remove urllib from the 2MiB manifest.Damien George
No other network-enabled board has urllib.urequest frozen in to the firmware, and esp8266 is relatively low on flash, so remove this module. And (u)requests is already included by bundle-networking. Signed-off-by: Damien George <damien@micropython.org>
2023-10-05esp32/boards/manifest.py: Freeze aioespnow into firmware by default.Glenn Moloney
Also remove corresponding commented line from esp8266/boards/manifest.py. It doesn't have enough flash to have this frozen by default. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
2023-10-05rp2/CMakeLists: Enable debug symbols in all builds.Angus Gratton
Allows using gdb, addr2line, etc. on a "release" ELF file. No impact to .bin or .uf2 size, only the .elf will get bigger. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-10-05docs,tools: Change remaining "urequests" references to "requests".Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-10-05lib/micropython-lib: Update submodule to latest.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-10-05lib/cyw43-driver: Update driver to latest version v1.0.2.Damien George
Includes more error checking, and a fix to handle buffer overflow when getting STA MACs. Signed-off-by: Damien George <damien@micropython.org>
2023-10-05stm32/i2c: Add support for I2C4 on H7 MCUs.iabdalkader
The current code assumes all I2Cs are on the same peripheral bus, which is not true for I2C4 and the same goes for the clock enable code. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-10-05extmod/vfs_posix_file: Fix flush handling in msvc builds.stijn
Flushing console output in msvc builds always fails because that output is not buffered so don't propagate that as an error (in a simlar way as was done in 1c047742 for macOS). Signed-off-by: stijn <stijn@ignitron.net>
2023-10-04tools/metrics.py: Fix esp32 and esp8266 board names after renaming.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-10-04esp32/boards/ARDUINO_NANO_ESP32: Use Arduino USB IDs.Luca Burelli
The IDF-provided version of TinyUSB defaults to Espressif's standard VID:PID unless specific sdkconfig options are present. The numbers already defined for the CUSTOM_* config options were ignored otherwise. Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2023-10-04extmod/modnetwork: Forward if.config(hostname) to network.hostname.Jim Mussared
This removes the duplicate code in cyw43, esp32, esp8266 that implements the same logic as network.hostname. Renames the `mod_network_hostname` (where we store the hostname value in `.data`) to `mod_network_hostname_data` to make way for calling the shared function `mod_network_hostname`. And uses memcpy for mod_network_hostname_data, because the length of source is already known and removes reliance on string data being null-terminated. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-10-04extmod/modnetwork: Increase max hostname length to 32.Jim Mussared
This changes from the previous limit of 15 characters. Although DHCP and mDNS allow for up to 63, ESP32 and ESP8266 only allow 32, so this seems like a reasonable limit to enforce across all ports (and avoids wasting the additional memory). Also clarifies that `MICROPY_PY_NETWORK_HOSTNAME_MAX_LEN` does not include the null terminator (which was unclear before). This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-10-03top: Update .git-blame-ignore-revs for latest spelling fix commit.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-10-03all: Fix various spelling mistakes found by codespell 2.2.6.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-10-03renesas-ra: Tune lwip buffers and timing to improve network performance.iabdalkader
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>