Git log: commit e3ff409724f02cd55baaec9db843efa2239554e9
Author: yangfl <yangfl@users.noreply.github.com>
Date: Fri Feb 9 22:18:25 2024 +0800
debian: update to 1.22.1
commit 4972713a3ac7e8f027e04ab1de1468a3d84b1018
Merge: 88a5600f 57a32dd9
Author: yangfl <yangfl@users.noreply.github.com>
Date: Fri Feb 9 21:21:59 2024 +0800
Merge tag 'upstream/1.22.1+ds'
commit 57a32dd9e81ef9db56e4f5517f18f54ae0396b6f
Author: yangfl <yangfl@users.noreply.github.com>
Date: Fri Feb 9 21:20:19 2024 +0800
Import Upstream version 1.22.1+ds
commit 9b8c64c9cee8203be167e6bffc74e186ae2fc958
Author: Damien George <damien@micropython.org>
Date: Fri Jan 5 12:33:34 2024 +1100
all: Bump version to 1.22.1.
Signed-off-by: Damien George <damien@micropython.org>
commit ac5e0b9f62a27eb0e8904f554e9050066180a4c2
Author: Damien George <damien@micropython.org>
Date: Tue Jan 2 01:04:03 2024 +1100
rp2/mpthreadport: Fix race with IRQ when entering atomic section.
Prior to this commit there is a potential deadlock in
mp_thread_begin_atomic_section(), when obtaining the atomic_mutex, in the
following situation:
- main thread calls mp_thread_begin_atomic_section() (for whatever reason,
doesn't matter)
- the second core is running so the main thread grabs the mutex via the
call mp_thread_mutex_lock(&atomic_mutex, 1), and this succeeds
- before the main thread has a chance to run save_and_disable_interrupts()
a USB IRQ comes in and the main thread jumps off to process this IRQ
- that USB processing triggers a call to the dcd_event_handler() wrapper
from commit bcbdee235719d459a4cd60d51021454fba54cd0f
- that then calls mp_sched_schedule_node()
- that then attempts to obtain the atomic section, calling
mp_thread_begin_atomic_section()
- that call then blocks trying to obtain atomic_mutex
- core0 is now deadlocked on itself, because the main thread has the mutex
but the IRQ handler (which preempted the main thread) is blocked waiting
for the mutex, which will never be free
The solution in this commit is to use mutex enter/exit functions that also
atomically disable/restore interrupts.
Fixes issues #12980 and #13288.
Signed-off-by: Damien George <damien@micropython.org>
commit 61b8361f5f98eba0e0ebd747ca7ef6259d3790d9
Author: Damien George <damien@micropython.org>
Date: Tue Jan 2 14:45:44 2024 +1100
rp2/mutex_extra: Implement additional mutex functions.
These allow entering/exiting a mutex and also disabling/restoring
interrupts, in an atomic way.
Signed-off-by: Damien George <damien@micropython.org>
commit 4b4f6011e8d1b87a86c8b680b2aa0702fe8e1829
Author: Damien George <damien@micropython.org>
Date: Tue Jan 2 01:03:13 2024 +1100
rp2/rp2_flash: Lockout second core only when doing flash erase/write.
Using the multicore lockout feature in the general atomic section makes it
much more difficult to get correct.
Signed-off-by: Damien George <damien@micropython.org>
commit 9feb0689eeaca5ce88aedcc680f997a3b4d0221c
Author: Damien George <damien@micropython.org>
Date: Wed Dec 27 15:35:31 2023 +1100
all: Bump version to 1.22.0.
Signed-off-by: Damien George <damien@micropython.org>
commit d014c8282652d0e2643a9ba088445c542ad43450
Author: Daniël van de Giessen <daniel@dvdgiessen.nl>
Date: Tue Sep 12 14:38:30 2023 +0200
extmod/nimble: Do not set GAP device name after sync.
Instead, configure the default once at compile-time. This means the GAP
name will no longer be set to default after re-initializing Bluetooth.
Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
commit 0b2676db5cc77ac1f19d3bfaaee713c22c5761a2
Author: Damien George <damien@micropython.org>
Date: Fri Dec 22 14:18:09 2023 +1100
lib/micropython-lib: Update submodule to latest.
Signed-off-by: Damien George <damien@micropython.org>
commit cfc212b10810863b7dee4f9228ce824ceca837c6
Author: Nicko van Someren <nicko@nicko.org>
Date: Sat Sep 30 16:54:47 2023 -0600
rp2/rp2_dma: Introduce a new rp2.DMA class for control over DMA xfers.
This commit implements fairly complete support for the DMA controller in
the rp2 series of microcontrollers. It provides a class for accessing the
DMA channels through a high-level, Pythonic interface, and functions for
setting and manipulating the DMA channel configurations.
Creating an instance of the rp2.DMA class claims one of the processor's DMA
channels. A sensible, per-channel default value for the ctrl register can
be fetched from the DMA.pack_ctrl() function, and the components of this
register can be set via keyword arguments to pack_ctrl().
The read, write, count and ctrl attributes of the DMA class provide
read/write access to the respective registers of the DMA controller. The
config() method allows any or all of these values to be set simultaneously
and adds a trigger keyword argument to allow the setup to immediately be
triggered. The read and write attributes (or keywords in config()) accept
either actual addresses or any object that supports the buffer interface.
The active() method provides read/write control of the channel's activity,
allowing the user to start and stop the channel and test if it is running.
Standard MicroPython interrupt handlers are supported through the irq()
method and the channel can be released either by deleting it and allowing
it to be garbage-collected or with the explicit close() method.
Direct, unfettered access to the DMA controllers registers is provided
through a proxy memoryview() object returned by the DMA.registers attribute
that maps directly onto the memory-mapped registers. This is necessary for
more fine-grained control and is helpful for allowing chaining of DMA
channels.
As a simple example, using DMA to do a fast memory copy just needs:
src = bytearray(32*1024)
dest = bytearray(32*1024)
dma = rp2.DMA()
dma.config(read=src, write=dest, count=len(src) // 4,
ctrl=dma.pack_ctrl(), trigger=True)
# Wait for completion
while dma.active():
pass
This API aims to strike a balance between simplicity and comprehensiveness.
Signed-off-by: Nicko van Someren <nicko@nicko.org>
Signed-off-by: Damien George <damien@micropython.org>
commit e4d3ab33045274c8e31ca559afea20753dbb6b82
Author: Sebastian Romero <s.romero@arduino.cc>
Date: Thu Dec 21 17:42:19 2023 +0100
nrf/main: Add /flash and /flash/lib to sys.path.
This allows to follow good practice and have libraries live in the lib
folder which means they will be found by the runtime without adding this
path manually at runtime.
Signed-off-by: Sebastian Romero <s.romero@arduino.cc>
commit d69e69adb689de91f97bc184c9ebc1022d0e4fc1
Author: Peter Züger <zueger.peter@icloud.com>
Date: Thu Dec 21 00:23:50 2023 +0100
py/mkrules.mk: Fix dependency file generation for compiler wrappers.
When compiling with distcc, it does not understand the -MD flag on its own.
This fixes the interaction by explicitly adding the -MF option.
The error in distcc is described here under "Problems with gcc -MD":
https://www.distcc.org/faq.html
Signed-off-by: Peter Züger <zueger.peter@icloud.com>
commit ce42c9ee1659ff86337a7f528332b4eaed6df0fc
Author: Peter Züger <zueger.peter@icloud.com>
Date: Thu Dec 21 00:17:15 2023 +0100
extmod/vfs_lfs: Fix lfs cache_size calculation.
The calculation of the lfs2 cache_size was incorrect, the maximum allowed
size is block_size.
The cache size must be: "a multiple of the read and program sizes, and a
factor of the block size".
Signed-off-by: Peter Züger <zueger.peter@icloud.com>
commit 3bca93b2d00dec37b3770c3e4fac15f07e0b9f15
Author: Maarten van der Schrieck <maarten@thingsconnected.nl>
Date: Sun Jun 18 11:46:25 2023 +0200
ports: Fix sys.stdout.buffer.write() return value.
MicroPython code may rely on the return value of sys.stdout.buffer.write()
to reflect the number of bytes actually written. While in most scenarios a
write() operation is successful, there are cases where it fails, leading to
data loss. This problem arises because, currently, write() merely returns
the number of bytes it was supposed to write, without indication of
failure.
One scenario where write() might fail, is where USB is used and the
receiving end doesn't read quickly enough to empty the receive buffer. In
that case, write() on the MicroPython side can timeout, resulting in the
loss of data without any indication, a behavior observed notably in
communication between a Pi Pico as a client and a Linux host using the ACM
driver.
A complex issue arises with mp_hal_stdout_tx_strn() when it involves
multiple outputs, such as USB, dupterm and hardware UART. The challenge is
in handling cases where writing to one output is successful, but another
fails, either fully or partially. This patch implements the following
solution:
mp_hal_stdout_tx_strn() attempts to write len bytes to all of the possible
destinations for that data, and returns the minimum successful write
length.
The implementation of this is complicated by several factors:
- multiple outputs may be enabled or disabled at compiled time
- multiple outputs may be enabled or disabled at runtime
- mp_os_dupterm_tx_strn() is one such output, optionally containing
multiple additional outputs
- each of these outputs may or may not be able to report success
- each of these outputs may or may not be able to report partial writes
As a result, there's no single strategy that fits all ports, necessitating
unique logic for each instance of mp_hal_stdout_tx_strn().
Note that addressing sys.stdout.write() is more complex due to its data
modification process ("cooked" output), and it remains unchanged in this
patch. Developers who are concerned about accurate return values from
write operations should use sys.stdout.buffer.write().
This patch might disrupt some existing code, but it's also expected to
resolve issues, considering that the peculiar return value behavior of
sys.stdout.buffer.write() is not well-documented and likely not widely
known. Therefore, it's improbable that much existing code relies on the
previous behavior.
Signed-off-by: Maarten van der Schrieck <maarten@thingsconnected.nl>
commit 91ee8ac89405b7d063f334100b7ed0394d69fe02
Author: Maarten van der Schrieck <maarten@thingsconnected.nl>
Date: Tue Oct 24 23:10:45 2023 +0200
extmod/os_dupterm: Let mp_os_dupterm_tx_strn() return num bytes written.
In case of multiple outputs, the minimum successful write length is
returned. In line with this, in case any output has a write error, zero is
returned.
In case of no outputs, -1 is returned.
The return value can be used to assess whether writes were attempted, and
if so, whether they succeeded.
Signed-off-by: Maarten van der Schrieck <maarten@thingsconnected.nl>
commit 5d28bb4adb24094917038a506248ff7fb351ac44
Author: Jim Mussared <jim.mussared@gmail.com>
Date: Tue Dec 19 16:13:50 2023 +1100
tools/manifestfile.py: Add support for external libraries.
This adds a `add_library(name, path)` method for use in manifest.py that
allows registering an external path (e.g. to another repo) by name.
This name can then be passed to `require("package", library="name")` to
reference packages in that repo/library rather than micropython-lib.
Within the external library, `require()` continues to work as normal
(referencing micropython-lib) by default, but they can also specify the
library name to require another package from that repo/library.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
commit 5552896ca8064a71446030bd9524cff7558a0f83
Author: IhorNehrutsa <IhorNehrutsa@gmail.com>
Date: Tue Dec 19 16:28:06 2023 +0200
esp32/mpconfigport: Enable MICROPY_PY_HASHLIB_MD5.
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
commit b31eef609497cd7e3c50841e1cf45f1610d39c73
Author: IhorNehrutsa <IhorNehrutsa@gmail.com>
Date: Tue Dec 19 16:28:06 2023 +0200
extmod/modhashlib: Support MD5 with mbedtls 3.x.
This change was missd in e7ae3ad92d7540cbe349cc05f5d62e0f63fce59b.
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
commit 74fd7b3d32e19a0c15ec1202cf03c31aa353a9f7
Author: Jim Mussared <jim.mussared@gmail.com>
Date: Thu Nov 9 17:36:09 2023 +1100
tools/ci.sh: Set `ulimit -n` for unix CI.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
commit 8b24aa36ba978eafc6114b6798b47b7bfecdca26
Author: Jim Mussared <jim.mussared@gmail.com>
Date: Mon Nov 6 16:36:15 2023 +1100
extmod/modselect: Handle growing the pollfds allocation correctly.
The poll_obj_t instances have their pollfd field point into this
allocation. So if re-allocating results in a move, we need to update the
existing poll_obj_t's.
Update the test to cover this case.
Fixes issue #12887.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
commit e9bcd49b3ef7bcf69026c747411408061b3a46be
Author: Damien George <damien@micropython.org>
Date: Wed Sep 20 19:15:05 2023 +1000
stm32/mboot: Add support for Microsoft WCID.
This adds support to stm32's mboot for the Microsoft WCID USB 0xee string
and Compatible ID Feature Descriptor. This allows the USB device to
automatically set the default USB driver, so that when the device is
plugged in Windows will assign the winusb driver to it. This means that
USB DFU mode can be used without installing any drivers.
For example this page will work (allow the board to be updated over DFU)
with zero install: https://devanlai.github.io/webdfu/dfu-util/
Tested on Windows 10, Windows can read the 0xee string correctly, and
requests the second special descriptor, which then configures the USB
device to use the winusb driver.
Signed-off-by: Damien George <damien@micropython.org>
commit 49d0c22b11732da3be622d7c550ecb4249bf17ac
Author: Damien George <damien@micropython.org>
Date: Wed Sep 20 19:14:22 2023 +1000
stm32/mboot: Expand device descriptor to make it easier to understand.
Signed-off-by: Damien George <damien@micropython.org>
commit 859f219690db5a1b91865e0a70c2b71d19be42a6
Author: Damien George <damien@micropython.org>
Date: Wed Sep 20 19:12:51 2023 +1000
stm32/mboot: Guard use of tx_pending with USE_USB_POLLING option.
Signed-off-by: Damien George <damien@micropython.org>
commit 7cf1118831e71670dc237b5256a54856f6fdf0c2
Author: Damien George <damien@micropython.org>
Date: Wed Sep 20 19:07:45 2023 +1000
stm32/usbdev: Optionally pass through vendor requests to Setup function.
Signed-off-by: Damien George <damien@micropython.org>
commit f46269a1d16a5d0890bbc97d1141af7173050013
Author: Damien George <damien@micropython.org>
Date: Wed Dec 20 15:54:05 2023 +1100
extmod/asyncio: Remove non-working Stream __aenter__/__aexit__ methods.
It looks like these never worked and there are no tests for this
functionality. Furthermore, CPython doesn't support this.
Fixes #12995.
Signed-off-by: Damien George <damien@micropython.org>
commit f6d630877c3b31a5091dff2fd615ddb92189a46c
Author: Damien George <damien@micropython.org>
Date: Mon Dec 18 13:38:16 2023 +1100
esp32: Add MICROPY_GC_INITIAL_HEAP_SIZE option and tune it.
This gets back the old heap-size behaviour on ESP32, before auto-split-heap
was introduced: after the heap is grown one time the size is 111936 bytes,
with about 40k left for the IDF. That's enough to start WiFi and do a
HTTPS request.
Signed-off-by: Damien George <damien@micropython.org>
commit 97b13132b129963a48d8b7d2e44c932cc73f7db3
Author: Damien George <damien@micropython.org>
Date: Mon Dec 18 13:32:36 2023 +1100
py/gc: Improve calculation of new heap size in split-heap-auto mode.
There are two main changes here to improve the calculation of the size of
the next heap area when automatically expanding the heap:
- Compute the existing total size by counting the total number of GC
blocks, and then using that to compute the corresponding number of bytes.
- Round the bytes value up to the nearest multiple of BYTES_PER_BLOCK.
This makes the calculation slightly simpler and more accurate, and makes
sure that, in the case of growing from one area to two areas, the number
of bytes allocated from the system for the second area is the same as the
first. For example on esp32 with an initial area size of 65536 bytes, the
subsequent allocation is also 65536 bytes. Previously it was a number that
was not even a multiple of 2.
Signed-off-by: Damien George <damien@micropython.org>
commit 3270d856fda58585d44dd05aefa7a95551fa76cc
Author: Patrick Van Oosterwijck <patrick@silicognition.com>
Date: Sun Jul 30 20:37:03 2023 -0600
rp2/boards: Add SIL_RP2040_SHIM board by Silicognition LLC.
Add new board Silicognition RP2040-Shim, RP2040 with 4 MB of flash
and W5500 drivers included and configured by default for use with
the Silicognition PoE-FeatherWing.
Co-authored-by: Matt Trentini <matt.trentini@gmail.com>
Signed-off-by: Patrick Van Oosterwijck <patrick@silicognition.com>
commit c51081c604f0dd0747d592d3d4952aac890f2c68
Author: Paul Grayson <paul@pololu.com>
Date: Wed Oct 11 11:28:47 2023 -0700
rp2/boards: Add support for Pololu 3pi+ and Zumo robots.
Signed-off-by: Paul Grayson <paul@pololu.com>
commit fbf079d7731c6402f7a852dd9fdc83a7106df910
Author: Paul Grayson <paul@pololu.com>
Date: Tue Apr 4 09:23:22 2023 -0700
rp2: Add new NO_DEFAULT_PINS config options for i2c, spi, and uart.
Some boards have multiple options for these pins, and they don't want to
allow users to initialize a port without explicitly specifying pin numbers.
Signed-off-by: Paul Grayson <paul@pololu.com>
commit a78ec4ef7b1fed5faa7fad9cc8d4c0b46af6d3c4
Author: Damien George <damien@micropython.org>
Date: Thu Dec 14 19:21:27 2023 +1100
rp2/mpconfigport: Enable MICROPY_PY_OS_DUPTERM_NOTIFY.
Signed-off-by: Damien George <damien@micropython.org>
commit 1f2ec4583d9095b49c0f775db74b2ceb49f12946
Author: Damien George <damien@micropython.org>
Date: Thu Dec 14 17:08:04 2023 +1100
extmod/os_dupterm: Prevent recursive execution of mp_os_dupterm_rx_chr.
Signed-off-by: Damien George <damien@micropython.org>
commit 395886caa3406a25790bd27e74ec63a96d8e5b4d
Author: Damien George <damien@micropython.org>
Date: Thu Dec 14 17:06:56 2023 +1100
extmod/modos: Factor os.dupterm_notify() function to common extmod code.
esp8266 doesn't need ets task because the notify is now scheduled (see
commits 7d57037906cf0274af08bd2eccbfffabe0ea66e3 and
c60caf19951c8326be9c3b6f3b016a4d21f69276 for relevant history).
Signed-off-by: Damien George <damien@micropython.org>
commit 0e706a62b168b7c2818f99d8785fe4dd31af9169
Author: Trent Piepho <tpiepho@gmail.com>
Date: Thu Dec 14 22:51:45 2023 -0800
py/makeqstrdefs.py: Stop generating temporary intermediate file.
In "cat" mode, output was written to a file named "out", then moved to the
location of the real output file. There was no reason for this.
While makeqstrdefs.py does make an effort to not update the timestamp on an
existing output file that has not changed, the intermediate "out" file
isn't part of the that process.
Signed-off-by: Trent Piepho <tpiepho@gmail.com>
commit 2e101a8e44b7f1bff75cc06a0597c572a8d8d152
Author: Elias Wimmer <elias.wimmer@tuwien.ac.at>
Date: Sun Dec 10 23:25:14 2023 +0100
extmod/modonewire: Improve write timings for better reliability.
When using long cables for sensors on onewire e.g. ds18b20, the current
default timings are too optimistic, leading to bus failures and CRC errors.
Stable results are achieved with the timings given by
https://www.analog.com/en/technical-articles/1wire-communication-through-software.html
commit 06df3b29256e4e90abc61505a28852268cf64af7
Author: Patrick Van Oosterwijck <patrick@silicognition.com>
Date: Wed Mar 17 23:15:20 2021 -0600
extmod/modonewire: Adopt Maxim recommended read timings.
The timing of the onewire module was way too fast when reading. This
commit adopts read timings as recommended in Maxim application note 126:
6 us (pulse) / 9 us (sample) / 55 us (bit slot). See also:
https://www.analog.com/en/technical-articles/1wire-communication-through-software.html
Signed-off-by: Damien George <damien@micropython.org>
commit de3e83aa4d9b671e6c5581ce19f98aa06f96e255
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Thu Dec 14 19:37:54 2023 +0000
github/workflows: Bump actions/upload-artifact from 3 to 4.
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact)
from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
commit be6464121072e827eefa19d7ae12746612a8cb79
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed Dec 6 19:50:28 2023 +0000
github/workflows: Bump actions/setup-python from 4 to 5.
Bumps [actions/setup-python](https://github.com/actions/setup-python) from
4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)
---
updated-dependencies:
- dependency-name: actions/setup-python
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
commit d506b5337704c0f6e6d78ef9cfa2ceb83e2a0474
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon Nov 13 19:27:04 2023 +0000
github/workflows: Bump actions/github-script from 6 to 7.
Bumps [actions/github-script](https://github.com/actions/github-script)
from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)
---
updated-dependencies:
- dependency-name: actions/github-script
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
commit f22e88611dda2f713ce9b8ae004915ae006105ba
Author: Trent Piepho <tpiepho@gmail.com>
Date: Tue Nov 28 14:21:03 2023 -0800
py/makeqstrdefs.py: Don't skip output for stale hash file.
In "cat" mode a "$output_file.hash" file is checked to see if the hash of
the new output is the same as the existing, and if so the output file isn't
updated.
However, it's possible that the output file has been deleted but the hash
file has not. In this case the output file is not created.
Change the logic so that a hash file is considered stale if there is no
output file and still create the output.
Signed-off-by: Trent Piepho <tpiepho@gmail.com>
commit 0d93392f10dc15cbd7e05931d0ddd7a5cc62c4b2
Author: Trent Piepho <tpiepho@gmail.com>
Date: Tue Nov 28 14:26:59 2023 -0800
py/mkrules.mk: List hash files as byproducts.
These are produced by the "cat" command to makeqstrdefs.py, to allow it to
not update unchanged files. cmake doesn't know about them and so they are
not removed on a "clean".
This triggered a bug in makeqstrdefs.py where it would not recreate a
deleted output file (which is removed by clean) if a stale hash file with a
valid hash still existed.
Listing them as byproducts will cause them to be deleted on clean.
Signed-off-by: Trent Piepho <tpiepho@gmail.com>
commit 85c02166cacb8c2a8bc82f9802814ca72cbf6017
Author: stijn <stijn@ignitron.net>
Date: Mon Dec 4 15:54:59 2023 +0100
py/modsys: Implement optional sys.intern.
Signed-off-by: stijn <stijn@ignitron.net>
commit 05d3b223011a88a10c806be866db8e0d29f1e348
Author: Carlosgg <carlosgilglez@gmail.com>
Date: Thu Sep 7 23:37:20 2023 +0100
docs/library: Document SSLContext cert methods and asyncio support.
Add `load_cert_chain`, `load_verify_locations`, `get_ciphers` and
`set_ciphers` SSLContext methods in ssl library, and update asyncio
`open_connection` and `start_server` methods with ssl support.
Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
commit bfd6ad94ff950a4b7e3a2125db1539c5e4ca333a
Author: Carlosgg <carlosgilglez@gmail.com>
Date: Thu Nov 30 16:44:48 2023 +0000
extmod/asyncio: Add ssl support with SSLContext.
This adds asyncio ssl support with SSLContext and the corresponding
tests in `tests/net_inet` and `tests/multi_net`.
Note that not doing the handshake on connect will delegate the handshake to
the following `mbedtls_ssl_read/write` calls. However if the handshake
fails when a client certificate is required and not presented by the peer,
it needs to be notified of this handshake error (otherwise it will hang
until timeout if any). Finally at MicroPython side raise the proper
mbedtls error code and message.
Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
commit f33dfb966a1432281809e372b9d3803e7fd3cb2f
Author: Damien George <damien@micropython.org>
Date: Thu Dec 14 12:03:36 2023 +1100
extmod/modssl_mbedtls: Fix parsing of ciphers in set_ciphers method.
Fixes two issues:
- None should not be allowed in the list, otherwise the corresponding entry
in ciphersuites[i] will have an undefined value.
- The terminating 0 needs to be put in ciphersuites[len].
Signed-off-by: Damien George <damien@micropython.org>
commit bba8a673d5ed6ad4404502c32dac003ad9d59bde
Author: Damien George <damien@micropython.org>
Date: Tue Dec 12 17:17:22 2023 +1100
tests: Update SSL network tests to use SSLContext, and work on CPython.
Changes are:
- use ssl.SSLContext.wrap_socket instead of ssl.wrap_socket
- disable check_hostname and call load_default_certs() where appropriate,
to get CPython to run the tests correctly
- pass socket.AF_INET to getaddrinfo and socket.socket(), to force IPv4
- change tests to use github.com instead of google.com, because certificate
validation was failing with google.com
Signed-off-by: Damien George <damien@micropython.org>
commit ef996d15b9cbadee591a185f27fb16e90a5d4f5d
Author: Damien George <damien@micropython.org>
Date: Tue Dec 12 17:15:24 2023 +1100
extmod/modssl_mbedtls: Make SSLSocket.getpeercert() optional.
And only enable this method when the relevant feature is available in
mbedtls. Otherwise, if mbedtls doesn't support getting the peer
certificate, this method always returns None and it's confusing why it does
that. It's better to remove the method altogether, so the error trying to
use it is more obvious.
Signed-off-by: Damien George <damien@micropython.org>
commit c9eb6bc6016a7f13cc624b6a4160599ab6b166ff
Author: Damien George <damien@micropython.org>
Date: Tue Dec 12 16:05:03 2023 +1100
esp32: Re-enable custom mbedtls error string tables.
To match other ports that use mbedtls.
Signed-off-by: Damien George <damien@micropython.org>
commit 58e75264c195438c14917485283b7b2f135067f1
Author: Damien George <damien@micropython.org>
Date: Tue Dec 12 16:03:20 2023 +1100
lib/mbedtls_errors: Update error list for latest esp32 mbedtls.
Running `./do-esp32.sh` now generates this esp32_mbedtls_errors.c file,
with IDF v5.0.4.
Signed-off-by: Damien George <damien@micropython.org>
commit f3f215e9bdf138fa6f94fb376ed72c25641aa298
Author: Carlosgg <carlosgilglez@gmail.com>
Date: Tue Jun 27 03:00:00 2023 +0100
extmod/modssl_mbedtls: Add SSLContext certificate methods.
This commit adds:
1) Methods to SSLContext class that match CPython signature:
- `SSLContext.load_cert_chain(certfile, keyfile)`
- `SSLContext.load_verify_locations(cafile=, cadata=)`
- `SSLContext.get_ciphers()` --> ["CIPHERSUITE"]
- `SSLContext.set_ciphers(["CIPHERSUITE"])`
2) `sslsocket.cipher()` to get current ciphersuite and protocol
version.
3) `ssl.MBEDTLS_VERSION` string constant.
4) Certificate verification errors info instead of
`MBEDTLS_ERR_X509_CERT_VERIFY_FAILED`.
5) Tests in `net_inet` and `multi_net` to test these new methods.
`SSLContext.load_cert_chain` method allows loading key and cert from disk
passing a filepath in `certfile` or `keyfile` options.
`SSLContext.load_verify_locations`'s `cafile` option enables the same
functionality for ca files.
Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
commit 4365edb810aa0e54eb91d201eb5bf0436c86c4b3
Author: IhorNehrutsa <IhorNehrutsa@gmail.com>
Date: Sun Nov 12 20:49:07 2023 +0200
esp32: Change minimum supported IDF version to v5.0.4.
Also, IDF v5.1.2 is now supported, just not used by default.
IDF v5.0.2 still builds but we cannot guarantee continued support for this
version moving forward.
Signed-off-by: IhorNehrutsa <IhorNehrutsa@gmail.com>
commit d0758d8a33dfbe1778d2285315d80badd6e92836
Author: Damien George <damien@micropython.org>
Date: Mon Dec 11 12:01:40 2023 +1100
esp32/boards/ESP32_GENERIC: Disable network.LAN and VM-opt on D2WD.
To reduce firmware size, because IDF v5.0.4 has increased in size.
Signed-off-by: Damien George <damien@micropython.org>
commit b4b77c17b551e103e45bcfe55df819c636b8617c
Author: Damien George <damien@micropython.org>
Date: Mon Dec 11 12:01:09 2023 +1100
esp32/mpconfigport: Keep some funcs out of IRAM for ESP32-SPIRAM builds.
To make sure the build fits.
Signed-off-by: Damien George <damien@micropython.org>
commit 3069fee3866190806fa8e258f07d8557e5842f5e
Author: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com>
Date: Mon Nov 13 14:07:59 2023 +0200
esp32/machine_i2s: Fix deprecated fields and constants.
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
commit a427117d0390f22e8cbb6d295a5800363a6733d5
Author: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com>
Date: Mon Nov 13 13:58:22 2023 +0200
esp32/modmachine: Fix deprecated esp_pm_config_XXX_t.
Co-Authored-By: Trent Piepho <35062987+xyzzy42@users.noreply.github.com>
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
commit e423b3c0ba09d7f8b1b9081e2edb520455aaad33
Author: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com>
Date: Mon Nov 13 12:06:42 2023 +0200
docs/esp32/quickref: Add DAC example.
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>