diff options
| author | Zixun LI <[email protected]> | 2026-09-01 12:53:45 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-09-01 12:53:45 +0200 |
| commit | 762517e6c41bedba73df04bc3c2181d7e5fe1d5e (patch) | |
| tree | 01cae9f0ad8fb7b4c0b21b1f716b27818bbddc90 | |
| parent | f4697a0626ffa81617c457c93b64e3c3816c1af0 (diff) | |
| parent | 04a6ec80d94e13c70087c44dcf095d842302bafa (diff) | |
Fix DWC2 DMA data toggle mismatch in IN-transfers
| -rw-r--r-- | src/portable/synopsys/dwc2/hcd_dwc2.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/portable/synopsys/dwc2/hcd_dwc2.c b/src/portable/synopsys/dwc2/hcd_dwc2.c index 089b839ae..761627730 100644 --- a/src/portable/synopsys/dwc2/hcd_dwc2.c +++ b/src/portable/synopsys/dwc2/hcd_dwc2.c @@ -1129,6 +1129,10 @@ static bool handle_channel_in_dma(dwc2_regs_t* dwc2, uint8_t ch_id, uint32_t hci channel_send_in_token(dwc2, channel); } } else if (hcint & (HCINT_XFER_COMPLETE | HCINT_STALL | HCINT_BABBLE_ERR)) { + if (edpt->hcchar_bm.ep_num != 0 && (hcint & HCINT_XFER_COMPLETE)) { + edpt->next_pid = hctsiz.pid; // save pid (already toggled) + } + const uint16_t remain_bytes = (uint16_t) hctsiz.xfer_size; const uint16_t remain_packets = hctsiz.packet_count; const uint16_t actual_len = edpt->buflen - remain_bytes; |
