Skip to content

Commit d777cd7

Browse files
committed
Merge remote-tracking branch 'adafruit/main' into merge-micropython-v1.23.0
2 parents 2679916 + 64cb762 commit d777cd7

File tree

62 files changed

+684
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+684
-99
lines changed

devices/ble_hci/common-hal/_bleio/Characteristic.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self,
5050
}
5151
}
5252

53+
bool common_hal_bleio_characteristic_deinited(bleio_characteristic_obj_t *self) {
54+
return self->handle == BLE_GATT_HANDLE_INVALID;
55+
}
56+
57+
void common_hal_bleio_characteristic_deinit(bleio_characteristic_obj_t *self) {
58+
if (common_hal_bleio_characteristic_deinited(self)) {
59+
return;
60+
}
61+
self->handle = BLE_GATT_HANDLE_INVALID;
62+
}
63+
5364
mp_obj_tuple_t *common_hal_bleio_characteristic_get_descriptors(bleio_characteristic_obj_t *self) {
5465
return mp_obj_new_tuple(self->descriptor_list->len, self->descriptor_list->items);
5566
}

ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ LONGINT_IMPL = MPZ
1212

1313
CIRCUITPY_FLOPPYIO = 0
1414
CIRCUITPY_FRAMEBUFFERIO = 0
15+
CIRCUITPY_BLEIO_HCI = 0
1516

1617
CIRCUITPY_BITBANG_APA102 = 1

ports/espressif/Makefile

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ CROSS_COMPILE = riscv32-esp-elf-
1212
else ifeq ($(IDF_TARGET),esp32c3)
1313
IDF_TARGET_ARCH = riscv
1414
CROSS_COMPILE = riscv32-esp-elf-
15+
else ifeq ($(IDF_TARGET),esp32p4)
16+
IDF_TARGET_ARCH = riscv
17+
CROSS_COMPILE = riscv32-esp-elf-
1518
else ifeq ($(IDF_TARGET),esp32c6)
1619
IDF_TARGET_ARCH = riscv
1720
CROSS_COMPILE = riscv32-esp-elf-
@@ -215,7 +218,13 @@ ifeq ($(IDF_TARGET_ARCH),xtensa)
215218

216219
CFLAGS += -mlongcalls -isystem esp-idf/components/xtensa/deprecated_include/ -Wno-error=cpp
217220
else ifeq ($(IDF_TARGET_ARCH),riscv)
221+
222+
ifeq ($(IDF_TARGET),esp32p4)
223+
CFLAGS += -march=rv32imafc_zicsr_zifencei_xesppie -mabi=ilp32f
224+
else
218225
CFLAGS += -march=rv32imac_zicsr_zifencei
226+
endif
227+
219228
LDFLAGS += \
220229
-Lesp-idf/components/riscv/ld \
221230
-Trom.api.ld
@@ -285,6 +294,16 @@ LDFLAGS += \
285294
-Tesp32c6.rom.wdt.ld
286295

287296

297+
CHIP_COMPONENTS = \
298+
esp_driver_tsens
299+
300+
else ifeq ($(IDF_TARGET),esp32p4)
301+
LDFLAGS += \
302+
-Tesp32p4.rom.newlib.ld \
303+
-Tesp32p4.rom.systimer.ld \
304+
-Tesp32p4.rom.wdt.ld
305+
306+
288307
CHIP_COMPONENTS = \
289308
esp_driver_tsens
290309

@@ -338,6 +357,8 @@ else ifeq ($(IDF_TARGET),esp32c3)
338357
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32C3
339358
else ifeq ($(IDF_TARGET),esp32c6)
340359
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32C6
360+
else ifeq ($(IDF_TARGET),esp32p4)
361+
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32P4
341362
else ifeq ($(IDF_TARGET),esp32h2)
342363
CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32H2
343364
else ifeq ($(IDF_TARGET),esp32s2)
@@ -578,7 +599,10 @@ update-board-sdkconfig: $(BUILD)/esp-idf/config/sdkconfig.h
578599
python tools/update_sdkconfig.py --board=$(BOARD) --debug=$(DEBUG)
579600

580601
BINARY_WIFI_BLOBS = libcore.a libespnow.a libnet80211.a libpp.a libsmartconfig.a
581-
BINARY_BLOBS = esp-idf/components/esp_phy/lib/$(IDF_TARGET)/libphy.a
602+
603+
ifneq ($(IDF_TARGET),esp32p4)
604+
BINARY_BLOBS = esp-idf/components/esp_phy/lib/$(IDF_TARGET)/libphy.a
605+
endif
582606
ifneq ($(CIRCUITPY_WIFI),0)
583607
BINARY_BLOBS += esp-idf/components/esp_coex/lib/$(IDF_TARGET)/libcoexist.a $(addprefix esp-idf/components/esp_wifi/lib/$(IDF_TARGET)/, $(BINARY_WIFI_BLOBS))
584608
ifneq ($(IDF_TARGET),esp32c2)
@@ -590,9 +614,9 @@ ifeq ($(IDF_TARGET),esp32)
590614
BINARY_BLOBS += esp-idf/components/esp_phy/lib/$(IDF_TARGET)/librtc.a
591615
endif
592616

593-
ESP_IDF_COMPONENTS_LINK = $(IDF_TARGET_ARCH) $(CHIP_COMPONENTS) app_update bootloader_support driver esp_driver_gpio esp_driver_gptimer esp_driver_ledc esp_driver_spi esp_driver_uart efuse esp_adc esp_app_format esp_common esp_event esp_hw_support esp_mm esp_partition esp_phy esp_pm esp_ringbuf esp_rom esp_system esp_timer freertos hal heap log newlib nvs_flash pthread soc spi_flash vfs esp_vfs_console
617+
ESP_IDF_COMPONENTS_LINK = $(IDF_TARGET_ARCH) $(CHIP_COMPONENTS) app_update bootloader_support driver esp_driver_gpio esp_driver_gptimer esp_driver_ledc esp_driver_spi esp_driver_uart efuse esp_adc esp_app_format esp_common esp_event esp_hw_support esp_mm esp_partition esp_pm esp_ringbuf esp_rom esp_system esp_timer freertos hal heap log newlib nvs_flash pthread soc spi_flash vfs esp_vfs_console
594618
ifneq ($(CIRCUITPY_WIFI),0)
595-
ESP_IDF_COMPONENTS_LINK += esp_coex esp_netif esp-tls esp_wifi lwip mbedtls mdns wpa_supplicant
619+
ESP_IDF_COMPONENTS_LINK += esp_coex esp_netif esp-tls esp_wifi lwip mbedtls mdns wpa_supplicant esp_phy
596620
endif
597621
ifneq ($(CIRCUITPY_BLEIO),0)
598622
BLE_IMPL_esp32 := esp32
@@ -603,7 +627,7 @@ ifneq ($(CIRCUITPY_BLEIO),0)
603627
BLE_IMPL_esp32h2 := libble
604628
BLE_IMPL = $(BLE_IMPL_$(IDF_TARGET))
605629

606-
ESP_IDF_COMPONENTS_LINK += bt
630+
ESP_IDF_COMPONENTS_LINK += bt esp_phy
607631
ifeq ($(BLE_IMPL),esp32)
608632
# BLE will hang the ESP32 and trigger an interrupt watchdog without this undefined symbol at
609633
# link because a weak version of the interrupt that BLE uses will be linked incorrectly.
@@ -665,6 +689,8 @@ else ifeq ($(IDF_TARGET),esp32c3)
665689
BOOTLOADER_OFFSET = 0x0
666690
else ifeq ($(IDF_TARGET),esp32c6)
667691
BOOTLOADER_OFFSET = 0x0
692+
else ifeq ($(IDF_TARGET),esp32p4)
693+
BOOTLOADER_OFFSET = 0x2000
668694
else ifeq ($(IDF_TARGET),esp32s3)
669695
BOOTLOADER_OFFSET = 0x0
670696
else ifeq ($(IDF_TARGET),esp32s2)

ports/espressif/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Support Status:
1414
ESP32-C2, "alpha"
1515
ESP32-C3, "beta"
1616
ESP32-C6, "alpha"
17+
ESP32-P4, "alpha"
1718
ESP32-S2, "stable"
1819
ESP32-S3, "stable"
1920

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#include "supervisor/board.h"
8+
9+
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2019 Scott Shawcroft for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#pragma once
8+
9+
// Micropython setup
10+
11+
#define MICROPY_HW_BOARD_NAME "ESP32-P4-Function-EV"
12+
#define MICROPY_HW_MCU_NAME "ESP32P4"
13+
14+
#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0)
15+
16+
#define DEFAULT_UART_BUS_RX (&pin_GPIO38)
17+
#define DEFAULT_UART_BUS_TX (&pin_GPIO37)
18+
19+
#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX
20+
#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# USB_VID = 0x303A
2+
# USB_PID = 0x7003
3+
# USB_PRODUCT = "ESP32-P4-Function-EV"
4+
# USB_MANUFACTURER = "Espressif"
5+
6+
IDF_TARGET = esp32p4
7+
8+
CIRCUITPY_ESP_FLASH_SIZE = 16MB
9+
CIRCUITPY_ESP_FLASH_MODE = opi
10+
CIRCUITPY_ESP_FLASH_FREQ = 80m
11+
12+
CIRCUITPY_ESP_PSRAM_SIZE = 32MB
13+
CIRCUITPY_ESP_PSRAM_MODE = opi
14+
CIRCUITPY_ESP_PSRAM_FREQ = 80m
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// This file is part of the CircuitPython project: https://circuitpython.org
2+
//
3+
// SPDX-FileCopyrightText: Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
4+
//
5+
// SPDX-License-Identifier: MIT
6+
7+
#include "shared-bindings/board/__init__.h"
8+
9+
static const mp_rom_map_elem_t board_module_globals_table[] = {
10+
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
11+
12+
{ MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) },
13+
{ MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) },
14+
{ MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) },
15+
{ MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) },
16+
{ MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) },
17+
{ MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) },
18+
{ MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) },
19+
{ MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) },
20+
{ MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) },
21+
{ MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) },
22+
{ MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) },
23+
{ MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) },
24+
{ MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) },
25+
{ MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) },
26+
{ MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) },
27+
{ MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) },
28+
{ MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) },
29+
{ MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) },
30+
{ MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) },
31+
{ MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) },
32+
{ MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) },
33+
{ MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) },
34+
{ MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) },
35+
{ MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) },
36+
{ MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) },
37+
{ MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) },
38+
{ MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) },
39+
{ MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) },
40+
{ MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) },
41+
{ MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) },
42+
{ MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) },
43+
{ MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) },
44+
{ MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) },
45+
{ MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) },
46+
{ MP_ROM_QSTR(MP_QSTR_IO47), MP_ROM_PTR(&pin_GPIO47) },
47+
{ MP_ROM_QSTR(MP_QSTR_IO48), MP_ROM_PTR(&pin_GPIO48) },
48+
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO48) },
49+
50+
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) },
51+
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) },
52+
53+
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
54+
};
55+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

ports/espressif/boards/espressif_esp32p4_function_ev/sdkconfig

Whitespace-only changes.

ports/espressif/boards/vidi_x/mpconfigboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#pragma once
88

9-
#define MICROPY_HW_BOARD_NAME "VIDI X"
9+
#define MICROPY_HW_BOARD_NAME "VIDI X V1.1"
1010
#define MICROPY_HW_MCU_NAME "ESP32"
1111

1212
#define MICROPY_HW_LED_STATUS (&pin_GPIO2)

0 commit comments

Comments
 (0)