Skip to content

Commit 5c09b90

Browse files
authored
Merge pull request #9841 from tannewt/esp32p4
Enable USB on ESP32-P4
2 parents c41d452 + 946198e commit 5c09b90

File tree

17 files changed

+86
-28
lines changed

17 files changed

+86
-28
lines changed

lib/tinyusb

Submodule tinyusb updated 410 files

ports/broadcom/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ SRC_C += bindings/videocore/__init__.c \
4848
lib/sdmmc/sdmmc_mmc.c \
4949
lib/sdmmc/sdmmc_sd.c \
5050
lib/tinyusb/src/portable/synopsys/dwc2/dcd_dwc2.c \
51+
lib/tinyusb/src/portable/synopsys/dwc2/dwc2_common.c \
5152
peripherals/broadcom/caches.c \
5253
peripherals/broadcom/gen/interrupt_handlers.c \
5354
peripherals/broadcom/gen/pins.c \

ports/espressif/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ INC += \
9595
-isystem esp-idf/components/esp_hw_support/dma/include \
9696
-isystem esp-idf/components/esp_hw_support/include \
9797
-isystem esp-idf/components/esp_hw_support/include/soc \
98+
-isystem esp-idf/components/esp_mm/include \
9899
-isystem esp-idf/components/esp_netif/include \
99100
-isystem esp-idf/components/esp_partition/include \
100101
-isystem esp-idf/components/esp_pm/include \
@@ -412,7 +413,9 @@ SRC_C += peripherals/touch.c
412413
endif
413414

414415
ifneq ($(CIRCUITPY_USB_DEVICE),0)
415-
SRC_C += lib/tinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c
416+
SRC_C += \
417+
lib/tinyusb/src/portable/synopsys/dwc2/dcd_dwc2.c \
418+
lib/tinyusb/src/portable/synopsys/dwc2/dwc2_common.c
416419
endif
417420

418421
ifneq ($(CIRCUITPY_AUDIOBUSIO),0)
@@ -766,6 +769,7 @@ endif
766769

767770
UF2_FAMILY_ID_esp32s2 = 0xbfdd4eee
768771
UF2_FAMILY_ID_esp32s3 = 0xc47e5767
772+
UF2_FAMILY_ID_esp32p4 = 0x540ddf62
769773

770774
$(BUILD)/firmware.uf2: $(BUILD)/circuitpython-firmware.bin
771775
$(STEPECHO) "Create $@"

ports/espressif/boards/espressif_esp32p4_function_ev/mpconfigboard.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,3 @@
1515

1616
#define DEFAULT_UART_BUS_RX (&pin_GPIO38)
1717
#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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# USB_VID = 0x303A
2-
# USB_PID = 0x7003
3-
# USB_PRODUCT = "ESP32-P4-Function-EV"
4-
# USB_MANUFACTURER = "Espressif"
1+
USB_VID = 0x303A
2+
USB_PID = 0x7013
3+
USB_PRODUCT = "ESP32-P4-Function-EV"
4+
USB_MANUFACTURER = "Espressif"
55

66
IDF_TARGET = esp32p4
77

88
CIRCUITPY_ESP_FLASH_SIZE = 16MB
9-
CIRCUITPY_ESP_FLASH_MODE = opi
9+
CIRCUITPY_ESP_FLASH_MODE = qio
1010
CIRCUITPY_ESP_FLASH_FREQ = 80m
1111

1212
CIRCUITPY_ESP_PSRAM_SIZE = 32MB
13-
CIRCUITPY_ESP_PSRAM_MODE = opi
14-
CIRCUITPY_ESP_PSRAM_FREQ = 80m
13+
CIRCUITPY_ESP_PSRAM_MODE = hpi
14+
CIRCUITPY_ESP_PSRAM_FREQ = 200m
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# USB_VID = 0x303A
2-
# USB_PID = 0x7003
3-
# USB_PRODUCT = "ESP32-P4 Stamp XL"
4-
# USB_MANUFACTURER = "Solder Party"
1+
USB_VID = 0x1209
2+
USB_PID = 0x0001
3+
USB_PRODUCT = "ESP32-P4 Stamp XL"
4+
USB_MANUFACTURER = "Solder Party"
55

66
IDF_TARGET = esp32p4
77

88
CIRCUITPY_ESP_FLASH_SIZE = 16MB
9-
CIRCUITPY_ESP_FLASH_MODE = opi
9+
CIRCUITPY_ESP_FLASH_MODE = qio
1010
CIRCUITPY_ESP_FLASH_FREQ = 80m
1111

1212
CIRCUITPY_ESP_PSRAM_SIZE = 32MB
13-
CIRCUITPY_ESP_PSRAM_MODE = opi
14-
CIRCUITPY_ESP_PSRAM_FREQ = 80m
13+
CIRCUITPY_ESP_PSRAM_MODE = hpi
14+
CIRCUITPY_ESP_PSRAM_FREQ = 200m
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# Espressif IoT Development Framework Configuration
3+
#
4+
#
5+
# Component config
6+
#
7+
#
8+
# Bluetooth
9+
#
10+
# CONFIG_BT_ENABLED is not set
11+
# end of Bluetooth
12+
13+
#
14+
# mbedTLS
15+
#
16+
# CONFIG_MBEDTLS_CMAC_C is not set
17+
# end of mbedTLS
18+
19+
# end of Component config
20+
21+
# end of Espressif IoT Development Framework Configuration
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# For ESP32-P4
2+
CONFIG_SPIRAM_SPEED_200M=y
3+
# CONFIG_SPIRAM_SPEED_20M is not set
4+
CONFIG_SPIRAM_SPEED=200
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# CONFIG_SPIRAM_MODE_QUAD is not set
2+
# CONFIG_SPIRAM_MODE_OCT is not set
3+
CONFIG_SPIRAM_MODE_HEX=y

ports/espressif/mpconfigport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
#define CIRCUITPY_DIGITALIO_HAVE_INPUT_ONLY (1)
1919

20+
#define CIRCUITPY_USB_DEVICE_INSTANCE 1
21+
2022
#include "py/circuitpy_mpconfig.h"
2123

2224
#define MICROPY_NLR_SETJMP (1)

0 commit comments

Comments
 (0)