I'm using OpenWRT on some HLK-7688A modules from Hi-Link.
They are working great. I'm not using them as a router, but as a generic embedded linux module with wifi and ethernet.
The module has a USB port which I am not using at the moment.
I would like to use the USB port as a CDC (Serial) device - but I'm not sure what to select / configure in the build to make this happen.
In "menuconfig" I see kenrnel modules for USB support, and I see "kmod-usb-serial" but I think that it to allow the kernel to detect and use Serial devices plugged into the port, rather than making the port a serial device.
Can anyone advise me on how to make this unused USB port become a CDC Device?
Thanks in advance!
That's not how it works. A USB port only runs as USB, that is all the hardware is capable of. You would need a serial converter plugged into it, and a driver for that converter.
To do what you want here you need to convert the port as USB guest device, and then you can use "usb gadgets" type drivers like CDC or virtual ethernet or whatever.
USB ports on devices that support this feature can be switched to "guest mode" or "host mode" with a pull up resistor or a bootloader setting.
Ask Hilink about documentation to reconfigure that port.