Ugoos X3 Pro - S905X3 - can't enable USB ports after booting from MicroSD card

Hello everyone,

I am a new CE user, or I would rather to say a wanna-be CE-user.

Let me first say that I just spent litterally tons of hours trying to debug and making this issue work ; and that I already read a lot all topics here that might be covering this issue, unsuccessfully.

So, I have a Ugoos X3 Pro (S905X3, 1 Gbps Ethernet, 4 GB RAM, 32 GB eMMC) and I can’t enable any of the USB ports after booting CE from MicroSD card. As a reminder, this model has 2 USB ports : one USB 2.0 (black) with “OTG” marking, and one USB 3.0 (blue).

For your information, my box has the Android 9 firmware V0.5.4 for X3 Family

Here is the setup I tried:

  • the latest CE version : CoreELEC-Amlogic-ng.arm-21.3-Omega-Generic.img.gz, and also CoreELEC-Amlogic-ng.arm-20.5-Nexus-Generic.img.gz (leading to the same issue)
  • dtb sm1_s905x3_4g_1gbit.dtb
  • installed on a decent SanDisk 64 GB MicroSD card

I did try the solution, that some people validated to be working, of the GPIO 432 forced by a command :

echo 432 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio432/direction
echo 1 >  /sys/class/gpio/gpio432/value
echo 432 > /sys/class/gpio/unexport

I tried using these commands from a live root SSH session and it provoked instant crash + boot looping.
I tried putting these commands in an autostart.sh file and it provoked boot looping. Only removing this file stopped boot looping.
So that GPIO 432 enable after boot is apparently not a solution for me.

I do understand that these previous commands aim to enable a specific GPIO linked to USB physical ports, and that GPIO might be GPIOH_5.

I then dumped the live dts + dtb from the currently working Ugoos Android OS of the box, you can find here the DTS and DTB:
live.dtb (80.2 KB)
live.dts (127.4 KB)

Then, I tried a lot, but a lot, and a lot, of different modifications to DTB files. As this was also my first time doing this, I am frankly not even sure that I managed to really produce actually edited DTB, as dtcing my dts to dtb did always come with warnings that I could not understand.

If you would like to see some of my creations, you find some here, with the help of ChatGPT, you can see this is my latest try which produced this dtb (if only compilation was good):
try8.dts (81.3 KB)
dtb.img (71.7 KB)

None of my DTB edits solved my issue.

I also did these tests:

  • choosing the same sm1_s905x3_4g_1gbit.dtb of LibreELEC (LibreELEC-AMLGX.aarch64-12.2.1-box.img.gz) and booting it led to the same issue

  • choosing the same sm1_s905x3_4g_1gbit.dtb of EmuELEC (EmuELEC-Amlogic-ng.aarch64-4.8-Generic.img.gz) and booting it from MicroSD card did not lead to the same issue: the USB ports were working ! But I don’t want EmuELEC.

I even tried to boot Armbian with meson-sm1-ugoos-x3.dtb, referenced here: it did not work either, but maybe for independent reasons:
https://github.com/devtical/amlogic-armbian/blob/main/build-armbian/armbian-docs/amlogic_model_database.md
I had good hope in this try, as I saw someone for whom it was working:
https://forum.armbian.com/topic/56118-ugoous-x3-pro-armbian-server-ram-issue/

I even tried to boot CE with Armbian meson-sm1-ugoos-x3.dtb but as you can imagine, it failed.

Can you help me please ? I feel quite desperate having put that amount of work without any result.
I really want to use CE from a MicroSD card on my box ! I really want to be a CE user !

Thanks !

I would suggest that you use CE-NO 22, as the older CE is EOL.

2 Likes

Thank you for this suggestion, I would have never thought using an alpha release, as the coreelec website proposed naturally to use the stable ng version 21 for my box S905X3.

Here are the first results with CE 22, and they are quite bizarre.

After the first booting of the CE 22 version : no USB powered on. But seeing some usb2phy and usb3phy message I had not before with CE 21:

$ dmesg | grep -i usb
[    0.000000] Kernel command line: systemd.show_status=auto init=/init console=                   ttyS0,115200 no_console_suspend earlyprintk=aml-uart,0xff803000 ramoops.pstore_e                   n=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000 hdr_policy=1 hdr_prio                   rity= otg_device=0 usb3_off=0 reboot_mode_android=normal logo=osd0,loaded,0x3d80                   0000 fb_width=1920 fb_height=1080 display_bpp=16 outputmode=1080p60hz vout=1080p                   60hz,enable panel_type=lcd_1 lcd_ctrl=0x00000000 hdmitx=,444,8bit hdmimode=1080p                   60hz hdmichecksum=0x00000000 frac_rate_policy=0 hdmi_read_edid=1 cvbsmode=576cvb                   s osd_reverse=0 video_reverse=0 irq_check_en=0 androidboot.selinux=permissive an                   droidboot.firstboot=0 jtag=disable androidboot.hardware=amlogic androidboot.boot                   loader=U-Boot 2015.01 androidboot.build.expect.baseband=N/A androidboot.serialno                   =X3P2009000004292 mac=d0:5f:64:d1:22:a4 androidboot.mac=d0:5f:64:d1:22:a4 androi                   dboot.oem.key1=ATV00104319 androidboot.rpmb_state=0 BOOT_IMAGE=kernel.img boot=L                   ABEL=COREELEC disk=LABEL=STORAGE console=tty
[    0.000000] Unknown kernel command line parameters "earlyprintk=aml-uart,0xff                   803000 hdr_policy=1 hdr_priority= otg_device=0 usb3_off=0 reboot_mode_android=no                   rmal logo=osd0 fb_width=1920 fb_height=1080 display_bpp=16 vout=1080p60hz panel_                   type=lcd_1 lcd_ctrl=0x00000000 hdmitx= hdmimode=1080p60hz hdmichecksum=0x0000000                   0 frac_rate_policy=0 hdmi_read_edid=1 cvbsmode=576cvbs video_reverse=0 irq_check                   _en=0 jtag=disable boot=LABEL=COREELEC disk=LABEL=STORAGE remotewakeup=0xfffffff                   f decode_type=0 remotewakeupmask=0xffffffff", will be passed to user space.
[    1.668994] usbcore: registered new interface driver usbfs
[    1.669038] usbcore: registered new interface driver hub
[    1.669070] usbcore: registered new device driver usb
[    1.832127] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.833155] usbcore: registered new interface driver uas
[    1.833226] usbcore: registered new interface driver usb-storage
[    1.833374] usbcore: registered new interface driver usbserial_generic
[    1.833400] USB Serial support registered for generic
[    1.834518] usbcore: registered new interface driver xpad
[    1.835260] usbcore: registered new interface driver uvcvideo
[    1.839019] usbcore: registered new interface driver usbhid
[    1.839028] usbhid: USB HID core driver
[    1.840392] usbcore: registered new interface driver snd-usb-audio
[    2.606368] ### usb_main_init() start
[    2.606754] call amlogic_new_c2_usb2_v2_driver_init() success
[    2.607011] call amlogic_new_c2_usb3_v2_driver_init() success
[    2.607211] call amlogic_new_usb3_v3_driver_init() success
[    2.607819] amlogic-new-usb2-v2 ffe09000.usb2phy: USB2 phy probe:phy_mem:0xff                   e09000, iomap phy_base:0xffffffc00bdf5000
[    2.608192] call amlogic_new_usb2_v2_driver_init() success
[    2.608437] amlogic-new-usb3-v2 ffe09080.usb3phy: This is normal phy
[    2.609396] amlogic-new-usb3-v2 ffe09080.usb3phy: USB3 phy probe:phy_mem:0xff                   e09080, iomap phy_base:0xffffffc00bf05080
[    2.609605] amlogic-new-usb3-v2 ffe09080.usb3phy: Failed to get pcie_bgp
[    2.616480] call amlogic_new_usb3_v2_driver_init() success
[    2.616890] call amlogic_usb2_m31_drv_init() success
[    2.617153] call amlogic_usb3_m31_drv_init() success
[    2.617428] call aml_usb3_phy_drv_init() success
[    2.618285] amlogic-new-usb2-v2 ffe09000.usb2phy: Not usb-phy-trim-reg
[    2.622431] amlogic-new-usb2-v2 ffe09000.usb2phy: Not usb-phy-trim-reg
[    2.632063] amlogic-new-usb2-v2 ffe09000.usb2phy: Not usb-phy-trim-reg
[    2.635434] amlogic-new-usb2-v2 ffe09000.usb2phy: Not usb-phy-trim-reg
[    2.642148] xhci-hcd-meson xhci-hcd-meson.1.auto: new USB bus registered, ass                   igned bus number 1
[    2.642485] xhci-hcd-meson xhci-hcd-meson.1.auto: new USB bus registered, ass                   igned bus number 2
[    2.642495] xhci-hcd-meson xhci-hcd-meson.1.auto: Host supports USB 3.0 Super                   Speed
[    2.642636] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bc                   dDevice= 5.15
[    2.642642] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=                   1
[    2.642647] usb usb1: Product: xHCI Host Controller
[    2.642651] usb usb1: Manufacturer: Linux 5.15.196 xhci-hcd
[    2.642654] usb usb1: SerialNumber: xhci-hcd-meson.1.auto
[    2.643082] hub 1-0:1.0: USB hub found
[    2.643464] usb usb2: We don't know the algorithms for LPM for this host, dis                   abling LPM.
[    2.643551] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bc                   dDevice= 5.15
[    2.643558] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=                   1
[    2.643562] usb usb2: Product: xHCI Host Controller
[    2.643566] usb usb2: Manufacturer: Linux 5.15.196 xhci-hcd
[    2.643570] usb usb2: SerialNumber: xhci-hcd-meson.1.auto
[    2.643954] hub 2-0:1.0: USB hub found
[    2.645636] call amlogic_crg_drd_usb2_drv_init() success
[    2.645851] call amlogic_crg_drd_usb3_drv_init() success
[    2.646368] ### usb_main_init() end
[    2.646525] dwc_otg: usb0: type: 2 speed: 0,
[    2.912520]     usb3_off=0

But still no GPIO 432 enabled:

$ cat /sys/kernel/debug/gpio
gpiochip1: GPIOs 410-495, parent: platform/pinctrl@ff634480, periphs-banks:
 gpio-448 (                    |reset               ) out hi ACTIVE LOW
 gpio-458 (                    |cd                  ) in  lo
 gpio-482 (                    |sdio_wifi           ) out hi
 gpio-483 (                    |sdio_wifi           ) in  hi
 gpio-493 (                    |bt_rfkill           ) out hi
 gpio-495 (                    |bt_rfkill           ) out hi

gpiochip0: GPIOs 496-511, parent: platform/pinctrl@ff800014, aobus-banks:
 gpio-498 (                    |VDDIO_C             ) out lo
 gpio-507 (                    |sys_led             ) out lo ACTIVE LOW
 gpio-511 (                    |fixedregulator@vcc3v) out hi

Then I tried to enable the GPIO 432 through the 4 bash commands (echo 432 > … etc.): it provoked again an instant reboot upon the echo 1 > /sys/class/gpio/gpio432/value

Then it rebooted. I don’t why but I chose to perform installentware, and when done, without choosing to reboot after the installation, I put again the 4 bash commands. It worked, the USB ports were powered on. But I can’t understand why: is it related to the installentware ? If not, what is it related to ?

[  123.932857] xhci-hcd-meson xhci-hcd-meson.1.auto: aml_xhci_alloc_dev, slot=1
[  124.060649] usb 1-2: new high-speed USB device number 2 using xhci-hcd-meson
[  124.210443] usb 1-2: New USB device found, idVendor=XXXX, idProduct=XXXX, bcdDevice=XXXX
[  124.210462] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  124.210467] usb 1-2: Product: USB Flash Drive
[  124.210471] usb 1-2: Manufacturer: <manufacturer>
[  124.210475] usb 1-2: SerialNumber: <serial_number>
[  124.210897] usb 1-2: ep 0x81 - rounding interval to 128 microframes, ep desc says 255 microframes
[  124.210954] usb 1-2: ep 0x2 - rounding interval to 128 microframes, ep desc says 255 microframes
[  124.211549] usb-storage 1-2:1.0: USB Mass Storage device detected
[  124.212020] scsi host0: usb-storage 1-2:1.0
[  125.538353] scsi 0:0:0:0: Direct-Access     <manuf>    USB Flash Drive  1100 PQ: 0 ANSI: 4
[  125.539302] sd 0:0:0:0: Attached scsi generic sg0 type 0
[  125.539769] sd 0:0:0:0: [sda] 15659008 512-byte logical blocks: (8.02 GB/7.47 GiB)
[  125.540292] sd 0:0:0:0: [sda] Write Protect is off
[  125.540304] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[  125.540815] sd 0:0:0:0: [sda] No Caching mode page found
[  125.540826] sd 0:0:0:0: [sda] Assuming drive cache: write through
[  125.543764]  sda: sda1 sda2
[  125.546465] sd 0:0:0:0: [sda] Attached SCSI removable disk
[  125.893619] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[  126.235302] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.

Then I rebooted, and performed again the 4 bash commands. It worked again.

So I should currently be happy, but as I don’t understand why it failed after the first boot for CE 22, and why it worked for an unstable version (CE 22), and why it fails with stable CE 21 version, I am quite perplexed. I suspect that running CE that way is not deterministic and I don’t want to risk to setup something that might break at any time for unknown reasons and random workaround.

So I have to perform some new tests using a stable ne version:CoreELEC-Amlogic-ne.aarch64-21.3-Omega-Generic.img.gz as I would prefer to use a stable release.
I even would like to use a stable version with a modified DTB integrating the GPIO 432 enable without the bash commands.

Do you know a tutorial that would explain me how to setup a proper working development environment in order to try to edit sm1_s905x3_4g_1gbit.dts for integrating the GPIO 432 enable ?

And do you even think it is really possible to produce the wanted DTS modification, or are we doomed to only use bash commands to enable USB ports ?

NE does not have SM1 SoC support!

You maybe enable the USB power gpio and it stay active until a cold boot again, this is why it works after a reboot.

You will need to modify the DTS and add a usb power gpio like this example:

1 Like

Thank you very much, I managed to edit the DTS in order to automatically enable USB at boot:
ugoos_x3_pro_4g_1gbit.dtb (76.7 KB)
ugoos_x3_pro_4g_1gbit.dts (758 Bytes)

Though, it works with CE 22, but does not work with CE 21 (boot loop, same result than using bash gpio command).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.