Skip to content

ESP32 Arduino v3.0 libs from ESP-IDF v5.1 #230

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

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b4ae662
revert Matter for 3.0.x (#229)
SuGlider Oct 2, 2024
b80dc0e
Merge branch 'master' into release/v5.1
me-no-dev Oct 2, 2024
40fb05e
Switch target branch for v5.1 pull requests
me-no-dev Oct 2, 2024
c2bce18
Merge branch 'master' into release/v5.1
me-no-dev Oct 10, 2024
793a36b
Update tinyusb dcd_dwc2
me-no-dev Oct 10, 2024
802f843
Enable esp-dl only for 5.1 branch
me-no-dev Oct 10, 2024
7b71a51
Update dcd_dwc2.c
me-no-dev Oct 15, 2024
769c168
Add define to signify that prebuilt libs are used
me-no-dev Oct 22, 2024
fe90d5d
fix(docker): Add docker tag to run scripts in 5.1 branch (#235)
lucasssvaz Oct 31, 2024
8d84501
Merge branch 'master' into release/v5.1
me-no-dev Nov 4, 2024
37f0bec
fix(zigbee): Unlink the zigbee libs (#242)
P-R-O-C-H-Y Nov 6, 2024
1684457
fix(): Move mkdir to top as its already used
P-R-O-C-H-Y Nov 6, 2024
eda5d26
Update TinyUSB DCD Source
me-no-dev Nov 12, 2024
7009b7d
Add missing compile source from TinyUSB
me-no-dev Nov 12, 2024
88f4a6f
Fix path to TinyUSB dwc2_common.c
me-no-dev Nov 12, 2024
095e3ce
Merge branch 'master' into release/v5.1
me-no-dev Nov 18, 2024
b1ed160
Update TinyUSB DCD
me-no-dev Nov 18, 2024
4aaf14c
Merge branch 'master' into release/v5.1
me-no-dev Nov 23, 2024
086e375
Update TinyUSB DCD
me-no-dev Nov 25, 2024
6a7dcd1
Update dcd_dwc2.c
me-no-dev Nov 25, 2024
9f8ee18
remove PIO from build.sh
SuGlider Nov 29, 2024
8a016b4
revert change - Remove PIO from build.sh
SuGlider Nov 29, 2024
d774edd
Update dcd_dwc2.c
me-no-dev Dec 10, 2024
0fd5cbc
Merge branch 'master' into release/v5.1
me-no-dev Dec 10, 2024
9bd1997
Update dcd_dwc2.c
me-no-dev Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,4 @@ add_custom_command(
)
add_custom_target(mem-variant DEPENDS "mem_variant")

##################
### ESP Matter ###
##################
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(COMPILE_DEFINITIONS "-DESP32_ARDUINO_LIB_BUILDER" APPEND)
3 changes: 2 additions & 1 deletion components/arduino_tinyusb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ if(CONFIG_TINYUSB_ENABLED)
# espressif:
"${COMPONENT_DIR}/src/dcd_dwc2.c"
# tusb:
#"{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"
Expand Down
43 changes: 22 additions & 21 deletions components/arduino_tinyusb/patches/dcd_dwc2.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- 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
@@ -316,6 +316,16 @@
@@ -243,6 +243,17 @@
//--------------------------------------------------------------------
// Endpoint
//--------------------------------------------------------------------
Expand All @@ -14,14 +14,16 @@
+ 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);
@@ -336,7 +346,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.bm.set_data0_iso_even = 1;
}
if (dir == TUSB_DIR_IN) {
- depctl.bm.tx_fifo_num = epnum;
+ //depctl.bm.tx_fifo_num = epnum;
+ uint8_t fifo_num = epnum;
+#if defined(TUP_USBIP_DWC2_ESP32)
+ // Special Case for EP5, which is used by CDC but not actually called by the driver
Expand All @@ -31,14 +33,13 @@
+ } else {
+ fifo_num = get_free_fifo();
+ }
+ //TU_ASSERT(fifo_num != 0);
+#endif
+ dwc2->epin[epnum].diepctl = dxepctl | (fifo_num << DIEPCTL_TXFNUM_Pos);
dwc2->daintmsk |= TU_BIT(DAINTMSK_IEPM_Pos + epnum);
+ depctl.bm.tx_fifo_num = fifo_num;
}
}
@@ -850,6 +871,10 @@
xfer_status[n][TUSB_DIR_IN].max_size = 0;

dwc2_dep_t* dep = &dwc2->ep[dir == TUSB_DIR_IN ? 0 : 1][epnum];
@@ -557,6 +579,10 @@
}
}

+#if defined(TUP_USBIP_DWC2_ESP32)
Expand All @@ -48,19 +49,19 @@
dfifo_flush_tx(dwc2, 0x10); // all tx fifo
dfifo_flush_rx(dwc2);

@@ -1204,6 +1229,9 @@
if (int_status & GINTSTS_USBRST) {
@@ -997,6 +1023,9 @@
if (gintsts & GINTSTS_USBRST) {
// USBRST is start of reset.
dwc2->gintsts = GINTSTS_USBRST;
+#if defined(TUP_USBIP_DWC2_ESP32)
+ _allocated_fifos = 1;
+#endif
bus_reset(rhport);
handle_bus_reset(rhport);
}

@@ -1235,7 +1263,11 @@
@@ -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);
Expand All @@ -70,8 +71,8 @@
+#endif
}

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

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