Commit Graph

34556 Commits

Author SHA1 Message Date
Jim Mussared 977dc9a369 extmod/asyncio/stream.py: Fix cancellation handling of start_server.
The following code:

  server = await asyncio.start_server(...)
  async with server:
    ... code that raises ...

would lose the original exception because the server's task would not have
had a chance to be scheduled yet, and so awaiting the task in wait_closed
would raise the cancellation instead of the original exception.

Additionally, ensures that explicitly cancelling the parent task delivers
the cancellation correctly (previously was masked by the server loop), now
this only happens if the server was closed, not when the task was
cancelled.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-10-02 14:11:52 +11:00
Jos Verlinde a93ebd0e03 docs: Add requirements.txt file with dependencies for Sphinx.
Signed-off-by: Jos Verlinde <Jos.Verlinde@Microsoft.com>
2023-10-02 12:35:12 +11:00
iabdalkader da193c42f6 ports: Rename Arduino board LED pins to be consistent.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-10-02 11:57:46 +11:00
Wanlin Wang 2772b88f6a rp2/README: Fix name of RPI_PICO_W board.
Signed-off-by: Wanlin Wang <dgideas@outlook.com>
2023-10-02 11:46:38 +11:00
vsfos 1660c78795 unix/main: Fix memory leakage if MICROPY_USE_READLINE is disabled. 2023-10-02 11:44:12 +11:00
robert-hh 4e5611c55a mimxrt/machine_rtc: Improve the RTC init at boot.
By clearing the tamper bits and enabling access to the registers for all
code, just in case that this was set.  It keeps the clock running on
battery and the calibration setting.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-10-02 11:35:00 +11:00
robert-hh 6482eb142c mimxrt/mpbthciport: Allow disabling UART flow control for BLE.
Not all boards or BLE extensions have the flow control signals for BLE
available at suitable pins.  Actually none of the Adafruit extensions
match for flow control.

For consistency with the previous behaviour it is enabled by default.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-10-02 11:31:24 +11:00
robert-hh 51ca23e463 mimxrt/boards: Fix naming of SD-card config option.
Commit 552b0bbe12 did not define
MICROPY_PY_MACHINE_SDCARD properly, and thus building the firmware failed.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-10-02 11:29:53 +11:00
Vladimír Smitka debcbb24a5
Translated using Weblate (Czech)
Currently translated at 23.6% (236 of 997 strings)

Translation: CircuitPython/main
Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/cs/
2023-10-01 10:00:56 +02:00
Paint Your Dragon ed4d4a6b43
Merge pull request #8436 from PaintYourDragon/main
RP2040: fix 8-bit WAV playback
2023-09-29 20:39:33 -07:00
Dan Halbert 2fc5a934a1 add back generic subscript iterator, gc_never_free 2023-09-29 23:01:02 -04:00
Dan Halbert 5327487c1c
Merge pull request #8446 from tannewt/rgbmatrix_memory_fix
Improve RGBMatrix allocation tracking
2023-09-29 22:31:00 -04:00
Scott Shawcroft d179eb4f54
Merge pull request #8371 from bill88t/rpi-auto-disconnect
`stop_station` when no wifi-reconnect
2023-09-29 15:23:56 -07:00
Scott Shawcroft 985a49a124
Merge pull request #8422 from jepler/qualia-revision
qualia: fixes for revision C
2023-09-29 15:22:28 -07:00
Scott Shawcroft 73292f68f7
Merge pull request #8445 from MakerM0/8.2.x
update board magiclick_s3_n4r2
2023-09-29 15:19:37 -07:00
Scott Shawcroft 4c21f22114
Improve RGBMatrix allocation tracking
This prevents leaks but not all use-after-free issues.
2023-09-29 14:55:42 -07:00
Phillip Burgess 2fe0fa5b5c Add output_length_used check as requested 2023-09-29 14:25:54 -07:00
Dan Halbert 68a2927385 MP_REGISTER_ROOT_POINTER for port-specific root pointers 2023-09-29 15:46:42 -04:00
Dan Halbert 1c388ab315 finish converting to MP_REGISTER_ROOT_POINTER() 2023-09-29 10:49:34 -04:00
robert-hh abb44694d8 mimxrt/boards/MIMXRT1176_clock_config: Fix comments about UART clocks.
No functional change, and pretty obvious.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-09-29 23:43:31 +10:00
robert-hh 0701341e7f mimxrt/machine_uart: Set the UART clock to a fixed 40MHz value.
There is a single UART clock for all devices, so switching it for one will
affect all devices used at that time.  This commit fixes that issue by
keeping the clock at a fixed value.

This fixed clock still supports the common baud rates between 300 and
921600 baud.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-09-29 23:43:25 +10:00
iabdalkader 52e3da0a0b mimxrt/mbedtls: Enable certificate validity time validation.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-29 23:09:48 +10:00
iabdalkader 361ca7d5ee mimxrt/mpbthciport: Enable flow control for BT HCI UART.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-29 23:09:35 +10:00
iabdalkader 552b0bbe12 mimxrt: Remove SDCARD Makefile config option.
This is option is no longer needed as a Makefile option as the USDHC driver
is enabled for all supported series.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-29 23:09:14 +10:00
iabdalkader 9d1a1ed42d mimxrt/Makefile: Enable the FSL USDHC for supported MCU series.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-29 23:08:57 +10:00
iabdalkader 805c750164 mimxrt/mimxrt_sdram: Allow boards to override the default SDRAM config.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-29 23:08:48 +10:00
iabdalkader 4b9c459133 mimxrt/sdio: Add support for the 117x series.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-29 23:08:41 +10:00
MakerM0 7aa85353e7
Update mpconfigboard.mk 2023-09-29 16:32:33 +08:00
Damien George fbe58553c2 extmod/btstack/btstack_hci_uart: Trigger a poll after UART data is sent.
Prior to this commit, BTstack would only be notified of sent UART data when
the mp_bluetooth_hci_poll() function was called for some other reason, eg
because of incoming data over UART.  This is highly suboptimal.

With this commit, BTstack is now notified immediately after UART data has
been sent out.  This improves the multi_bluetooth/perf_gatt_char_write.py
performance test by about a factor of 10x for write-without-response, and
about 4x for write-with-response (tested on LEGO_HUB_NO6 as instance1).

Signed-off-by: Damien George <damien@micropython.org>
2023-09-29 18:01:42 +10:00
Jim Mussared fae83a6b4d tests/extmod/asyncio_threadsafeflag.py: Update for unix select.
1. Remove the skip for detecting support for polling user-defined objects
   as this is always possible now on all ports.
2. Don't print when the scheduled task runs as the ordering of this
   relative to the other prints is dependent on other factors (e.g. if
   using the native emitter).

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-09-29 17:58:40 +10:00
Jim Mussared cfe6a11e39 extmod/asyncio/event.py: Fix ThreadSafeFlag.ioctl return.
iobase_ioctl expects that an ioctl method must return an integer, and will
raise otherwise.

This was tripping up aioble on Unix, where the new hybrid modselect.c
implementation will attempt to extract a file descriptor from the pollable
via ioctl(MP_STREAM_GET_FILENO).

However, ThreadSafeFlag's ioctl only supported MP_STREAM_POLL, and returned
None otherwise.

This makes it return `-1` (to match tests/extmod/select_poll_custom.py). It
should probably be `-22` (corresponding to MP_EINVAL), but the value is
never checked, and MP_EINVAL can be a different value on different ports.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-09-29 17:58:40 +10:00
Thomas c854d0e3e1 examples/unix/machine_bios.py: Fix typo.
Signed-off-by: Thomas <th.acker.0302@gmail.com>
2023-09-29 17:02:15 +10:00
Carlosgg 10f34b97d1 tests/multi_net/ssl_cert_rsa.py: Update test certificate.
Update expired certificate, increase time validity period to five years and
fix command arguments typos in commentaries.

Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
2023-09-29 17:00:16 +10:00
iabdalkader 6a6a90507d stm32/boards/ARDUINO_GIGA: Update board config.
Changes are:
- Disable internal flash storage and use the external QSPI for storage.
- Disable default bootloader entry mode.  The bootloader entry function
  exists in board_init.c.
- Remove OSC enable/disable macros (this board doesn't have an OSC).

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-29 16:56:06 +10:00
Jim Mussared da6f1e1d1e rp2/msc_disk: Allow configuring the USB MSC inquiry response.
This was previously hard-coded to "Micropy" / "Mass Storage" / "1.0".

Now allow it to be overridden by a board.

Also change "Micropy" to "MicroPy" and "1.0" to "1.00" to match stm32.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-09-29 16:36:45 +10:00
Jim Mussared 61f331374d stm32/usbd_msc_interface: Allow configuring the MSC inquiry response.
This was previously hard-coded to "MicroPy" / "pyboard Flash" / "1.00".

Now allow it to be overridden by a board.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-09-29 16:35:48 +10:00
dotnfc d7f63f994f esp32/main: Allow a board to override the MicroPython task stack size.
This allows the MicroPython task stack size to be overridden by the
mpconfigboard.h settings.

Signed-off-by: dotnfc <dotnfc@163.com>
2023-09-29 16:14:15 +10:00
Glenn Moloney 6662d84faa esp32/boards: Add bootloader rollback support for all builds.
Add "CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y" to
ports/esp32/boards/sdkconfig.base so that all micropython esp32 images
support OTA rollback in the bootloader.  These images can then be converted
to OTA-capable images as required by user tools.

Also remove CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y from board-specific
sdkconfig files as this is now the default.

Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
2023-09-29 16:00:51 +10:00
MakerM0 79161dbeb2
Update sdkconfig 2023-09-29 13:47:47 +08:00
Angus Gratton b461d218d1 tests/run-internalbench.py: Remove old CPython reference.
At one point it was possible to internal_bench CPython vs MicroPython, but
seemingly not any more.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-09-29 15:41:41 +10:00
Angus Gratton dd8a69b5f2 tests/README: Document ./run-internalbench.py.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-09-29 15:41:28 +10:00
Felix Dörre 3c2b2f7a4d rp2/modmachine: Fix lightsleep while wifi is powered off.
While cyw43 is deinitialized, an interrupt occurs.  That is handled with
these lines: ports/rp2/mpnetworkport.c#L59-L61 and as pendsv is disabled
while in network code, the poll function then just waits there.

When deinit has finished, the poll func is executed, but skipped:
src/cyw43_ctrl.c#L222-L225 this skips the `CYW43_POST_POLL_HOOK` which
would re-enable interrupts, but also reset `cyw43_has_pending`.

And in that state, the lightsleep code, will skip sleeping as it thinks
there is a network packet pending to be handled.

With this change applied, lightsleep works as expected when the wifi chip
is enabled, and when it's powered off.
2023-09-29 15:15:42 +10:00
Peter Harper 584c495d32 shared/netutils/dhcpserver: Reply on correct netif.
The DHCP server broadcasts messages.  They are being sent via the default
netif which might be completely the wrong network.  We want to send
messages to the netif we got the original message from.

Original author: [Peter Harper](https://github.com/peterharperuk)
Source: https://github.com/raspberrypi/pico-examples/pull/392

Signed-off-by: Samveen <samveen@samveen.in>
2023-09-29 14:53:26 +10:00
Jos Verlinde 58c2c503a9 tools/mpremote: Add support for rfc2217, serial over TCP.
Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
2023-09-29 14:40:17 +10:00
Jim Mussared 88ecc78eb3 tools/autobuild/build-downloads.py: Verify standard features.
Defines the list of standard features and ensures that each board.json
only uses those ones. This list can be extended, but needs to be a
deliberate decision.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-09-29 14:18:33 +10:00
Jim Mussared cf32c2feb5 ports: Restrict board.json to standard features.
Applies to newly-added ARDUINO_PORTENTA_C33 and UM_NANOS3.

Makes the list match the standard features defined in
24a6e951ec.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-09-29 14:15:02 +10:00
Jim Mussared 79473691f2 {mimxrt,powerpc,samd}/mpconfigport: Don't override parse chunk alloc.
This was copied from minimal/mpconfigport.h, but it doesn't make sense
for general ports.

Add a comment to minimal/mpconfigport.h to explain why it specifically
overrides it.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-09-29 14:11:26 +10:00
Seon Rozenblum 77ae0a0948 esp32/boards: Fix VBAT voltage calculation for UM S3 boards.
Signed-off-by: Seon Rozenblum <seon@unexpectedmaker.com>
2023-09-29 14:09:15 +10:00
Jim Mussared 276bfa3146 py/lexer: Add missing initialisation for fstring_args_idx.
This was missed in 692d36d779. Probably
never noticed because everything enables `MICROPY_GC_CONSERVATIVE_CLEAR`,
but found via ASAN thanks to @gwangmu & @chibinz.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-09-29 13:58:26 +10:00
Ihor Nehrutsa d83c1a43d4 py: Change ifdef DEBUG_PRINT to if DEBUG_PRINT.
Signed-off-by: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com>
2023-09-29 13:04:38 +10:00