Issue with Enabling OTG Functionality in USB1 Port on BEAGLEBONE BLK REV C (AM3358BZCZ)

I am currently working on enabling OTG functionality in the USB1 port of the BEAGLEBONE BLK REV C (AM3358BZCZ), which was originally configured as a USB host.

I have made the following hardware and software changes to achieve this functionality. With these updates, I am able to get the USB controller to act as a USB peripheral (verified by detecting the device as a COM port in Windows system using a USB A to USB A cable) when the USB1_ID pin jumper is opened. However, when I close the USB1_ID pin jumper, the USB controller does not switch into USB host mode as expected.

One of my findings is that when USB1_ID is grounded, the USB1_DRVVBUS pin toggles high and low continuously with a delay of approximately 1 seconds, which seems to be unusual behavior.

Could you kindly review the changes we’ve made and provide any insights or suggestions that might help resolve this issue?

Software Changes:

  • Linux Kernel:

We are using the kernel from the following repository and branch:
GitHub - RobertCNelson/bb-kernel, branch “am33x-v5.10”.

  • Def Config changes:

The following change was made to enable USB role switching:

diff --git a/patches/defconfig b/patches/defconfig

index 63c7ae681..121151519 100644

--- a/patches/defconfig

+++ b/patches/defconfig

@@ -5464,7 +5467,7 @@ CONFIG_USB_G_DBGP_SERIAL=y

# end of USB Gadget precomposed configurations

# CONFIG_TYPEC is not set

-# CONFIG_USB_ROLE_SWITCH is not set

+CONFIG_USB_ROLE_SWITCH=y

CONFIG_MMC=y

CONFIG_PWRSEQ_EMMC=y

# CONFIG_PWRSEQ_SD8787 is not set
  • DTS file changes:

We modified the device tree as follows to enable OTG mode for USB1:

diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi

index 88b2f9d73aa6..c8e7514ec5e8 100644

--- a/arch/arm/boot/dts/am335x-bone-common.dtsi

+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi

@@ -194,7 +194,9 @@ &usb0 {

};

&usb1 {

- dr_mode = "host";

+ dr_mode = "otg";

}

Hardware changes:

  • USB1_ID pin close: USB controller is expected to act as a USB host.
  • USB1_ID pin opened: USB controller successfully acts as a USB peripheral. Verified by detecting the device as a COM port in Windows System using a USB A to USB A cable

I would appreciate any guidance or feedback on this issue. Thank you for your support.

@RobertCNelson, Any advice?