USB Host/Device selection for Core1106
-
I'm designing a PCB for Core1106. I need the USB to be in Host mode when I have a USB camera attached and in Device mode when I flash the board or use ADB. Luckfox Pico Pi has a physical switch to select Host or Device Mode. However I don't understand from the provided schematic how RV1106 SoC selects the correct USB mode. Usually there's a USB_ID signal for USB OTG that decides which USB mode to use but there's no such signal in the schematic so there must be some kind of other hardware condition that is used but how?
Hello, the method to switch USB modes on the Luckfox Pico Pi is implemented by modifying the kernel device tree directly via luckfox-config. The DIP switch only changes the physical connection interface — the working mode still needs to be set manually.
Since the RV1106 does not have an OTG_ID pin, it is not possible to achieve the functionality you need purely through the driver. A workaround is to use a regular GPIO as a substitute for the OTG_ID pin to detect whether the connected device is a host or a peripheral. Based on that, you can set the mode by writing peripheral or host to /sys/devices/platform/ff3e0000.usb2-phy/otg_mode (make sure the device tree sets dr_mode="otg").
Since the RV1106 does not have an OTG_ID pin, it is not possible to achieve the functionality you need purely through the driver. A workaround is to use a regular GPIO as a substitute for the OTG_ID pin to detect whether the connected device is a host or a peripheral. Based on that, you can set the mode by writing peripheral or host to /sys/devices/platform/ff3e0000.usb2-phy/otg_mode (make sure the device tree sets dr_mode="otg").
Thank you.