<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinyusb.git/src, branch hil-add-ea4088qs</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/tinyusb.git/atom/src?h=hil-add-ea4088qs</id>
<link rel='self' href='http://cgit.235523.xyz/tinyusb.git/atom/src?h=hil-add-ea4088qs'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/'/>
<updated>2026-09-03T21:03:39Z</updated>
<entry>
<title>ohci: enumerate a device that was already attached at init</title>
<updated>2026-09-03T21:03:39Z</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2026-09-03T11:19:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=603689ea4a8f99e99244d3fb6dd9a1496f16fe69'/>
<id>urn:sha1:603689ea4a8f99e99244d3fb6dd9a1496f16fe69</id>
<content type='text'>
hcd_init() clears every pending interrupt flag before enabling its own set:

  OHCI_REG-&gt;interrupt_status = OHCI_REG-&gt;interrupt_status;

If a device is already connected at that point, that write drops the RHSC
which went with the connect, while the root hub keeps ConnectStatusChange
set. The device stays put, so no new edge follows and the attach is never
reported - the port sits at CCS=1, CSC=1, PES=0 forever.

Host-only builds got away with it because the connect is usually detected
after that clear. In a dual build the device stack initialises first and
enables the shared USB interrupt, which moves the detection into the window
that gets cleared, and the host then never sees the device.

Scan the root-hub ports once at the end of hcd_init and raise the attach
ourselves, clearing the stale change bit so the next RHSC does not report
the same device again.

Verified on ea4088_quickstart: dual/host_info_to_device_cdc now enumerates
on a plain reset (HIL test passes, "Device 1: ID 1a86:8010 SN 7FD88F0604B5"),
host/device_info still enumerates, and device/cdc_msc is unaffected.
host/device_info also builds for lpcxpresso55s69, lpcxpresso1769 and mcb1800.
</content>
</entry>
<entry>
<title>Merge pull request #3799 from hathach/codex/dfu-buffer-fix</title>
<updated>2026-09-03T13:17:07Z</updated>
<author>
<name>Zixun LI</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-03T13:17:07Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=1adfb1c74ff3cc6618a9b37e76ab2feadc09f8e8'/>
<id>urn:sha1:1adfb1c74ff3cc6618a9b37e76ab2feadc09f8e8</id>
<content type='text'>
device/dfu: fix transfer buffer overwrite issue</content>
</entry>
<entry>
<title>Merge pull request #3808 from hathach/cdc_persistent</title>
<updated>2026-09-03T13:16:37Z</updated>
<author>
<name>Zixun LI</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-03T13:16:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=67dedc37ef9f0c232cba1edbb6bc007f610961f0'/>
<id>urn:sha1:67dedc37ef9f0c232cba1edbb6bc007f610961f0</id>
<content type='text'>
device/cdc: avoid flushing tx buffer on connection</content>
</entry>
<entry>
<title>fix(dwc2): bound periodic intervals to HFNUM range</title>
<updated>2026-09-02T14:18:44Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-02T14:18:44Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=e461c6f9c139a0012ef01d53db1aab1c68789b56'/>
<id>urn:sha1:e461c6f9c139a0012ef01d53db1aab1c68789b56</id>
<content type='text'>
HFNUM retains only 16384 host-frame positions, while valid periodic endpoint intervals can be longer. Resubmission after the counter wraps can therefore alias the elapsed time and skip the next established service phase.

Cap the host-selected interval to one HFNUM cycle using the root-port frame unit. USB permits a shorter host-provided period, and the bounded interval keeps phase calculation unambiguous for native and split endpoints.
</content>
</entry>
<entry>
<title>fix(dwc2): defer periodic DMA abort cleanup until halt</title>
<updated>2026-09-02T14:14:26Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-02T01:54:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=14060950b487f931d959699c42b0875c96ca6a01'/>
<id>urn:sha1:14060950b487f931d959699c42b0875c96ca6a01</id>
<content type='text'>
Periodic DMA channels use their natural service-boundary halt instead of a software CHDIS request. Keep the endpoint busy after an abort so a replacement transfer cannot reuse its state or buffer while the channel remains active.

When HCINT.HALTED arrives, release the channel without reporting completion for the aborted transfer. If endpoint closure is also pending, release the endpoint from the same halt path.
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'origin/master' into agent/fix-dwc2-host-fifo-allocation</title>
<updated>2026-09-02T13:21:41Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-01T15:44:58Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=51761d2dfdf2036395b0b6ada6fdde213f97416f'/>
<id>urn:sha1:51761d2dfdf2036395b0b6ada6fdde213f97416f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>USBH: fail enumeration cleanly after disconnect</title>
<updated>2026-09-02T13:21:41Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-01T15:24:13Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=a52b5a0c25d2cfea286d67eb3d9d8891a9b69e8f'/>
<id>urn:sha1:a52b5a0c25d2cfea286d67eb3d9d8891a9b69e8f</id>
<content type='text'>
A disconnect can close endpoint zero after an enumeration control stage completes but before USBH submits the next stage or request. HCD submission then legitimately returns false; treating that result as an invariant violation asserts during rapid replug and can leave enumeration unfinished.

Complete an in-progress control request as failed when its DATA or status stage cannot be submitted. Propagate submission failures from every asynchronous enumeration continuation and finish enumeration through the normal failure cleanup path. This keeps controller teardown races out of assertions without fabricating a successful transfer.

Validated by interrupting enumeration during rapid STM32U5A5 replug tests with DWC2 DMA and slave modes.
</content>
</entry>
<entry>
<title>DWC2 host: clean up channels on disconnect</title>
<updated>2026-09-02T13:21:41Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-01T05:06:47Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=3a1dc0dc1f57d45ed75aa9e176425901270e982e'/>
<id>urn:sha1:3a1dc0dc1f57d45ed75aa9e176425901270e982e</id>
<content type='text'>
A root-port disconnect invalidates every active transfer. Retire channel and FIFO interrupt sources plus host-channel state in the disconnect ISR using the Linux DWC2 cleanup model instead of reinitializing the core and PHY, which can sleep on STM32 HS PHYs.

Flush posted slave requests, request halts for enabled channels, clear channel interrupt and software ownership, and keep endpoint records closing until USBH processes the remove event. Reject transfer submissions to closing endpoints, preserve fast-replug notification, and re-enable the global host-channel interrupt when a new channel is initialized.
</content>
</entry>
<entry>
<title>fix(dwc2): queue initial slave OUT packet immediately</title>
<updated>2026-09-02T13:21:41Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-01T02:04:01Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=4fb18bdc2bed03f7baa66bd4a550e5e6623d09f8'/>
<id>urn:sha1:4fb18bdc2bed03f7baa66bd4a550e5e6623d09f8</id>
<content type='text'>
In slave mode, channel_xfer_start() enabled an OUT channel but left every FIFO write to a later PTXFEMP interrupt. DWC2 creates the request-queue entry only when the packet's final FIFO word is written, so unrelated interrupt work could consume the selected service frame before the transfer was actually queued.

Factor FIFO writes into a capacity-checked helper and write the initial packet while the channel-enable operation is still protected from DWC2 interrupts. Keep FIFO-empty interrupts only for data that does not fit immediately. The protected section never waits for FIFO or request-queue space.

When initial periodic OUT submission is too close to the frame boundary, release the unused channel and defer the still-pending endpoint to the next SOF. Internal retries bypass this initial boundary guard.

A hardware trace showed HCCHAR enabled for frame 0x0378 while the packet's final FIFO word was delayed until frame 0x03ae. The complete five-commit fix set passed 600 seconds in every O0/O2 and slave/DMA mode.

Signed-off-by: HiFiPHile &lt;admin@hifiphile.com&gt;
</content>
</entry>
<entry>
<title>fix(dwc2): enable periodic channels in the selected frame</title>
<updated>2026-09-02T08:50:03Z</updated>
<author>
<name>HiFiPHile</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-09-01T02:02:54Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/tinyusb.git/commit/?id=3a81af3de30ee999b543af4e52408f3a6b9b5fdf'/>
<id>urn:sha1:3a81af3de30ee999b543af4e52408f3a6b9b5fdf</id>
<content type='text'>
Periodic IN and DMA-backed transfers selected ODDFRM before waiting for request-queue space. A DWC2 interrupt could also run between reading HFNUM and writing HCCHAR.CHENA, allowing the selected frame to pass while the transfer still appeared active.

Wait for request-queue capacity with controller interrupts enabled, then mask only GAHBCFG.GINT while sampling HFNUM and enabling a new periodic channel. Record the periodic phase from that same HFNUM sample so a boundary after channel enable cannot shift later interval calculations. The bounded critical section contains no queue wait, callback, disable, or allocation loop. Retries that already selected their frame bypass the new selection step.

Also clear a retained HCCHAR.CHDIS before every channel enable. A halted channel can otherwise be re-enabled as CHENA|CHDIS and wait for a terminal interrupt that never arrives.

Hardware traces captured periodic IN selections at frames 0x3303 and 0x3266 but activation only after 0x330c and 0x3273, respectively.
</content>
</entry>
</feed>
