<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinyusb.git/src/portable/synopsys/dwc2/dcd_dwc2.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/tinyusb.git/atom/src/portable/synopsys/dwc2/dcd_dwc2.c?h=master</id>
<link rel='self' href='http://cgit.235523.xyz/tinyusb.git/atom/src/portable/synopsys/dwc2/dcd_dwc2.c?h=master'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/'/>
<updated>2026-07-14T19:31:14Z</updated>
<entry>
<title>dwc2: fix EP0 OUT dcache invalidate range; run usbtest on espressif s3/p4 and mimxrt1015</title>
<updated>2026-07-14T19:31:14Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-14T19:31:14Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=59f02a1c4c18d7e43a1bd6aaad4b50e71931c9ff'/>
<id>urn:sha1:59f02a1c4c18d7e43a1bd6aaad4b50e71931c9ff</id>
<content type='text'>
edpt_schedule_packets() advanced xfer-&gt;buffer past each armed EP0
chunk, so the OUT-complete handler invalidated the cache at the
ADVANCED pointer: one line past the received data. The CPU then read
stale cached bytes instead of the DMA'd packet, and the misplaced
invalidate discarded a dirty line of whatever variable follows the
buffer - random neighbor corruption on every control-OUT data stage.
Found by usbtest ctrl_out (cases 14/21) on espressif_p4_function_ev
with DMA enabled, the first DWC2 target combining buffer DMA with a
data cache: usbd control state wedged after the first control write
(every later request stalled), and one build layout panicked in the
usbd memcpy with a wild pointer.

Rework the EP0 chunk bookkeeping so xfer-&gt;buffer always points at the
un-consumed position: the arm no longer advances it; instead the EP0
re-arm paths advance past each completed (full) chunk, invalidating it
first on the OUT side. The final OUT completion invalidates exactly
the received bytes of its last chunk, taken from DOEPDMA ("incremented
on every AHB transaction", databook 7.1.83 - the same semantics the
SETUP path relies on) before dma_setup_prepare() re-targets it. EP0
chunking state (ep0_pending) is now also dropped on bus reset and on
a new SETUP, so a stale latched completion can no longer re-arm EP0
DMA from dead state. No behavior change for targets without dcache.

While root-causing, the FIFO layout was cross-checked against the
DWC2 databook/programming guide v4.20a: the existing GDFIFOCFG
programming (EPInfoBaseAddr = otg_dfifo_depth - 2*ep_count, one SPRAM
word per endpoint direction for buffer DMA) is conformant and needs
no change; the P4 HS instance's reset GDFIFOCFG (0x03800400) merely
reflects a scatter/gather-sized EP_LOC_CNT of 128 that buffer DMA
does not need.

With the fix in place, enable the usbtest battery on the espressif
fleet: tools/build.py allowlists device/usbtest (a plain IDF component
like board_test/video_capture) and both espressif boards' only-lists
gain device/usbtest. Also re-enable device/usbtest on mimxrt1015_evk:
its skip predated the dcd_ci_hs stale-ACTIVE-overlay fix (already on
this branch), which cured the battery that previously killed the
uPD720201 host controller twice (2026-07-11 ROM fw, 2026-07-13 case 27
on fw 2.0.2.6); rig-validated 30/30 three consecutive runs.

Validated on rig (all 30/30): espressif_p4_function_ev(-DMA) (was
22/30 under DMA), espressif_s3_devkitm(-DMA), stm32f723disco(-DMA),
mimxrt1015_evk; p4/s3 slave-mode unaffected (DMA-only code path);
compile-checked stm32h743nucleo +TUD DMA, stm32f407disco,
stm32l476disco (device ports currently on the dead hub).

Co-Authored-By: Claude Fable 5 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_017TQZrFfU3K4Y198aLsUpBC
</content>
</entry>
<entry>
<title>license: use SPDX identifiers for src/ headers (#3749)</title>
<updated>2026-07-02T14:55:45Z</updated>
<author>
<name>Ha Thach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-07-02T14:55:45Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=7a4111b96ef6279e75579f9a18443834f6a0871d'/>
<id>urn:sha1:7a4111b96ef6279e75579f9a18443834f6a0871d</id>
<content type='text'>
* license: use SPDX identifiers for src/ headers

Replace the full ~20-line MIT license boilerplate on every src/ file with a
two-line SPDX tag (SPDX-FileCopyrightText + SPDX-License-Identifier), following
the REUSE convention used by CircuitPython and the Linux kernel. Removes ~3500
lines of duplicated boilerplate.</content>
</entry>
<entry>
<title>dwc2: cleanup setup_packet pointer cast (review feedback)</title>
<updated>2026-06-04T13:46:49Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-06-04T13:46:49Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=a900ea93db686cacde5e595dc09fdfeaa334d556'/>
<id>urn:sha1:a900ea93db686cacde5e595dc09fdfeaa334d556</id>
<content type='text'>
Cast DOEPDMA0 through uintptr_t and use sizeof(tusb_control_request_t)
instead of the magic constant 8, matching project convention. Add a
reference to Programming Guide v4.20a 9.1.2.1 for the DOEPDMAn-8 rule.

Addresses Copilot review comment; no functional change.

Co-Authored-By: Claude Opus 4.8 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Update setup buffer size definition based on DMA configuration</title>
<updated>2026-06-04T10:55:44Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-06-04T10:55:44Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=b5e080732e67a52afefa6966ca33474c91a53d0c'/>
<id>urn:sha1:b5e080732e67a52afefa6966ca33474c91a53d0c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merge branch 'master' into dwc2_postfix</title>
<updated>2026-06-04T08:31:45Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-06-04T08:31:45Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=0393a5eaa1fc9ef33cbfd847c924cb83d82696f3'/>
<id>urn:sha1:0393a5eaa1fc9ef33cbfd847c924cb83d82696f3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>dwc2: address Copilot review (comment grammar/typo, tinyusb.json f407 dedup)</title>
<updated>2026-06-03T16:41:19Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-06-03T16:41:19Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=1f6236ae0788e37bb833e4b018faf10fb691bbdd'/>
<id>urn:sha1:1f6236ae0788e37bb833e4b018faf10fb691bbdd</id>
<content type='text'>
Co-Authored-By: Claude Opus 4.8 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>dwc2: remove investigation debug logging</title>
<updated>2026-06-03T16:18:28Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-06-03T16:18:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=6b89aea9de07f537611ddffca1183a3a958a7ee4'/>
<id>urn:sha1:6b89aea9de07f537611ddffca1183a3a958a7ee4</id>
<content type='text'>
Co-Authored-By: Claude Opus 4.8 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>dwc2: submit setup packet on SETUP_DONE and drop spurious EP0 RX_COMPLETE on core v3.10a (STM32L476)</title>
<updated>2026-06-03T14:44:19Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-06-03T14:44:19Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=73af6494cd5defc296b91da80e2f59b8af4efa70'/>
<id>urn:sha1:73af6494cd5defc296b91da80e2f59b8af4efa70</id>
<content type='text'>
  DWC2 core rev 3.10a pushes an extra EP0 RX_COMPLETE (RXFLVL PKTSTS 0x3)
  that is not a real OUT data completion, in two cases flagged on DOEPINT:
    - STPKTRX  (Setup Packet Received): between SETUP_RX and SETUP_DONE
    - STSPHSRX (Status Phase Received, control write): after the OUT data
      stage when the host starts the IN status phase
</content>
</entry>
<entry>
<title>dcd/dwc2: fix back-to-back SETUP reception in DMA mode</title>
<updated>2026-06-02T20:59:45Z</updated>
<author>
<name>HiFiPhile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-06-02T20:38:57Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=cc979da5163d0d407e27d90411a6d4b1a0092779'/>
<id>urn:sha1:cc979da5163d0d407e27d90411a6d4b1a0092779</id>
<content type='text'>
Signed-off-by: HiFiPhile &lt;admin@hifiphile.com&gt;
</content>
</entry>
<entry>
<title>dwc2: process IN EP before OUT</title>
<updated>2026-05-29T09:42:47Z</updated>
<author>
<name>HiFiPhile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-05-29T09:42:47Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=b4e7c25c1b57a69e4c04e41d0f2203abf0d8d358'/>
<id>urn:sha1:b4e7c25c1b57a69e4c04e41d0f2203abf0d8d358</id>
<content type='text'>
To avoid STATUS IN completion of previous control transfer treated as next DATA IN  when IRQ latency is high.

Signed-off-by: HiFiPhile &lt;admin@hifiphile.com&gt;
</content>
</entry>
</feed>
