WeTek Play 2 storage resize failed

  • Decided to give the Wetek Hub a break until someone can tell me how to set serial RX to high with 3.3v.

    Went to the Wetek Play 2 (running Libreelec 8.5 I think or 8.2) and observed that booting with the box's power button down went to Android recover, and pressing the restore button on booting booted from microsd card (correct function).

    Put a box disk image on the sd card and configured it to boot with the Wetek Play 2 configuration and booted the system while pressing the restore button.

    Booted into Libreelec 11.0.3 from the card.

    Performed the 'wget' and 'emmctool w' calls to pull Libreelec 11.0.3 into /storage and flash the nand.

    All went apparently well, except now there are problems.

    1) There is a problem with emmc storage as the unit reports a lack of space and many addons (and all skins) fail to install

    2) The restore button and power button on boot do nothing now ... I lost that functionality.

    3) Trying to downgrade reports a lack of space

    so essentially it is pooched ... now what?

  • I was just looking through available commands and found that 'parted' and "resize2fs" are installed on the image.

    The emmc storage is 8GB and I am working to non-destructively enlarge it.

    This still won't allow me to downgrade previously to v11 but should allow for the device to work and install addons.

    the bigger issue at hand is that both the power button and the reset button are non-functional with the flash of 11.0.3; kinda of important items to have working for unbricking/unpooching devices


    this is getting comical

    Code
    (parted) resize 2 100%
    resize 2 100%
    Error: The resize command has been removed in parted 3.0

    my error in the syntax, but nonetheless is gets more amusing ... I'm working through parted (used the graphical gparted tons)


    parted

    select /dev/mmcblk1

    resizepart 2 100%

    finally :D

    edit: at 'parted", enter
    print all

    to get device names


    resize2fs /dev/mmcblk1p2

    and now storage is 6.3GB in size 8)
    edit: exit parted (I think is was ctrl-c), then type

    df -h

    to get device name to resize (the device associated with /storage)

    Edited 9 times, last by thegooddoctor: Merged a post created by thegooddoctor into this post. (August 7, 2023 at 6:34 AM).

  • Code
    touch /storage/.please_resize_me && reboot

    ^ this also works, but note that it's a destructive resize (the /storage partition is removed and recreated)

  • NB: If you install the board image you are overwriting vendor u-boot with vanilla upstream u-boot; which a) has no "hold the power key to switch OS" mode, and b) there is now a single OS installed so nothing to switch between anyway. If you want that functionality you need to use the "box" image and configure it for the WP2 (or Hub, as appropriate) so that you retain vendor u-boot.

    https://www.dropbox.com/s/tw6bg3kipc8t…wp2.img.gz?dl=0 <= dd backup of the WP2 factory image

  • Thanks chewitt!

    How do I boot from a box image on a sd card when the unit refuses to boot from a sd card?
    (assuming that I need to install a properly configured 'box' image on a sd card and then boot from it --- or do I have this wrong?)

  • OK ... took the restore image WeTek_Play_2_Restore.zip and followed the instructions and the unit refuses to boot from the microsd card.

    1) no reset button pressed

    2) reset button pressed for 3, then 5, then 7 seconds

    3) reset button and front power button pressed for 3, then 5, then 7 seconds

    unit just boots directly into LE 11.0.3

  • In post #1 you state "Booted into Libreelec 11.0.3 from the card."

    In reality the box booted vendor u-boot from eMMC (as S905 silicon is hard-coded to look for boot firmware on eMMC first and it existed via the factory image, so it did boot it) but then LE11 was found and loaded from the SD card, thus proving that the SD card slot works, and much like the Hub .. you just need to feed it the right software.

    If you have written the LE11 board image to eMMC it will now be booting upstream u-boot (not vendor) which uses different boot files/config but the boot flow remains the same; silicon checks eMMC first and if it finds boot firmware it runs it regardless of what's on the SD card. If you want to force the box to boot from SD card the only way is either a) erasing eMMC (or the first few MB) so that u-boot is not discoverable on eMMC, or b) using a special HDMI dongle (as mentioned in the other thread). Assuming A which is easier: If silicon (BL1 in the boot chain) cannot find boot firmware (BL2) on eMMC *then* it will check for a correctly structured SD card for boot firmware. Correctly structured means magic headers at specific disk sectors, the BL1 bootrom has no ability to look for files in partitions/filesystems.

    At this stage if you put the "board" image on an SD card, the box will boot u-boot from eMMC, which will then find the LE boot files on SD and boot them (upstream u-boot has logic to check SD and USB for boot files first). If you put the "box" image on SD the same might happen too. In either case, eMMC is not "active" after the initial u-boot step and can be safely overwritten from userspace using emmctool and you choice of software: either the "backup-wp2.img.gz" file (to restore the factory image) or perhaps the LE11 image again. It is unusual that the /storage partition resize failed .. but it's not the end of the world. You can fix this at any time by running "touch /storage/.please_resize_me && reboot" .. and on reboot the partition will be erased and recreated using 100% of the remaining space on disk.

    NB: Upstream u-boot doesn't map the power button or reset button to have any boot-level functions, but that's not particularly important if you understand the (different from vendor u-boot) boot flow.

  • The Wetek Play 2 was running LE I think around v7 or something quite old; when I took the LE11.0.3 image and flashed it to microsd, it still worked from booting from microSD card. I *thought* all was well with LE11.0.3 so I flashed the emmc and now it only boots from emmc.

    I know that with your work with my Wetek Hub that it can boot from microSD and hopefully you can work your magic to my problems with the Wetek Play 2. :)

  • Fair enough ...

    I think if I could have an LE image that can 1)booted from microSD card & 2)written to emmc then I would be extremely happy.

    LE 11.0.3 that was flashed to my Wetek Play 2 emmc does not allow for booting from the microSD card using LE 11.0.3 official release (seems to be a similar issue to the Wetek Hub - which you magically got to boot again with the special bootloader).

    :)

    Edited once, last by thegooddoctor (August 19, 2023 at 1:19 PM).

  • If you write viable u-boot to eMMC the box is hard-wired to boot from that always; same is true for both vendor u-boot in Android and the upstream u-boot in the LE image. Thus no image can "boot from SD when inserted" .. although since u-boot is generally configured to use boot files (aligned to that version of u-boot) on SD card if present, users can be forgiven for being factually incorrect.

    Android u-boot on eMMC:

    - Can find the legacy LE image on SD card image and use it

    - Can find the upstream LE image on SD card and use it

    Upstream u-boot on eMMC:

    - Can find the upstream LE image on SD card and use it

    - Cannot find the legacy LE image

    So if the goal is to use the 11.0.3 image both Android/vendor and upstream u-boot can boot (from eMMC) and find an SD card image. I'm just not sure what you achieve booting 11.0.3 from SD over eMMC .. it just runs marginally slower from SD.

    I'm done with this thread.

  • The rational for booting from microSD is to be able to write to eMMc (flash it); one cannot do the flash to eMMc when booting from the eMMC.

    This (booting from microSD) allows the end user to change the written data on the eMMc.

    With the current state of the uboot loader (upstream) both my Wetek Play 2 and Wetek hub bypass the microSD card and directly boot from emmc thus disallowing the end user from ultimately flashing the eMMc (you have shown that the images are just missing some 'software' else they would boot); this demonstrates that it is indeed possible to boot from microSD, then ultimately reflash the eMMc to something different.

    Right now as it sits, the eMMc programming on both my Wetek Play 2 and Wetek Hub are not changeable (at least from the different versions that I have tested ... if someone could point me to one that does indeed work then :) )

    Thank you for your assistance chewitt - I hope that you're not frustrated with this ... you have helped out a lot and it is greatly appreciated.

    The Wetek's are solid little performers even in 2023; it would be nice to get them working again.

    Edited once, last by thegooddoctor (August 20, 2023 at 7:46 PM).

  • well this is good news

    I just tried the latest LE 12 nightly release LibreELEC-AMLGX.arm-12.0-nightly-20230819-8e18456-wetek-hub.img

    and it does boot from microSD card

    I just still stops during the initial boot (UART prompt: hit any key to stop auto boot).

    If I can an older image of LE the the older uboot code OR figure out how to downgrade the uboot code I'll be in business!

  • The only way to ensure something 100% boots from SD is to erase eMMC (preventing eMMC boot) or to use the special HDMI dongles that force different BL1 (silicon bootrom) boot priority. However, for reflash of eMMC you only need to ensure that the kernel is running from SD card. The initial u-boot stage from eMMC and then discovery and boot of kernel and userspace files on SD is fine since the binaries that run are on the SD card. If you attempt to flash eMMC when booted from eMMC it will start and the lock-up when you overwrite the apps that you are using to perform the flash.

  • With the eMMC module removed, certain images still won't boot (and this is why I thought the unit was bricked)

    GXBB:BL1:08dafd:0a8993;FEAT:EDFD718C;POC:3;RCY:0;EMMC:800;NAND:81;SD:0;READ:0;CHK:F3;USB:8;LOOP:1; repeating output

    LibreELEC-WeTek_Hub.arm-9.2.8.10

    LibreELEC-WeTek_Hub.arm-9.0.2

    then with use of the upstream uboot, the hub stops booting due to receiving an interrupt (the artifacting seen with UART)

    LibreELEC-AMLGX.arm-11.0.3-wetek-hub.img

    LibreELEC-AMLGX.arm-12.0-nightly-20230819-8e18456-wetek-hub.img

    So now to find a bootable image of LibreElec that completely boots the Hub without stopping

    what benefits are gained with the upsteam uboot code?

  • The legacy images do not contain vendor u-boot, they are designed to boot from SD card (with vendor u-boot on eMMC to initiate boot) or to replace the Android image on eMMC (again working with the original vendor u-boot on eMMC). If no u-boot on eMMC .. no boot.

    The vendor u-boot code "works" but is horrible. Upstream u-boot also "works" and is cleaner to work with for packaging. Your Hub has a hardware problem. If you fix that (in hardware) the upstream u-boot works fine.