You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HIL: ch32v307v_r1_1v0-usbhs net_lwip_webserver HTTP connect times out #4477
ch32v307v_r1_1v0-usbhs fails device/net_lwip_webserver in HIL: the USB network interface enumerates and moves into the test namespace, then the first HTTP connect to 192.168.7.1 times out. The -usbfs variant of the same board passes.
ch32v307v_r1_1v0-usbhs device/net_lwip_webserver Failed: USB network test failed (rc=1): USB serial DE6B3E263B3857CAFFFFFFFF: interface usb1 (ifindex 118) at 19-1.7
... net_test.py check_http: TimeoutError: timed out
Same job, same board: ch32v307v_r1_1v0-usbfs device/net_lwip_webserver OK ... interface enx0202846a9600 (ifindex 123) at 19-1.4 | HTTP: 6 responses verified, 7425 bytes | iperf: 3.7 Mbit/s host to device.
The interface move and addressing succeed (hil_root netns), so the harness side is the same as for the passing boards; the data path on the CH32V307 USBHS port (dcd_ch32_usbhs with NCM) is the suspect.
Remaining work
Reproduce on ci.lan under a board hold: flash the usbhs build, check for ARP/ICMP from 192.168.7.2 in the namespace, usbmon on the bulk endpoints.
Find whether OUT NTBs reach lwIP or IN frames never leave the device; fix and drop the CI acceptance.
Not diagnosed in #3918: the PR changed only the test harness, and the failure was accepted there to land it.
What it fixes: I first reproduced the symptom on a Windows 10 host with a nanoch32v305, which uses the same CH32V30x USBHS controller and dcd_ch32_usbhs.c. That failure was a real driver bug: the SUSPEND interrupt fires on both suspend and resume, and the DCD reported both as suspend. After one host suspend, tud_ready() stayed false, and the example dropped every outgoing frame. wch/usbhs: report resume when the SUSPEND interrupt fires on bus resume #4493 fixes it.
I ran the same V305 on the tusb rig with Linux cdc_ncm, the interface in its own netns at 192.168.7.2 as net_test.py sets it up. Ping works, and HTTP returns all 7425 B of the asset set over 3 rounds. That holds with and without #4493. Linux never suspended the device while the interface was open (runtime_suspended_time=0), so the suspend bug can't be the cause on ci.lan either.
DMA address range: probably not the cause
ch32v307v_r1_1v0 links with 64K RAM and nanoch32v305 with 32K. I compared the two net_lwip_webserver builds (MinSizeRel), and every buffer USBHS DMA uses sits at the same address on both:
symbol
address
ncm_epbuf (NTB OUT/IN and notification)
0x20004c90 (0x1810 B)
ep0_buffer
0x20006568
end of .bss
0x20006860
Only _estack moves (0x20010000 vs 0x20008000). No USB transfer comes from the stack: NCM uses only ncm_epbuf and NULL for ZLPs, and EP0 always copies through ep0_buffer. So a DMA range limit above 32K wouldn't touch this example. These are local builds. I couldn't get the CI artifact, because the API returned 502.
What's left
What differs from my setup:
the CH32V307 board itself (clock, PHY, option-byte RAM split);
the ci.lan host and hub (19-1.7);
usb1 naming: the failing interface stays usb1, while the passing usbfs one is renamed to enx…. Possibly only timing.
With a hold on the ci.lan board, the next checks are:
tcpdump -i usb1 in the namespace during check_http: does an ARP reply ever come back?
usbmon on the bulk endpoints: do OUT NTBs get ACKed, and does any IN NTB return?
On the target over WCH-Link with gdb: _usbd_dev.suspended, ncm_interface.xmit_sequence and lwip_stats. These separate "OUT never reaches lwIP" from "IN never leaves the device".
Activity
wch/usbhs: report resume when the SUSPEND interrupt fires on bus resume
HiFiPhile commentedon Nov 12, 2026
I tried to reproduce this away from ci.lan. Nothing outside it fails, so the cause is probably the CI board or the rig.
#4493 fixes a different bug
dcd_ch32_usbhs.c. That failure was a real driver bug: the SUSPEND interrupt fires on both suspend and resume, and the DCD reported both as suspend. After one host suspend,tud_ready()stayed false, and the example dropped every outgoing frame. wch/usbhs: report resume when the SUSPEND interrupt fires on bus resume #4493 fixes it.ch32v307v_r1_1v0-usbhsstill failsnet_lwip_webserverthe same way. Its other cells pass, including usbtest 30/30.Linux host: the V305 passes
I ran the same V305 on the tusb rig with Linux
cdc_ncm, the interface in its own netns at 192.168.7.2 asnet_test.pysets it up. Ping works, and HTTP returns all 7425 B of the asset set over 3 rounds. That holds with and without #4493. Linux never suspended the device while the interface was open (runtime_suspended_time=0), so the suspend bug can't be the cause on ci.lan either.DMA address range: probably not the cause
ch32v307v_r1_1v0links with 64K RAM andnanoch32v305with 32K. I compared the twonet_lwip_webserverbuilds (MinSizeRel), and every buffer USBHS DMA uses sits at the same address on both:ncm_epbuf(NTB OUT/IN and notification)ep0_buffer.bssOnly
_estackmoves (0x20010000 vs 0x20008000). No USB transfer comes from the stack: NCM uses onlyncm_epbufand NULL for ZLPs, and EP0 always copies throughep0_buffer. So a DMA range limit above 32K wouldn't touch this example. These are local builds. I couldn't get the CI artifact, because the API returned 502.What's left
What differs from my setup:
19-1.7);usb1naming: the failing interface staysusb1, while the passing usbfs one is renamed toenx…. Possibly only timing.With a hold on the ci.lan board, the next checks are:
tcpdump -i usb1in the namespace duringcheck_http: does an ARP reply ever come back?_usbd_dev.suspended,ncm_interface.xmit_sequenceandlwip_stats. These separate "OUT never reaches lwIP" from "IN never leaves the device".TEST ONLY: build ch32v307v_r1_1v0 like nanoch32v305 (to be dropped)