Commit 56f94bb
committed
dcd_ch58x: fix toggle, SETUP race, and bus reset handling
- Switch from AUTO_TOG to manual toggle for all endpoints to fix toggle mismatch after clear-stall causing bus resets
- Fix SETUP race condition: track ep0_completion_pending and setup_pending to avoid arming stale EP0 transfers
- Defer Set Address to ISR after status ZLP is ACK'd
- Improve bus reset: reset all EPs, clear pending state
- Fix EP4 DMA macro to correctly map to EP0 base (0x10)
- Move CH58X_UIS_TOG_OK to common section (used by both DCD/HCD)
- Add #ifndef guards for BOARD_TUD/TUH_RHPORT in board.h
- Track isochronous per direction: isochronous[ep][dir]
- NAK EP0 OUT on completion to prevent premature data acceptance1 parent a2ea022 commit 56f94bb
4 files changed
Lines changed: 131 additions & 86 deletions
File tree
- hw/bsp/ch58x/boards/yd-ch582m
- src/portable/wch
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 59 | | |
70 | 60 | | |
71 | | - | |
72 | | - | |
| 61 | + | |
| 62 | + | |
73 | 63 | | |
74 | 64 | | |
75 | 65 | | |
| |||
121 | 111 | | |
122 | 112 | | |
123 | 113 | | |
| 114 | + | |
124 | 115 | | |
125 | 116 | | |
126 | 117 | | |
| |||
147 | 138 | | |
148 | 139 | | |
149 | 140 | | |
150 | | - | |
| 141 | + | |
151 | 142 | | |
152 | 143 | | |
153 | 144 | | |
| |||
253 | 244 | | |
254 | 245 | | |
255 | 246 | | |
256 | | - | |
257 | 247 | | |
258 | 248 | | |
259 | 249 | | |
| |||
0 commit comments