ricardgb commented on PR #19371:
URL: https://github.com/apache/nuttx/pull/19371#issuecomment-4917465310
Sure — here are before/after logs.
**Setup:** `raspberrypi-pico` (RP2040), Linux host. Built standalone
`CONFIG_NET_CDCECM` (and separately `CONFIG_NET_CDCNCM`). The rp2040 board
doesn't instantiate these classes by default, so I added a
`cdcecm_initialize()` / `cdcncm_initialize()` call in the board bringup purely
to exercise the driver (test scaffolding, not part of this PR). Relevant
detail: `rp2040_usbintr_busreset()` drops the D+ pull-up on every bus reset,
which is exactly what makes the missing re-connect fatal on this controller.
### CDC-ECM — without the fix (baseline)
After the board is flashed and reboots into NuttX, the device never
enumerates:
```
usb 3-1: USB disconnect, device number 55 # bootloader gone; board
reboots into NuttX
# ... and nothing further:
the CDC-ECM device never appears
```
```
host: no cdc_ether interface
host: lsusb | grep -i cdc -> (no CDC device)
```
### CDC-ECM — with the fix
```
usb 3-1: New USB device found, idVendor=0525, idProduct=a4a2, bcdDevice= 1.00
usb 3-1: Product: CDC/ECM Ethernet
usb 3-1: Manufacturer: NuttX
cdc_ether 3-1:1.0 usb0: register 'cdc_ether' at usb-0000:00:14.0-1, CDC
Ethernet Device, 02:00:00:11:22:33
```
```
$ ping -c 4 192.168.7.1
64 bytes from 192.168.7.1: icmp_seq=1 ttl=64 time=0.959 ms
64 bytes from 192.168.7.1: icmp_seq=2 ttl=64 time=0.550 ms
64 bytes from 192.168.7.1: icmp_seq=3 ttl=64 time=0.585 ms
64 bytes from 192.168.7.1: icmp_seq=4 ttl=64 time=0.535 ms
--- 192.168.7.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3061ms
rtt min/avg/max/mdev = 0.535/0.657/0.959/0.175 ms
```
### CDC-NCM — with the fix
Same one-liner in `cdcncm_disconnect()`. The device now enumerates and the
host binds `cdc_ncm` (it previously never attached at all):
```
usb 3-1: New USB device found, idVendor=0525, idProduct=a4a2, bcdDevice= 1.00
usb 3-1: Product: CDC/NCM Ethernet
usb 3-1: Manufacturer: NuttX
cdc_ncm 3-1:1.0: MAC-Address: 02:00:00:11:22:33
cdc_ncm 3-1:1.0 usb0: register 'cdc_ncm' at usb-0000:00:14.0-1, CDC NCM (NO
ZLP), 02:00:00:11:22:33
```
The NCM interface comes up `NO-CARRIER` due to the separate, pre-existing
interrupt-IN endpoint issue on this controller that I noted in the PR
description (out of scope here). The part this fix restores — enumeration and
driver binding — works.
---
*Disclosure: these logs, and the fix and its validation, were produced by an
AI agent (Claude Code, operated and directed by me) and reviewed by me before
posting.*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]