LicheeRV Nano RNDIS interface not registering on Windows 10/11 #96
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
maxpeterkaya/LicheeRV-Nano-Build#96
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Less of an issue and more of a currently documented fact - after enabling the RNDIS gadget, Windows will not automatically install the correct RNDIS driver and enable the interface - you have to manually set the driver per instructions here: https://wiki.sipeed.com/hardware/en/lichee/RV_Nano/5_peripheral.html#USB-RNDIS-Network-Port
However if I change the compatible class/subclass/protocol to E0/01/03 respectively then this "just works" on windows - no need to explicitly override the driver, Windows auto-detects and installs the driver by itself.
I was able to make this change by adding the three additional lines to run_usb.sh immediately after Label/data is set:
https://github.com/sipeed/LicheeRV-Nano-Build/blob/main/ramdisk/rootfs/common_uclibc/etc/run_usb.sh#L146
I have tested this change on Windows 11 24H2 and Ubuntu 22.04 and the gadget registers correctly.
I have not tested this on macOS or other linux and windows versions, but I have reasonable belief that it should work everywhere.
So open questions:
Just create /boot/usb.rndis or /boot/usb/ncm and reboot, https://github.com/sipeed/LicheeRV-Nano-Build/blob/main/buildroot/board/cvitek/SG200X/overlay/etc/init.d/S08usbdev this script will do all for you, >=win11 use NCM, <win11 use RNDIS, no futher manually operation you need to do(the documentation out of date)
Oh that approach is much nicer - it both has the correct defaults and has an easier way to customize - thank you @Neutree
I began debugging this a while ago and went back to check that the relevant files (run_usb.sh hadn't changed) but didn't bother to check that there wasn't a whole different way of initializing the USB gadget that fixes my issue.
Following along with the same approach in S08usbdev can you support setting host_addr and dev_addr as well?
The equivalent lines I used in run_usb.sh are:
This becomes really important when plugging the USB gadget into another modern linux machine - if the addresses are left to be randomly generated on each boot, then the interface name also changes on the computer where the gadget is plugged into.
The usual approach of setting g_ether dev_addr and host_addr module properties (either via kernel cmdline or modprobe.d) don't seem to work - I guess because g_ether is compiled in rather than loaded as a module? But setting it via configfs before gadget initialization does work great.
https://github.com/sipeed/LicheeRV-Nano-Build/blob/main/buildroot/board/cvitek/SG200X/overlay/etc/init.d/S30gadget_nic
Maybe I'm misreading above, but doesn't
/boot/usb.rndis.macand/boot/usb.ncm.macset the MAC address of the usb0 interface as viewed by the LicheeRV Nano linux instance?How would I set the MAC address of the rndis/ncm device as viewed by the the machine I'm plugging my LicheeRV into? Or are they always the same MAC address with above init script?