Jump to content

Netraam31

Members
  • Posts

    11
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Netraam31 reacted to jock in CSC Armbian for RK3318/RK3328 TV box boards   
    @Netraam31 I did a quick check on a board with rk3328 (not rk3318, but should be the same) and you can use both the USB2 OTG port or the USB3 port as peripheral.
    in the device tree the device usb@ff580000 is the USB2 OTG port controller and usb@ff600000 is the USB3 port controller.
     
    I quickly tried ethernet gadget to check if it works. This command loads the USB ethernet gadget module. which is a bit of "deprecated" in favor of configfs, but it is handy for tests (run it with the USB cables connected):
    modprobe g_ether iSerialNumber=0x00000001  
    Then a device usb0 should spawn on both the machines, which is nothing more and nothing less than a regular network interface. You have to give an address to both the endpoints and then you should be able to ping and exchange data.
     
    The result is that, at the current state of the kernel 6.1 I have right now (but 6.6 is exactly the same, since nothing changed), the USB 3.0 port is working plenty well, instead the USB 2.0 port is suffering the same problems experienced for rk322x, which disconnection and system freeze.
     
    Things seems to have changed with kernel 6.8, where also the USB 2.0 ports seems to work, thanks to the upstreamed fix for clock gating. You should be able to upgrade to kernel 6.8 installing the linux-image-rockchip64-edge package or, more appropriately, via armbian-config.
     
    Don't forget to put kernel and dtb packages in hold if you modify them manually, otherwise updates will overwrite your modifications!
     
     
     
  2. Like
    Netraam31 reacted to jock in CSC Armbian for RK3318/RK3328 TV box boards   
    @Netraam31 hello! You're in the right direction, dr_mode="otg" simply can't work without a micro/typec usb connector. The main feature of the OTG port is the capability to switch on the fly in host or peripheral mode, but to do that a fifth pin in required. Regular USB-A ports have only 4 pins, so when you get them you surely cannot exploit the OTG feature.
    The USB port is still called OTG because it is "dual role" (host vs. peripheral), but simply cannot switch automatically, hence you have to change it in the device tree.
     
    Finally what is true for the rk322x is true also for rk3318: during my tests the peripheral mode was not behaving correctly without disabling the clock gating and adjusting the core reset timing. The clock gating issue has been fixed in kernel 6.8 (the patch addresses the issue on 6.6), but the reset timing can still give some trouble.
     
    Mass storage mode was my testbed, along ethernet emulation; what is still not working at all is the audio gadget which, I guess, uses isochronous mode which is still buggy.
     
    Anyway you surely have to set the OTG port as device mode you have to use dr_mode="peripheral" in the device tree. On rk322x there is a quick device tree overlay to do that, without editing and fiddling with details. I don't remember if there is a similar overlay for rk3318/rk3328, but I guess not.
     
    Notice also that you will not see any USB device connected on the other side when USB2 port is in peripheral mode until a gadget is set up.
    There are several guides around (especially for raspberry pi) on how to setup a gadget, you can use them to actually test the port.
     
     
     
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines