Skip to content

V1.21 merge from MicroPython #8508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 592 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
592 commits
Select commit Hold shift + click to select a range
d529c20
extmod/modssl_mbedtls: Fix ioctl of a socket in closed/error state.
dpgeorge Aug 9, 2023
597fcb4
tools/mpy-tool.py: Use isinstance() for type checking.
projectgus Aug 9, 2023
8dbb29d
tools/codeformat.py: Skip formatting ESP-IDF managed components.
DvdGiessen Aug 9, 2023
232c29c
tools/codeformat.py: Use pyproject.toml for black config.
Josverl Aug 2, 2023
4bbe879
tools/mpremote: Make soft-reset count as an action.
jimmo Aug 7, 2023
24a6e95
ports: Simplify board feature tags in board.json.
jimmo Aug 4, 2023
f6af484
extmod/modselect: Properly track number of poll objects that are fd's.
dpgeorge Aug 14, 2023
8851800
tests/extmod/select_poll_eintr.py: Improve robustness of test.
dpgeorge Aug 14, 2023
d325ee4
py/gc: Apply some code formatting cleanup.
projectgus Aug 2, 2023
519c24d
py/gc: Add new MICROPY_GC_SPLIT_HEAP_AUTO "auto grow heap" mode.
projectgus Aug 2, 2023
98fd784
esp32: Allow malloc() to allocate from SPIRAM.
projectgus Jul 28, 2023
05dcb8b
esp32: Enable automatic Python heap growth.
projectgus Aug 2, 2023
fa1ea21
esp32/gccollect: Make level arg volatile to force recursive function.
dpgeorge Aug 15, 2023
ad123ed
esp32/Makefile: Implement `make submodules` to match other ports.
jimmo Jul 31, 2023
9573d31
all: Remove query-variants make target.
jimmo Jul 31, 2023
2fbf42d
esp32/boards/GENERIC: Merge with GENERIC_{SPIRAM,OTA,D2WD,UNICORE}.
jimmo Jul 25, 2023
4815af7
esp32/boards/GENERIC_C3: Merge with GENERIC_C3_USB.
jimmo Jul 25, 2023
b25a675
esp32/boards/GENERIC_S2: Merge with ESP32_S2_WROVER.
jimmo Jul 25, 2023
afd407a
esp32/boards/GENERIC_S3: Merge with GENERIC_S3_{SPIRAM,SPIRAM_OCT}.
jimmo Jul 25, 2023
96258d3
esp32/partitions.csv: Rename to partitions-4MiB.csv.
jimmo Aug 15, 2023
91674c4
tools/autobuild: Automatically build all variants for each board.
jimmo Jul 25, 2023
a9821c0
mimxrt/machine_pin: Fix bug when Pin.irq is called without a handler.
robert-hh Jul 28, 2023
a9a219d
mimxrt/hal/pwm_backport: Fix 0 and 65536 edge cases of PWM's duty_u16.
robert-hh Jul 29, 2023
e43c669
mimxrt/machine_uart: Add uart.deinit method and machine_uart_deinit_all.
robert-hh Aug 10, 2023
afe2ca1
mimxrt/machine_uart: Add support for UART hardware flow control.
kwagyeman Jul 31, 2023
cb7e133
mimxrt/boards: Add support for GPIO control of SNVS pins.
kwagyeman Jul 26, 2023
00855ee
mimxrt/hal: Make flash clock frequency configurable.
kwagyeman Aug 4, 2023
861fbf6
examples: Mark asm, pio, etc. as noqa: F821 (undefined-name).
projectgus Aug 9, 2023
cec3ff5
mpy-cross: Fix source file name in file-not-found error.
projectgus Aug 9, 2023
ef864a4
cc3200/tools: Fix exception raised on process failure.
projectgus Aug 9, 2023
801910f
all: Add missing imports for micropython.const.
projectgus Aug 9, 2023
29c022e
examples/hwapi: Add missing import for 96Boards Carbon example.
projectgus Aug 16, 2023
974f994
renesas-ra/boards: Remove unreachable code in make-pins.py.
projectgus Aug 9, 2023
b8189d0
tools/mpy_ld.py: Pre-declare some local variables to appease linter.
projectgus Aug 9, 2023
1a5c9b9
tools/mpy-tool.py: Ignore linter failure in Python 2 compatibility code.
projectgus Aug 9, 2023
40fcbe1
top: Enable ruff linter check for F821 undefined-name.
projectgus Aug 9, 2023
a18d62e
mimxrt: Fix UART RTS/CTS assignments for the OLIMEX and Adafruit boards.
robert-hh Aug 16, 2023
e6cfb77
stm32/spi: Add STM32WL5 SUBGHZ SPI peripheral.
projectgus Jul 8, 2022
2c62adb
stm32/powerctrlboot: Support STM32WL system clock from HSE+PLL.
projectgus Aug 16, 2023
9e0f934
stm32/dma: Fix DMA completion on WL55 boards.
projectgus Jul 8, 2022
02620c2
stm32/subghz: Add STM32WL55 subghz radio interface to stm module.
projectgus Jul 15, 2022
2919a9f
stm32/modstm: Add MICROPY_PY_STM_CONST flag, clear it for STM32WL5.
projectgus Aug 9, 2023
f007d0a
nrf/boards: Rename all nRF boards to use uppercase.
jimmo Aug 15, 2023
b5836e7
esp32: Use uppercase variant names.
jimmo Aug 15, 2023
45845ac
rp2: Use uppercase variant names.
jimmo Aug 15, 2023
c309308
stm32: Use uppercase variant names.
jimmo Aug 15, 2023
1a99f74
ports/*/boards/*/board.json: Remove "id" field.
jimmo Aug 15, 2023
97ffc53
{esp32,rp2,stm32}/Makefile: Append board variant to BUILD.
jimmo Aug 15, 2023
aa23698
esp32: Rename GENERIC* boards to ESP32_GENERIC*.
jimmo Aug 15, 2023
ef03ca8
esp8266: Add board variant support.
jimmo Aug 15, 2023
873bd00
rp2: Rename PICO, PICO_W to RPI_PICO, RPI_PICO_W.
jimmo Aug 16, 2023
326dfd2
esp32/boards/ESP32_GENERIC_C3: Enable UART REPL.
jimmo Aug 21, 2023
bc1af5a
cc3200/Makefile: Build firmware.zip.
jimmo Aug 24, 2023
1dedb65
esp8266/boards/ESP8266_GENERIC: Add image filename.
dpgeorge Aug 24, 2023
4a3fdc0
tests/misc/sys_settrace_features.py: Fix to run on newer CPython.
jimmo Aug 23, 2023
b2b5bcc
py/profile: Remove the requirement to disable MICROPY_COMP_CONST.
jimmo Aug 23, 2023
f3eccb1
py/mpconfig: Enable SSL finalizers if finalizers are enabled.
jimmo Aug 23, 2023
313068a
extmod/modssl_mbedtls: Clear sock member if error creating SSLSocket.
dpgeorge Aug 30, 2023
6b407d5
mimxrt/machine_pin: Extend pin configuration functions.
iabdalkader May 2, 2023
46d83d9
mimxrt/sdio: Add SDIO driver.
iabdalkader May 2, 2023
772a360
mimxrt: Integrate support for WiFi via the CYW43 driver.
iabdalkader May 2, 2023
fc49524
mimxrt: Integrate Bluetooth support with NimBLE bindings.
iabdalkader May 9, 2023
a453b4f
drivers/cyw43: Make the CYW43 Bluetooth HCI driver more portable.
iabdalkader May 10, 2023
3f5976e
mimxrt/irq: Move all IRQ related definitions to dedicated header.
iabdalkader May 11, 2023
ce38784
mimxrt/machine_uart: Fix and complete UART.deinit and uart_deinit_all.
robert-hh Aug 16, 2023
c86b9ec
mimxrt/boards: Fix use of MICROPY_HW_SDRAM_AVAIL in MIMXRT1176.ld.
robert-hh Aug 30, 2023
81c19d9
mimxrt/machine_uart: Support slow baud rates for UART.
robert-hh Aug 31, 2023
32db4c5
extmod/moddeflate: Change default window size.
jimmo Aug 31, 2023
a175f98
stm32/mboot: Fix fwupdate by replacing zlib with new deflate module.
oliver-joos Aug 24, 2023
141750f
stm32/uart: Fix UART timeout issue with low baudrate on G4 MCUs.
yn386 Jul 1, 2023
845d0c7
docs/library/neopixel: Change link to a micropython-lib reference.
andypiper Jun 18, 2023
b94ab6a
examples/bluetooth: Raise ValueError when advertising data is too large.
Jun 20, 2023
f4a6fc2
examples/bluetooth: Link to aioble in BLE examples.
jimmo Aug 24, 2023
83f2f36
tests/unix/mod_os: Make os.system() test work on windows.
stinos Aug 23, 2023
e0a1480
py/objstr: Fix `str % {}` edge case.
mcskatkat Jul 10, 2023
d1f288c
py/modstruct: Support pad bytes in struct format.
DvdGiessen Nov 23, 2022
4837ec3
tools/mpy_ld.py: Support more complex rodata sections.
jonnor Jul 30, 2023
a64f2fd
py/dynruntime.h: Implement MP_OBJ_NEW_QSTR.
jimmo Aug 25, 2023
633599c
tests/run-tests.py: Capture output of stderr when running on CPython.
stephanelsmith Jul 26, 2023
1c04774
extmod/vfs_posix_file: Fix flush handling on macOS.
stephanelsmith Jul 26, 2023
db06041
extmod/vfs_posix_file: Implement sys.std*.buffer objects.
stephanelsmith Jul 26, 2023
25b89cb
extmod/{modlwip,modsocket}: Add support for SO_BROADCAST socket option.
xuancong84 Jun 19, 2023
56e5a21
esp32/modsocket: Add support for SO_BROADCAST socket option.
dpgeorge Sep 1, 2023
ba8aad3
esp32/modnetwork: Add support for SO_BINDTODEVICE socket option.
DvdGiessen Jul 4, 2023
f8bd677
esp32: Support JTAG console, free up UART.
DvdGiessen Jun 29, 2023
3cc3e4e
esp32/machine_uart: Release GIL for blocking reads.
DvdGiessen Nov 23, 2022
f52a2cd
samd/modules/_boot.py: Add /lib to sys.path.
jimmo Aug 16, 2023
607548f
examples/natmod: Add features4 as a class definition example.
jimmo May 29, 2023
6aa404c
tools/metrics.py: Fix nrf and rp2 board names after renaming.
dpgeorge Sep 1, 2023
9f1576f
rp2/machine_timer: Fix printing of timer period.
robert-hh Jun 17, 2023
6ec2e8f
esp32/boards: Add pins.csv to UM boards and other minor changes.
UnexpectedMaker Aug 3, 2023
6bd1404
esp32/boards/UM_NANOS3: Add new UM NanoS3 board.
UnexpectedMaker Aug 3, 2023
c0d4c60
esp32/network_ppp: Block after deleting task.
DvdGiessen Aug 15, 2023
ffb43b2
py/modthread: Return thread id from start_new_thread().
dlech Aug 3, 2023
1b03518
extmod/modssl_mbedtls: Call func psa_crypto_init if PSA is used.
Aug 1, 2023
65f0cb1
extmod/modssl_mbedtls: Ignore err ERR_SSL_RECEIVED_NEW_SESSION_TICKET.
Aug 1, 2023
545b94a
unix/modjni: Fix build errors with type definitions and error strings.
yangfl Aug 7, 2023
6e79b55
py/malloc: Fix DEBUG_print() args in m_realloc_maybe.
IhorNehrutsa Sep 3, 2023
bf35eef
esp32/boards/ARDUINO_NANO_ESP32: Clarify recovery instructions.
sebromero Aug 31, 2023
d001054
docs/library/platform: Add docs for the platform library.
Aug 21, 2023
304f13a
docs/library/network: Clarify network.hostname() behaviour.
jimmo Sep 4, 2023
1a5bfa5
docs/esp32/tutorial: Add example for pin access via registers.
IhorNehrutsa Sep 1, 2023
8bd2494
esp32/boards/UM_FEATHERS3: Fix I2C pins in pins.csv.
UnexpectedMaker Sep 4, 2023
297892c
mimxrt/machine_uart: Add a helper function to change the baudrate.
robert-hh Sep 1, 2023
671b38f
mimxrt/sdio: Move config guard so headers are only included if used.
dpgeorge Sep 5, 2023
5e50593
github/workflows: Bump actions/checkout from 3 to 4.
dependabot[bot] Sep 4, 2023
0bafdaf
esp32: Skip validation of image on boot from deepsleep.
glenn20 Aug 17, 2023
3637252
tests/multi_net: Increase asyncio tests timeouts.
iabdalkader Sep 5, 2023
8dbdac8
extmod/modlwip: Fix setting of IP option SOF_BROADCAST.
dpgeorge Sep 12, 2023
ff70bd1
stm32/timer: Fix deadtime config on Advanced Timer peripherals.
pi-anl Aug 15, 2023
ee5e594
stm32/dma: Add support for SPI1 DMA on H5 MCU's.
dpgeorge Sep 13, 2023
60e0ef6
stm32/octospi: Add support for dual-line SPI interface.
dpgeorge Sep 13, 2023
67b1c81
stm32/powerctrlboot: Allow using PLL3 for USB clock on H5 MCU's.
dpgeorge Sep 13, 2023
a4d28e5
stm32/timer: Fix use of TIM8 on H5 MCU's.
dpgeorge Sep 13, 2023
dc99840
stm32/uart: Add support for UART10 when it's a USART.
dpgeorge Sep 13, 2023
c9089e7
py/runtime: Add helpers to call a general function on nlr jump callback.
dpgeorge Sep 5, 2023
5e122b1
py/parse: Always free lexer even if an exception is raised.
dpgeorge Sep 5, 2023
397697a
py/persistentcode: Always close reader even if an exception is raised.
dpgeorge Sep 5, 2023
09a2ee8
renesas-ra/Makefile: Generate binary firmware output.
iabdalkader Apr 16, 2023
0a3264b
shared/tinyusb: Support HS endpoint sizes.
iabdalkader Apr 18, 2023
86fd958
lib/tinyusb: Update to the most recent master.
iabdalkader Aug 21, 2023
816b88a
mimxrt/Makefile: Update to work with latest TinyUSB.
iabdalkader Aug 21, 2023
d89a060
renesas-ra: Add TinyUSB support.
iabdalkader Apr 17, 2023
5b77451
renesas-ra: Add Bluetooth support using NimBLE.
iabdalkader May 26, 2023
142e8b7
renesas-ra: Add RNG driver.
iabdalkader Jun 22, 2023
62e650f
renesas-ra: Add networking support using lwIP.
iabdalkader Jun 21, 2023
31ff3ff
renesas-ra: Add mbedTLS support.
iabdalkader Jun 22, 2023
dc5ea0c
lib/protobuf-c: Add protobuf-c library.
iabdalkader Jun 1, 2023
ecedd78
drivers/esp-hosted: Add host driver for ESP-Hosted firmware.
iabdalkader Jun 21, 2023
474bf4e
extmod/network_esp_hosted: Add ESP-Hosted networking interface.
iabdalkader Jun 21, 2023
abd9bed
renesas-ra/fsp_cfg: Add common FSP config files.
iabdalkader Jul 6, 2023
7802eed
renesas-ra/boards/ARDUINO_PORTENTA_C33: Add support for Portenta C33.
iabdalkader Jul 6, 2023
174bb28
tools/ci.sh: Add ARDUINO_PORTENTA_C33 to RA CI build.
iabdalkader Sep 5, 2023
3e8aed9
py/gc: Add "max new split" value in result of gc.mem_free().
projectgus Sep 5, 2023
26160e8
docs/library/esp32: Update ESP32 idf_heap_info docs to match behaviour.
projectgus Sep 5, 2023
92f379c
docs/library/gc: Clarify mem_alloc and mem_free only for Python heap.
projectgus Sep 5, 2023
7087880
esp32/machine_pin: Fix null pointer access in machine_pin_find.
iabdalkader Sep 11, 2023
6abe3e1
rp2/mpbthciport: Switch to static scheduler nodes.
iabdalkader Apr 10, 2023
1976781
rp2/mpbthciport: Fix HCI UART config.
iabdalkader Apr 10, 2023
9ea9e04
rp2/mpconfigport: Disable BLE locking when MICROPY_PY_BLUETOOTH enabled.
iabdalkader Apr 10, 2023
d30f61b
drivers/ninaw10/nina_bt_hci: Make some minor fixes to HCI driver.
iabdalkader Apr 11, 2023
5473200
rp2/boards/ARDUINO_NANO_RP2040_CONNECT: Use standard HCI UART baudrate.
iabdalkader Apr 11, 2023
9dd40d1
docs/conf.py: Add sphinxcontrib.jquery to extensions.
dpgeorge Sep 18, 2023
b0e03b3
tools/autobuild: Include .bin firmware in renesas-ra build output.
dpgeorge Sep 18, 2023
00930b2
esp32/mphalport: Add function/line/file info to check_esp_err exception.
IhorNehrutsa Feb 28, 2023
fa68523
py/nlrx64: Mark nlr_push() as naked function when possible.
projectgus Sep 13, 2023
a3862e7
stm32/powerctrlboot: Allow PLL1 Q and R outputs to be enabled on H5.
dpgeorge Sep 14, 2023
dd58be1
esp32: Fix Partition.writeblocks() partial write corruption.
pillo79 Sep 21, 2023
13cc280
stm32/adc: Fix STM32H5 support.
renestraub Jul 29, 2023
8f9bba0
stm32/adc: Add support for STM32H5 ADC2 inputs.
renestraub Aug 5, 2023
64d24fc
stm32/adc: Optimize sampling time for G4, H5, L4 and WB MCUs.
renestraub Aug 5, 2023
72ef2e6
stm32/machine_adc: Fix and improve STM32H5 support.
renestraub Aug 2, 2023
08c661c
stm32/dac: Add STM32H5 DAC support, with dma_nohal implementation.
renestraub Aug 11, 2023
82b4ab7
stm32/boards: Move includes to after defines in all hal_conf.h files.
dpgeorge Sep 28, 2023
88564c1
stm32/uart: Generalise UART source clock calculation for H5 and H7 MCUs.
dpgeorge Sep 28, 2023
5dbd6fc
stm32/dma: Remove unbalanced ).
dpgeorge Sep 28, 2023
52f76cf
tests/stress/bytecode_limit.py: Reverse order of cases.
jimmo Sep 28, 2023
3695211
tests/float/float_format_ints.py: Put power-of-10 test in separate file.
dpgeorge Sep 27, 2023
a337668
tests/extmod/deflate_decompress.py: Skip test when not enough memory.
dpgeorge Sep 27, 2023
a7e2a6d
tests/extmod/ssl_cadata.py: Skip test on axtls.
dpgeorge Sep 27, 2023
7c88cdd
tests/float/math_domain.py: Tweak test to also pass with obj-repr-C.
dpgeorge Sep 27, 2023
62c3033
tests/extmod/vfs_fat_finaliser.py: Tweak test so files are collected.
dpgeorge Sep 27, 2023
03a3af4
esp8266/boards: Make sure modespnow.o is placed in irom0.
dpgeorge Sep 27, 2023
58f6349
extmod/modssl_axtls: Only close underlying socket once if it was used.
dpgeorge Sep 27, 2023
2fcd28f
py/mkrules.mk: Don't strip binary if STRIP variable is unset.
projectgus Sep 20, 2023
d83c1a4
py: Change ifdef DEBUG_PRINT to if DEBUG_PRINT.
IhorNehrutsa Sep 26, 2023
276bfa3
py/lexer: Add missing initialisation for fstring_args_idx.
jimmo Sep 28, 2023
77ae0a0
esp32/boards: Fix VBAT voltage calculation for UM S3 boards.
UnexpectedMaker Sep 27, 2023
7947369
{mimxrt,powerpc,samd}/mpconfigport: Don't override parse chunk alloc.
jimmo Sep 28, 2023
cf32c2f
ports: Restrict board.json to standard features.
jimmo Sep 28, 2023
88ecc78
tools/autobuild/build-downloads.py: Verify standard features.
jimmo Sep 28, 2023
58c2c50
tools/mpremote: Add support for rfc2217, serial over TCP.
Josverl Aug 11, 2023
584c495
shared/netutils/dhcpserver: Reply on correct netif.
peterharperuk Sep 22, 2023
3c2b2f7
rp2/modmachine: Fix lightsleep while wifi is powered off.
felixdoerre Feb 21, 2023
dd8a69b
tests/README: Document ./run-internalbench.py.
projectgus Sep 20, 2023
b461d21
tests/run-internalbench.py: Remove old CPython reference.
projectgus Sep 20, 2023
6662d84
esp32/boards: Add bootloader rollback support for all builds.
glenn20 Sep 6, 2023
d7f63f9
esp32/main: Allow a board to override the MicroPython task stack size.
dotnfc Sep 12, 2023
61f3313
stm32/usbd_msc_interface: Allow configuring the MSC inquiry response.
jimmo Sep 1, 2023
da6f1e1
rp2/msc_disk: Allow configuring the USB MSC inquiry response.
jimmo Sep 1, 2023
6a6a905
stm32/boards/ARDUINO_GIGA: Update board config.
iabdalkader Sep 15, 2023
10f34b9
tests/multi_net/ssl_cert_rsa.py: Update test certificate.
Carglglz Sep 6, 2023
c854d0e
examples/unix/machine_bios.py: Fix typo.
tacker66 Sep 8, 2023
cfe6a11
extmod/asyncio/event.py: Fix ThreadSafeFlag.ioctl return.
jimmo Sep 14, 2023
fae83a6
tests/extmod/asyncio_threadsafeflag.py: Update for unix select.
jimmo Sep 14, 2023
fbe5855
extmod/btstack/btstack_hci_uart: Trigger a poll after UART data is sent.
dpgeorge Sep 29, 2023
4b9c459
mimxrt/sdio: Add support for the 117x series.
iabdalkader Sep 5, 2023
805c750
mimxrt/mimxrt_sdram: Allow boards to override the default SDRAM config.
iabdalkader Sep 5, 2023
9d1a1ed
mimxrt/Makefile: Enable the FSL USDHC for supported MCU series.
iabdalkader Sep 5, 2023
552b0bb
mimxrt: Remove SDCARD Makefile config option.
iabdalkader Sep 5, 2023
361ca7d
mimxrt/mpbthciport: Enable flow control for BT HCI UART.
iabdalkader Sep 6, 2023
52e3da0
mimxrt/mbedtls: Enable certificate validity time validation.
iabdalkader Sep 6, 2023
0701341
mimxrt/machine_uart: Set the UART clock to a fixed 40MHz value.
robert-hh Sep 5, 2023
abb4469
mimxrt/boards/MIMXRT1176_clock_config: Fix comments about UART clocks.
robert-hh Sep 6, 2023
51ca23e
mimxrt/boards: Fix naming of SD-card config option.
robert-hh Sep 30, 2023
6482eb1
mimxrt/mpbthciport: Allow disabling UART flow control for BLE.
robert-hh Sep 30, 2023
4e5611c
mimxrt/machine_rtc: Improve the RTC init at boot.
robert-hh Sep 18, 2023
1660c78
unix/main: Fix memory leakage if MICROPY_USE_READLINE is disabled.
versaloon Sep 29, 2023
2772b88
rp2/README: Fix name of RPI_PICO_W board.
DGideas Sep 30, 2023
da193c4
ports: Rename Arduino board LED pins to be consistent.
iabdalkader Oct 1, 2023
a93ebd0
docs: Add requirements.txt file with dependencies for Sphinx.
Josverl Sep 22, 2023
977dc9a
extmod/asyncio/stream.py: Fix cancellation handling of start_server.
jimmo Jul 11, 2022
379b583
drivers/esp_hosted: Fix pin IRQ.
iabdalkader Sep 20, 2023
a43e13c
drivers/esp-hosted: Fix MTU size.
iabdalkader Sep 20, 2023
279e256
drivers/esp_hosted_hal: Add support for WiFI LED activity indicator.
iabdalkader Sep 20, 2023
5c80990
renesas-ra/boards/ARDUINO_PORTENTA_C33: Update WiFi config.
iabdalkader Sep 20, 2023
9d5d2e8
renesas-ra: Tune lwip buffers and timing to improve network performance.
iabdalkader Sep 20, 2023
cf490a7
all: Fix various spelling mistakes found by codespell 2.2.6.
dpgeorge Oct 3, 2023
d6c55a4
top: Update .git-blame-ignore-revs for latest spelling fix commit.
dpgeorge Oct 3, 2023
b329fdc
extmod/modnetwork: Increase max hostname length to 32.
jimmo Sep 29, 2023
65a3ce3
extmod/modnetwork: Forward if.config(hostname) to network.hostname.
jimmo Oct 3, 2023
1cd6114
esp32/boards/ARDUINO_NANO_ESP32: Use Arduino USB IDs.
pillo79 Oct 3, 2023
92717a9
tools/metrics.py: Fix esp32 and esp8266 board names after renaming.
dpgeorge Oct 4, 2023
cac666f
extmod/vfs_posix_file: Fix flush handling in msvc builds.
stinos Oct 3, 2023
5aec051
stm32/i2c: Add support for I2C4 on H7 MCUs.
iabdalkader Oct 3, 2023
5d53783
lib/cyw43-driver: Update driver to latest version v1.0.2.
dpgeorge Oct 5, 2023
342ebcb
lib/micropython-lib: Update submodule to latest.
dpgeorge Oct 5, 2023
040a96d
docs,tools: Change remaining "urequests" references to "requests".
dpgeorge Oct 5, 2023
d81cf0b
rp2/CMakeLists: Enable debug symbols in all builds.
projectgus Oct 5, 2023
f0f173f
esp32/boards/manifest.py: Freeze aioespnow into firmware by default.
glenn20 Oct 4, 2023
c2e9a6f
esp8266/boards/ESP8266_GENERIC: Remove urllib from the 2MiB manifest.
dpgeorge Oct 5, 2023
6f76d1c
rp2: Implement time.time_ns with time_us_64 so it has us resolution.
dpgeorge Oct 5, 2023
e00a144
all: Bump version to 1.21.0.
dpgeorge Oct 5, 2023
f2ebe68
Initial MicroPython v1.21.0 merge; not compiled yet
dhalbert Oct 18, 2023
a8fb081
Merge remote-tracking branch 'adafruit/main' into v1.21-merge
dhalbert Oct 19, 2023
c0a4abc
Fix merge bugs; remove shared/tinyusb/*
dhalbert Oct 19, 2023
367e13c
change CIRCUITPY change markers to CIRCUITPY-CHANGE
dhalbert Oct 19, 2023
4b42a6f
restore old uzlib; remove remaining U and u prefixes
dhalbert Oct 20, 2023
6eb0607
fix build when MICROPY_PY_ERRNO is 0
dhalbert Oct 20, 2023
009b3ae
Merge remote-tracking branch 'adafruit/main' into v1.21-merge
dhalbert Oct 20, 2023
fdfc442
MICROPY_NONSTANDARD_TYPECODES default; check MICROPY_PY_ERRNO in obje…
dhalbert Oct 20, 2023
8017a1a
ports/unix VARIANT=coverage fixes
dhalbert Oct 20, 2023
fa68428
Fix unicode test
tannewt Aug 18, 2021
508b064
Fix tests and update translations
tannewt Oct 20, 2023
24b51a2
Fix non_compliant test
tannewt Oct 23, 2023
f13ea9a
Fix async tests by adding back __await__ use. Remove u* lookup
tannewt Oct 23, 2023
1cd0ec2
restore CODE_OF_CONDUCT.md
dhalbert Oct 23, 2023
8f25403
pre-commit fixes
dhalbert Oct 24, 2023
3f0b807
pre-commit C formatting fix
dhalbert Oct 24, 2023
6cd5150
fix gc_free() to build in mpy-cross
dhalbert Oct 24, 2023
342b5e2
.github/workflows/run-tests.yml: drop 'u'
dhalbert Oct 24, 2023
557efbe
restore lib/mbedtls; remove gzip doc; restore zlib tests
dhalbert Oct 24, 2023
339b7e5
add platform.rst to library docs
dhalbert Oct 24, 2023
2c795ac
py/compile.c: add missing line for native labels in await
dhalbert Oct 24, 2023
d14bb57
Fix mp_frozen_names
tannewt Oct 24, 2023
3a86033
Remove packages reference
tannewt Oct 24, 2023
d814855
Enable native subpackage support
tannewt Oct 24, 2023
88db598
Remove mpremote ref
tannewt Oct 24, 2023
0045778
Fix mbedtls and stop removing it
tannewt Oct 24, 2023
ecaf9e6
Fix native emitter compile
tannewt Oct 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# all: Fix various spelling mistakes found by codespell 2.2.6.
cf490a70917a1b2d38ba9b58e763e0837d0f7ca7

# all: Fix spelling mistakes based on codespell check.
b1229efbd1509654dec6053865ab828d769e29db

# top: Update Python formatting to black "2023 stable style".
8b2748269244304854b3462cb8902952b4dcb892

Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ jobs:
run: |
make -C examples/natmod/features1
make -C examples/natmod/features2
make -C examples/natmod/uheapq
make -C examples/natmod/urandom
make -C examples/natmod/ure
make -C examples/natmod/uzlib
make -C examples/natmod/heapq
make -C examples/natmod/random
make -C examples/natmod/re
- name: Test native modules
if: matrix.test == 'all'
run: ./run-natmodtests.py extmod/{uheapq*,ure*,uzlib*}.py
run: ./run-natmodtests.py extmod/{heapq*,re*,zlib*}.py
working-directory: tests
6 changes: 3 additions & 3 deletions docs/library/gc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Functions

.. function:: mem_alloc()

Return the number of bytes of heap RAM that are allocated.
Return the number of bytes of heap RAM that are allocated by Python code.

.. admonition:: Difference to CPython
:class: attention
Expand All @@ -33,8 +33,8 @@ Functions

.. function:: mem_free()

Return the number of bytes of available heap RAM, or -1 if this amount
is not known.
Return the number of bytes of heap RAM that is available for Python
code to allocate, or -1 if this amount is not known.

.. admonition:: Difference to CPython
:class: attention
Expand Down
3 changes: 2 additions & 1 deletion docs/library/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limited flash memory:
``binascii``, ``errno``, ``json``, ``re``.

These libraries are not currently enabled in any CircuitPython build, but may be in the future:
``ctypes``
``ctypes``, ``platform``

.. toctree::
:maxdepth: 1
Expand All @@ -31,6 +31,7 @@ These libraries are not currently enabled in any CircuitPython build, but may be
gc.rst
io.rst
json.rst
platform.rst
re.rst
sys.rst
ctypes.rst
Expand Down
38 changes: 38 additions & 0 deletions docs/library/platform.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
:mod:`platform` -- access to underlying platform’s identifying data
===================================================================

.. module:: platform
:synopsis: access to underlying platform’s identifying data

|see_cpython_module| :mod:`python:platform`.

This module tries to retrieve as much platform-identifying data as possible. It
makes this information available via function APIs.

Functions
---------

.. function:: platform()

Returns a string identifying the underlying platform. This string is composed
of several substrings in the following order, delimited by dashes (``-``):

- the name of the platform system (e.g. Unix, Windows or MicroPython)
- the MicroPython version
- the architecture of the platform
- the version of the underlying platform
- the concatenation of the name of the libc that MicroPython is linked to
and its corresponding version.

For example, this could be
``"MicroPython-1.20.0-xtensa-IDFv4.2.4-with-newlib3.0.0"``.

.. function:: python_compiler()

Returns a string identifying the compiler used for compiling MicroPython.

.. function:: libc_ver()

Returns a tuple of strings *(lib, version)*, where *lib* is the name of the
libc that MicroPython is linked to, and *version* the corresponding version
of this libc.
1 change: 1 addition & 0 deletions docs/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Constants

* *name* - string "circuitpython"
* *version* - tuple (major, minor, micro), e.g. (1, 7, 0)
* *_machine* - string describing the underlying machine
* *_mpy* - supported mpy file-format version (optional attribute)

This object is the recommended way to distinguish CircuitPython from other
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Glossary

callee-owned tuple
This is a MicroPython-specific construct where, for efficiency
reasons, some built-in functions or methods may re-use the same
reasons, some built-in functions or methods may reuse the same
underlying tuple object to return data. This avoids having to allocate
a new tuple for every call, and reduces heap fragmentation. Programs
should not hold references to callee-owned tuples and instead only
Expand Down Expand Up @@ -120,7 +120,7 @@ Glossary
<https://github.com/micropython/micropython-lib>`_ which provides
implementations for many modules from CPython's standard library.

Some of the modules are are implemented in pure Python, and are able to
Some of the modules are implemented in pure Python, and are able to
be used on all ports. However, the majority of these modules use
:term:`FFI` to access operating system functionality, and as such can
only be used on the :term:`MicroPython Unix port` (with limited support
Expand Down
4 changes: 2 additions & 2 deletions docs/shared_bindings_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
}

ADDITIONAL_MODULES = {
"_asyncio": "MICROPY_PY_UASYNCIO",
"_asyncio": "MICROPY_PY_ASYNCIO",
"adafruit_bus_device": "CIRCUITPY_BUSDEVICE",
"adafruit_pixelbuf": "CIRCUITPY_PIXELBUF",
"array": "CIRCUITPY_ARRAY",
Expand All @@ -79,7 +79,7 @@
"keypad.Keys": "CIRCUITPY_KEYPAD_KEYS",
"keypad.ShiftRegisterKeys": "CIRCUITPY_KEYPAD_SHIFTREGISTERKEYS",
"os.getenv": "CIRCUITPY_OS_GETENV",
"select": "MICROPY_PY_USELECT_SELECT",
"select": "MICROPY_PY_SELECT_SELECT",
"sys": "CIRCUITPY_SYS",
"terminalio": "CIRCUITPY_DISPLAYIO",
"usb": "CIRCUITPY_USB_HOST",
Expand Down
74 changes: 74 additions & 0 deletions examples/natmod/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Dynamic Native Modules

Dynamic Native Modules are .mpy files that contain native machine code from a
language other than Python. For more info see [the documentation]
(https://docs.micropython.org/en/latest/develop/natmod.html).

This should not be confused with [User C Modules]
(https://docs.micropython.org/en/latest/develop/cmodules.html) which are a
mechanism to add additional out-of-tree modules into the firmware build.

## Examples

This directory contains several examples of writing dynamic native modules, in
two main categories:

1. Feature examples.

* `features0` - A module containing a single "factorial" function which
demonstrates working with integers.

* `features1` - A module that demonstrates some common tasks:
- defining simple functions exposed to Python
- defining local, helper C functions
- defining constant integers and strings exposed to Python
- getting and creating integer objects
- creating Python lists
- raising exceptions
- allocating memory
- BSS and constant data (rodata)
- relocated pointers in rodata

* `features2` - This is a hybrid module containing both Python and C code,
and additionally the C code is spread over multiple files. It also
demonstrates using floating point (only when the target supports
hardware floating point).

* `features3` - A module that shows how to use types, constant objects,
and creating dictionary instances.

* `features4` - A module that demonstrates how to define a class.

2. Dynamic version of existing built-ins.

This provides a way to add missing functionality to firmware that doesn't
include certain built-in modules. See the `heapq`, `random`, `re`,
`deflate`, `btree`, and `framebuf` directories.

So for example, if your firmware was compiled with `MICROPY_PY_FRAMEBUF`
disabled (e.g. to save flash space), then it would not include the
`framebuf` module. The `framebuf` native module provides a way to add the
`framebuf` module dynamically.

The way these work is they define a dynamic native module which
`#include`'s the original module and then does the necessary
initialisation of the module's globals dict.

## Build instructions

To compile an example, you need to have the same toolchain available as
required for your target port. e.g. `arm-none-eabi-gcc` for any ARM Cortex M
target. See the port instructions for details.

You also need to have the `pyelftools` Python package available, either via
your system package manager or installed from PyPI in a virtual environment
with `pip`.

Each example provides a Makefile. You should specify the `ARCH` argument to
make (one of x86, x64, armv6m, armv7m, xtensa, xtensawin):

```
$ cd features0
$ make ARCH=armv7m
$ mpremote cp features0.mpy :
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
MPY_DIR = ../../..

# Name of module (different to built-in uzlib so it can coexist)
MOD = uzlib_$(ARCH)
MOD = deflate_$(ARCH)

# Source files (.c or .py)
SRC = uzlib.c
SRC = deflate.c

# Architecture to build for (x86, x64, armv7m, xtensa, xtensawin)
ARCH = x64
Expand Down
70 changes: 70 additions & 0 deletions examples/natmod/deflate/deflate.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#define MICROPY_PY_DEFLATE (1)
#define MICROPY_PY_DEFLATE_COMPRESS (1)

#include "py/dynruntime.h"

#if !defined(__linux__)
void *memcpy(void *dst, const void *src, size_t n) {
return mp_fun_table.memmove_(dst, src, n);
}
void *memset(void *s, int c, size_t n) {
return mp_fun_table.memset_(s, c, n);
}
#endif

mp_obj_full_type_t deflateio_type;

#include "extmod/moddeflate.c"

// Re-implemented from py/stream.c, not yet available in dynruntime.h.
mp_obj_t mp_stream_close(mp_obj_t stream) {
const mp_stream_p_t *stream_p = mp_get_stream(stream);
int error;
mp_uint_t res = stream_p->ioctl(stream, MP_STREAM_CLOSE, 0, &error);
if (res == MP_STREAM_ERROR) {
mp_raise_OSError(error);
}
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_1(mp_stream_close_obj, mp_stream_close);

// Re-implemented from py/stream.c, not yet available in dynruntime.h.
STATIC mp_obj_t mp_stream___exit__(size_t n_args, const mp_obj_t *args) {
(void)n_args;
return mp_stream_close(args[0]);
}
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream___exit___obj, 4, 4, mp_stream___exit__);

// Re-implemented from obj.c, not yet available in dynruntime.h.
mp_obj_t mp_identity(mp_obj_t self) {
return self;
}
MP_DEFINE_CONST_FUN_OBJ_1(mp_identity_obj, mp_identity);

mp_map_elem_t deflateio_locals_dict_table[7];
STATIC MP_DEFINE_CONST_DICT(deflateio_locals_dict, deflateio_locals_dict_table);

mp_obj_t mpy_init(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *args) {
MP_DYNRUNTIME_INIT_ENTRY

deflateio_type.base.type = mp_fun_table.type_type;
deflateio_type.name = MP_QSTR_DeflateIO;
MP_OBJ_TYPE_SET_SLOT(&deflateio_type, make_new, &deflateio_make_new, 0);
MP_OBJ_TYPE_SET_SLOT(&deflateio_type, protocol, &deflateio_stream_p, 1);
deflateio_locals_dict_table[0] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_read), MP_OBJ_FROM_PTR(&mp_stream_read_obj) };
deflateio_locals_dict_table[1] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_OBJ_FROM_PTR(&mp_stream_readinto_obj) };
deflateio_locals_dict_table[2] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_readline), MP_OBJ_FROM_PTR(&mp_stream_unbuffered_readline_obj) };
deflateio_locals_dict_table[3] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_write), MP_OBJ_FROM_PTR(&mp_stream_write_obj) };
deflateio_locals_dict_table[4] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_close), MP_OBJ_FROM_PTR(&mp_stream_close_obj) };
deflateio_locals_dict_table[5] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR___enter__), MP_OBJ_FROM_PTR(&mp_identity_obj) };
deflateio_locals_dict_table[6] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR___exit__), MP_OBJ_FROM_PTR(&mp_stream___exit___obj) };
MP_OBJ_TYPE_SET_SLOT(&deflateio_type, locals_dict, (void*)&deflateio_locals_dict, 2);

mp_store_global(MP_QSTR___name__, MP_OBJ_NEW_QSTR(MP_QSTR_deflate));
mp_store_global(MP_QSTR_DeflateIO, MP_OBJ_FROM_PTR(&deflateio_type));
mp_store_global(MP_QSTR_RAW, MP_OBJ_NEW_SMALL_INT(DEFLATEIO_FORMAT_RAW));
mp_store_global(MP_QSTR_ZLIB, MP_OBJ_NEW_SMALL_INT(DEFLATEIO_FORMAT_ZLIB));
mp_store_global(MP_QSTR_GZIP, MP_OBJ_NEW_SMALL_INT(DEFLATEIO_FORMAT_GZIP));

MP_DYNRUNTIME_INIT_EXIT
}
2 changes: 1 addition & 1 deletion examples/natmod/features1/features1.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ mp_obj_t mpy_init(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *a
// This must be first, it sets up the globals dict and other things
MP_DYNRUNTIME_INIT_ENTRY

// Messages can be printed as usually
// Messages can be printed as usual
mp_printf(&mp_plat_print, "initialising module self=%p\n", self);

// Make the functions available in the module's namespace
Expand Down
2 changes: 2 additions & 0 deletions examples/natmod/features2/test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# This Python code will be merged with the C code in main.c

# ruff: noqa: F821 - this file is evaluated with C-defined names in scope

import array


Expand Down
14 changes: 14 additions & 0 deletions examples/natmod/features4/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Location of top-level MicroPython directory
MPY_DIR = ../../..

# Name of module
MOD = features4

# Source files (.c or .py)
SRC = features4.c

# Architecture to build for (x86, x64, armv7m, xtensa, xtensawin)
ARCH = x64

# Include to get the rules for compiling and linking the module
include $(MPY_DIR)/py/dynruntime.mk
Loading