use linux usb gadget access board
many linux device remove serial port pin in production.
you can add gadget on bootup to access board.
usb gadget serial port
linux kernel support console on usb gadget serial port (ttyGSX)
kernel config example (rpi0):
CONFIG_USB_OTG=yCONFIG_USB_DWC2=yCONFIG_USB_DWC2_PERIPHERAL=y # default use gadget modeCONFIG_USB_GADGET=yCONFIG_USB_G_SERIAL=y # compile gadget serial in kernelCONFIG_U_SERIAL_CONSOLE=y # allow console use usb gadget serial port
then append kernel argument:
console=ttyGS0,115200
you may be need change devicetree to enable dwc2
config.txt:
dtoverlay=dwc2
then bootup board.
you will get a serial port device ’/dev/ttyACMX’ on your computer:
dmesg:
usb 3-1: USB disconnect, device number 7usb 3-1: new high-speed USB device number 8 using xhci_hcdusb 3-1: New USB device found, idVendor=0525, idProduct=a4a7, bcdDevice= 5.10usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0usb 3-1: Product: Gadget Serial v2.4usb 3-1: Manufacturer: Linux 5.10.92 with 20980000.usbcdc_acm 3-1:2.0: ttyACM0: USB ACM deviceusbcore: registered new interface driver cdc_acmcdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
connect it, you will see kernel boot log.
you can also run ’getty’ on serial port.
usb ethernet
many GNU/Linux on android phone use this method.
kernel config example (rpi0):
TODO