Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Jason2866/esp32-arduino-lib-builder
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3006
Choose a base ref
...
head repository: Jason2866/esp32-arduino-lib-builder
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.3_Arduino
Choose a head ref

Commits on Oct 1, 2024

  1. Update dcd_esp32sx.c

    Jason2866 authored Oct 1, 2024
    Copy the full SHA
    853fa42 View commit details
  2. Update defconfig.esp32s2

    Jason2866 authored Oct 1, 2024
    Copy the full SHA
    4c436e9 View commit details
  3. Update defconfig.esp32s3

    Jason2866 authored Oct 1, 2024
    Copy the full SHA
    2fa5a59 View commit details

Commits on Oct 2, 2024

  1. temp Tinyusb fix

    Jason2866 authored Oct 2, 2024
    Copy the full SHA
    c326cd2 View commit details
  2. Update defconfig.esp32s3

    Jason2866 authored Oct 2, 2024
    Copy the full SHA
    fedf532 View commit details
  3. Update defconfig.esp32s2

    Jason2866 authored Oct 2, 2024
    Copy the full SHA
    2b071f5 View commit details
  4. COMPONENTS_SUBSET

    Jason2866 authored Oct 2, 2024
    Copy the full SHA
    161a283 View commit details
  5. add COMPONENTS_SUBSET

    Jason2866 authored Oct 2, 2024
    Copy the full SHA
    851a8a5 View commit details

Commits on Oct 3, 2024

  1. Update CMakeLists.txt

    Jason2866 authored Oct 3, 2024
    Copy the full SHA
    c097781 View commit details
  2. Update Kconfig.projbuild

    Jason2866 authored Oct 3, 2024
    Copy the full SHA
    ad04720 View commit details
  3. Update tusb_config.h

    Jason2866 authored Oct 3, 2024
    Copy the full SHA
    2b18259 View commit details
  4. Update dcd_dwc2.c

    Jason2866 authored Oct 3, 2024
    Copy the full SHA
    7d67041 View commit details
  5. Copy the full SHA
    4991c68 View commit details
  6. Copy the full SHA
    a0d3122 View commit details
  7. Copy the full SHA
    4cece9d View commit details
  8. Copy the full SHA
    03dc565 View commit details

Commits on Oct 10, 2024

  1. Update dcd_dwc2.c

    Jason2866 authored Oct 10, 2024
    Copy the full SHA
    2ffedba View commit details
  2. Update dcd_dwc2.patch

    Jason2866 authored Oct 10, 2024
    Copy the full SHA
    c35acbf View commit details

Commits on Oct 14, 2024

  1. remove lib zigbee

    Jason2866 authored Oct 14, 2024
    Copy the full SHA
    def45e7 View commit details
  2. rremove lib zigbee

    Jason2866 authored Oct 14, 2024
    Copy the full SHA
    7813acf View commit details
  3. Disable Tinyusb support

    Jason2866 authored Oct 14, 2024
    Copy the full SHA
    037a712 View commit details
  4. remove no LTO

    Jason2866 authored Oct 14, 2024
    Copy the full SHA
    e3795f0 View commit details

Commits on Oct 15, 2024

  1. Enable TinyUSB driver

    Jason2866 authored Oct 15, 2024
    Copy the full SHA
    bb62068 View commit details
  2. Update defconfig.esp32p4

    Jason2866 authored Oct 15, 2024
    Copy the full SHA
    cc109a4 View commit details
  3. Update build.sh

    Jason2866 authored Oct 15, 2024
    Copy the full SHA
    00fa9e2 View commit details
  4. Update defconfig.esp32p4

    Jason2866 authored Oct 15, 2024
    Copy the full SHA
    f92b314 View commit details
  5. temp Tinyusb compile fix

    Jason2866 authored Oct 15, 2024
    Copy the full SHA
    e308b1e View commit details
  6. Copy the full SHA
    9804819 View commit details
  7. Update build.sh

    Jason2866 authored Oct 15, 2024
    Copy the full SHA
    254ea00 View commit details
  8. changes for latest tinyusb

    Jason2866 authored Oct 15, 2024
    Copy the full SHA
    c1617e8 View commit details
  9. Copy the full SHA
    893b867 View commit details
  10. Update builds.json

    Jason2866 authored Oct 15, 2024
    Copy the full SHA
    1f2bf02 View commit details
  11. Update defconfig.esp32p4

    Jason2866 authored Oct 15, 2024
    Copy the full SHA
    20423c6 View commit details

Commits on Oct 16, 2024

  1. Update idf_component.yml

    Jason2866 authored Oct 16, 2024
    Copy the full SHA
    0339ae2 View commit details
  2. Copy the full SHA
    d8ee289 View commit details

Commits on Oct 21, 2024

  1. Copy the full SHA
    2c7c6f5 View commit details
  2. Copy the full SHA
    55103c2 View commit details

Commits on Oct 22, 2024

  1. Update defconfig.esp32c6

    Jason2866 authored Oct 22, 2024
    Copy the full SHA
    3f5137f View commit details
  2. Copy the full SHA
    fab6f6f View commit details

Commits on Oct 23, 2024

  1. Update CMakeLists.txt

    Jason2866 authored Oct 23, 2024
    Copy the full SHA
    13122d0 View commit details

Commits on Oct 25, 2024

  1. CONFIG_MBEDTLS_FS_IO

    Jason2866 authored Oct 25, 2024
    Copy the full SHA
    3538f21 View commit details

Commits on Oct 31, 2024

  1. Update push.yml

    Jason2866 authored Oct 31, 2024
    Copy the full SHA
    98fa3d7 View commit details
  2. Copy the full SHA
    7d302d8 View commit details

Commits on Nov 5, 2024

  1. Copy the full SHA
    349a23d View commit details
  2. Update archive-build.sh

    Jason2866 authored Nov 5, 2024
    Copy the full SHA
    48ea502 View commit details

Commits on Nov 6, 2024

  1. Copy the full SHA
    9e0d789 View commit details
  2. Update copy-libs.sh

    Jason2866 authored Nov 6, 2024
    Copy the full SHA
    bf201df View commit details

Commits on Nov 11, 2024

  1. Copy the full SHA
    4d0119c View commit details

Commits on Nov 12, 2024

  1. again tinyusb update...

    Jason2866 authored Nov 12, 2024
    Copy the full SHA
    cc89f25 View commit details
  2. Update dcd_dwc2.patch

    Jason2866 authored Nov 12, 2024
    Copy the full SHA
    4213909 View commit details
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: IDF v5.3 with P4
name: IDF v5.3
on:
workflow_dispatch: # Manually start a workflow

2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -33,3 +33,5 @@ add_custom_command(
VERBATIM
)
add_custom_target(mem-variant DEPENDS "mem_variant")

idf_build_set_property(COMPILE_DEFINITIONS "-DESP32_ARDUINO_LIB_BUILDER" APPEND)
29 changes: 17 additions & 12 deletions components/arduino_tinyusb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -15,15 +15,20 @@ if(CONFIG_TINYUSB_ENABLED)
"-DCFG_TUSB_DEBUG=${CONFIG_TINYUSB_DEBUG_LEVEL}"
"-Wno-type-limits" # needed for the vanila tinyusb with turned off classes
)
elseif(IDF_TARGET STREQUAL "esp32p4")
set(compile_options
"-DCFG_TUSB_MCU=OPT_MCU_ESP32P4"
"-DCFG_TUSB_DEBUG=${CONFIG_TINYUSB_DEBUG_LEVEL}"
"-Wno-type-limits" # needed for the vanila tinyusb with turned off classes
)
endif()

set(srcs
# espressif:
#"${COMPONENT_DIR}/src/dcd_esp32sx.c"
"${COMPONENT_DIR}/src/dcd_dwc2.c"
# tusb:
#"${COMPONENT_DIR}/tinyusb/src/portable/espressif/esp32sx/dcd_esp32sx.c"
#"{COMPONENT_DIR}/tinyusb/src/portable/synopsys/dwc2/dcd_dwc2.c"
#"${COMPONENT_DIR}/tinyusb/src/portable/synopsys/dwc2/dcd_dwc2.c"
"${COMPONENT_DIR}/tinyusb/src/portable/synopsys/dwc2/dwc2_common.c"
"${COMPONENT_DIR}/tinyusb/src/class/cdc/cdc_device.c"
"${COMPONENT_DIR}/tinyusb/src/class/hid/hid_device.c"
"${COMPONENT_DIR}/tinyusb/src/class/midi/midi_device.c"
@@ -32,6 +37,7 @@ if(CONFIG_TINYUSB_ENABLED)
"${COMPONENT_DIR}/tinyusb/src/class/dfu/dfu_rt_device.c"
"${COMPONENT_DIR}/tinyusb/src/class/dfu/dfu_device.c"
"${COMPONENT_DIR}/tinyusb/src/class/vendor/vendor_device.c"
"${COMPONENT_DIR}/tinyusb/src/class/net/ncm_device.c"
"${COMPONENT_DIR}/tinyusb/src/common/tusb_fifo.c"
"${COMPONENT_DIR}/tinyusb/src/device/usbd_control.c"
"${COMPONENT_DIR}/tinyusb/src/device/usbd.c"
@@ -56,16 +62,15 @@ if(CONFIG_TINYUSB_ENABLED)

set(requires esp_rom freertos soc)
set(priv_requires arduino main)
### tinyusb lib ###
###################
idf_component_register(INCLUDE_DIRS ${includes_public} PRIV_INCLUDE_DIRS ${includes_private} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires})
# add_library(${COMPONENT_TARGET} STATIC ${srcs})
# target_include_directories(
# ${COMPONENT_TARGET}
# PUBLIC ${includes_public}
# PRIVATE ${includes_private})

idf_component_register(
INCLUDE_DIRS ${includes_public}
PRIV_INCLUDE_DIRS ${includes_private}
SRCS ${srcs}
REQUIRES ${requires}
PRIV_REQUIRES ${priv_requires}
)
target_compile_options(${COMPONENT_TARGET} PRIVATE ${compile_options})
#target_link_libraries(${COMPONENT_TARGET} INTERFACE ${COMPONENT_TARGET})

else()

47 changes: 37 additions & 10 deletions components/arduino_tinyusb/Kconfig.projbuild
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ menu "Arduino TinyUSB"
config TINYUSB_ENABLED
bool "Enable TinyUSB driver"
default y
depends on IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
depends on IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4
select FREERTOS_SUPPORT_STATIC_ALLOCATION
select FREERTOS_USE_AUTHENTIC_INCLUDE_PATHS
help
@@ -28,18 +28,28 @@ menu "Arduino TinyUSB"

config TINYUSB_CDC_RX_BUFSIZE
int "CDC FIFO size of RX"
default 64
default 64 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
default 512 if IDF_TARGET_ESP32P4
depends on TINYUSB_CDC_ENABLED
help
CDC FIFO size of RX

config TINYUSB_CDC_TX_BUFSIZE
int "CDC FIFO size of TX"
default 64
default 64 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
default 512 if IDF_TARGET_ESP32P4
depends on TINYUSB_CDC_ENABLED
help
CDC FIFO size of TX

config TINYUSB_CDC_MAX_PORTS
int "Maximum enabled CDC ports"
range 1 2
default 1
depends on TINYUSB_CDC_ENABLED
help
Maximum enabled CDC ports

endmenu

menu "Mass Storage (MSC) driver"
@@ -86,7 +96,8 @@ menu "Arduino TinyUSB"

config TINYUSB_HID_BUFSIZE
int "HID Buffer size"
default 64
default 64 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
default 512 if IDF_TARGET_ESP32P4
depends on TINYUSB_HID_ENABLED
help
HID Buffer size. Should be sufficient to hold ID (if any) + Data
@@ -111,14 +122,16 @@ menu "Arduino TinyUSB"

config TINYUSB_MIDI_RX_BUFSIZE
int "MIDI FIFO size of RX"
default 64
default 64 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
default 512 if IDF_TARGET_ESP32P4
depends on TINYUSB_MIDI_ENABLED
help
MIDI FIFO size of RX

config TINYUSB_MIDI_TX_BUFSIZE
int "MIDI FIFO size of TX"
default 64
default 64 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
default 512 if IDF_TARGET_ESP32P4
depends on TINYUSB_MIDI_ENABLED
help
MIDI FIFO size of TX
@@ -143,8 +156,9 @@ menu "Arduino TinyUSB"

config TINYUSB_VIDEO_STREAMING_BUFSIZE
int "VIDEO streaming endpoint size"
range 0 64
default 64
range 0 512
default 64 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
default 512 if IDF_TARGET_ESP32P4
depends on TINYUSB_VIDEO_ENABLED
help
VIDEO streaming endpoint size
@@ -219,20 +233,33 @@ menu "Arduino TinyUSB"

config TINYUSB_VENDOR_RX_BUFSIZE
int "VENDOR FIFO size of RX"
default 64
default 64 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
default 512 if IDF_TARGET_ESP32P4
depends on TINYUSB_VENDOR_ENABLED
help
VENDOR FIFO size of RX

config TINYUSB_VENDOR_TX_BUFSIZE
int "VENDOR FIFO size of TX"
default 64
default 64 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
default 512 if IDF_TARGET_ESP32P4
depends on TINYUSB_VENDOR_ENABLED
help
VENDOR FIFO size of TX

endmenu

menu "NCM driver"
depends on TINYUSB_ENABLED

config TINYUSB_NCM_ENABLED
bool "Enable USB NCM TinyUSB driver"
default y
help
Enable USB NCM TinyUSB driver.

endmenu

config TINYUSB_DEBUG_LEVEL
int "TinyUSB log level (0-3)"
default 0
18 changes: 17 additions & 1 deletion components/arduino_tinyusb/include/tusb_config.h
Original file line number Diff line number Diff line change
@@ -72,6 +72,10 @@ extern "C" {
# define CONFIG_TINYUSB_VENDOR_ENABLED 0
#endif

#ifndef CONFIG_TINYUSB_NCM_ENABLED
# define CONFIG_TINYUSB_NCM_ENABLED 0
#endif

/* */
/* COMMON CONFIGURATION */
/* */
@@ -96,15 +100,26 @@ extern "C" {
# define CFG_TUSB_MEM_ALIGN TU_ATTR_ALIGNED(4)
#endif

#if CONFIG_IDF_TARGET_ESP32P4
#define CFG_TUD_MAX_SPEED OPT_MODE_HIGH_SPEED
#else
#define CFG_TUD_MAX_SPEED OPT_MODE_FULL_SPEED
#endif

/* */
/* DRIVER CONFIGURATION */
/* */

#define CFG_TUD_MAINTASK_SIZE 4096
#define CFG_TUD_ENDOINT_SIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
#define CFG_TUD_ENDOINT0_SIZE 64

// Enabled Drivers
#define CFG_TUD_CDC CONFIG_TINYUSB_CDC_ENABLED
#ifdef CONFIG_TINYUSB_CDC_MAX_PORTS
#define CFG_TUD_CDC CONFIG_TINYUSB_CDC_MAX_PORTS
#else
#define CFG_TUD_CDC 0
#endif
#define CFG_TUD_MSC CONFIG_TINYUSB_MSC_ENABLED
#define CFG_TUD_HID CONFIG_TINYUSB_HID_ENABLED
#define CFG_TUD_MIDI CONFIG_TINYUSB_MIDI_ENABLED
@@ -113,6 +128,7 @@ extern "C" {
#define CFG_TUD_DFU_RUNTIME CONFIG_TINYUSB_DFU_RT_ENABLED
#define CFG_TUD_DFU CONFIG_TINYUSB_DFU_ENABLED
#define CFG_TUD_VENDOR CONFIG_TINYUSB_VENDOR_ENABLED
#define CFG_TUD_NCM CONFIG_TINYUSB_NCM_ENABLED

// CDC FIFO size of TX and RX
#define CFG_TUD_CDC_RX_BUFSIZE CONFIG_TINYUSB_CDC_RX_BUFSIZE
67 changes: 33 additions & 34 deletions patches/tinyusb_dcd_dwc2.diff → ...ts/arduino_tinyusb/patches/dcd_dwc2.patch
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
--- a/components/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dcd_dwc2.c 2024-06-10 22:10:55.000000000 +0300
+++ b/components/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dcd_dwc2.c 2024-06-10 22:20:01.000000000 +0300
@@ -186,6 +186,18 @@
return true;
}

--- a/components/arduino_tinyusb/src/dcd_dwc2.c 2024-10-02 12:17:40.000000000 +0300
+++ b/components/arduino_tinyusb/src/dcd_dwc2.c 2024-10-02 12:19:48.000000000 +0300
@@ -243,6 +243,17 @@
//--------------------------------------------------------------------
// Endpoint
//--------------------------------------------------------------------
+#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
+// Keep count of how many FIFOs are in use
+static uint8_t _allocated_fifos = 1; //FIFO0 is always in use
+
+// Will either return an unused FIFO number, or 0 if all are used.
+static uint8_t get_free_fifo(void)
+{
+static uint8_t get_free_fifo(void) {
+ if (_allocated_fifos < 5) return _allocated_fifos++;
+ return 0;
+}
+#endif
+
static void edpt_activate(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc) {
static void edpt_activate(uint8_t rhport, const tusb_desc_endpoint_t* p_endpoint_desc) {
dwc2_regs_t* dwc2 = DWC2_REG(rhport);
uint8_t const epnum = tu_edpt_number(p_endpoint_desc->bEndpointAddress);
@@ -205,7 +217,18 @@
dwc2->epout[epnum].doepctl = dxepctl;
dwc2->daintmsk |= TU_BIT(DAINTMSK_OEPM_Pos + epnum);
} else {
- dwc2->epin[epnum].diepctl = dxepctl | (epnum << DIEPCTL_TXFNUM_Pos);
const uint8_t epnum = tu_edpt_number(p_endpoint_desc->bEndpointAddress);
@@ -266,7 +277,18 @@
depctl.set_data0_iso_even = 1;
}
if (dir == TUSB_DIR_IN) {
- depctl.tx_fifo_num = epnum;
+ //depctl.tx_fifo_num = epnum;
+ uint8_t fifo_num = epnum;
+#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
+ // Special Case for EP5, which is used by CDC but not actually called by the driver
@@ -33,36 +33,35 @@
+ } else {
+ fifo_num = get_free_fifo();
+ }
+ TU_ASSERT(fifo_num != 0);
+#endif
+ dwc2->epin[epnum].diepctl = dxepctl | (fifo_num << DIEPCTL_TXFNUM_Pos);
dwc2->daintmsk |= (1 << (DAINTMSK_IEPM_Pos + epnum));
+ depctl.tx_fifo_num = fifo_num;
}

dwc2_dep_t* dep = &dwc2->ep[dir == TUSB_DIR_IN ? 0 : 1][epnum];
@@ -557,6 +579,10 @@
}
}
}
@@ -728,6 +751,10 @@
// reset allocated fifo IN
_allocated_fifo_words_tx = 16;

+#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
+ _allocated_fifos = 1;
+#endif
+
fifo_flush_tx(dwc2, 0x10); // all tx fifo
fifo_flush_rx(dwc2);
}
@@ -1096,6 +1123,9 @@
if (int_status & GINTSTS_USBRST) {
dfifo_flush_tx(dwc2, 0x10); // all tx fifo
dfifo_flush_rx(dwc2);

@@ -997,6 +1023,9 @@
if (gintsts & GINTSTS_USBRST) {
// USBRST is start of reset.
dwc2->gintsts = GINTSTS_USBRST;
+#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
+ _allocated_fifos = 1;
+#endif
bus_reset(rhport);
}

@@ -1127,7 +1157,11 @@

usbd_spin_lock(true);
handle_bus_reset(rhport);
@@ -1008,7 +1037,11 @@

if (int_status & GINTSTS_USBSUSP) {
if (gintsts & GINTSTS_USBSUSP) {
dwc2->gintsts = GINTSTS_USBSUSP;
- dcd_event_bus_signal(rhport, DCD_EVENT_SUSPEND, true);
+ //dcd_event_bus_signal(rhport, DCD_EVENT_SUSPEND, true);
@@ -72,8 +71,8 @@
+#endif
}

if (int_status & GINTSTS_WKUINT) {
@@ -1144,6 +1178,9 @@
if (gintsts & GINTSTS_WKUINT) {
@@ -1025,6 +1058,9 @@

if (otg_int & GOTGINT_SEDET) {
dcd_event_bus_signal(rhport, DCD_EVENT_UNPLUGGED, true);
Loading