Package Details: python-pyamlboot-git r91.d7806ac-1

Git Clone URL: https://aur.archlinux.org/python-pyamlboot-git.git (read-only, click to copy)
Package Base: python-pyamlboot-git
Description: Amlogic USB Boot Protocol Library
Upstream URL: https://github.com/superna9999/pyamlboot
Licenses: MIT
Conflicts: python-pyamlboot
Provides: python-pyamlboot
Submitter: userbyte
Maintainer: userbyte
Last Packager: userbyte
Votes: 0
Popularity: 0.000000
First Submitted: 2024-12-12 04:53 (UTC)
Last Updated: 2024-12-12 04:53 (UTC)

Latest Comments

xenobro commented on 2025-04-07 21:34 (UTC)

When trying to burn a larger image, after a while seemingly working, this happens:

[x@archlinux tanixtx5pro]$ boot.py --image Armbian_25.05.0_amlogic_s905x_bookworm_6.12.21_server_2025.04.01.img --fdt gxl_p212_2g.dtb p212
/usr/bin/boot.py:9: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
Using GX Family boot parameters
ROM: 2.2 Stage: 0.0
Writing /usr/lib/python3.13/site-packages/files/p212/u-boot.bin.usb.bl2 at 0xd9000000...
[DONE]
Writing /usr/lib/python3.13/site-packages/files/usbbl2runpara_ddrinit.bin at 0xd900c000...
[DONE]
Running at 0xd9000000...
[DONE]
Waiting...
[DONE]
ROM: 2.2 Stage: 0.0
Writing /usr/lib/python3.13/site-packages/files/p212/u-boot.bin.usb.bl2 at 0xd9000000...
[DONE]
Writing /usr/lib/python3.13/site-packages/files/usbbl2runpara_runfipimg.bin at 0xd900c000...
[DONE]
Writing /usr/lib/python3.13/site-packages/files/p212/u-boot.bin.usb.tpl at 0x200c000...
[DONE]
Writing Armbian_25.05.0_amlogic_s905x_bookworm_6.12.21_server_2025.04.01.img at 0x8080000...
Traceback (most recent call last):
  File "/usr/bin/boot.py", line 148, in <module>
   usb.write_file(args.imagefile, usb.UBOOT_IMAGEADDR, 512, True)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/boot.py", line 67, in write_file
    self.dev.writeLargeMemory(addr, b, large, fill)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/pyamlboot/pyamlboot.py", line 255, in writeLargeMemory
    self._writeLargeMemory(address+offset, data[offset:offset+writeLength], \
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                           blockLength, appendZeros)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/pyamlboot/pyamlboot.py", line 236, in _writeLargeMemory
    ep.write(data[offset:offset+blockLength], 1000)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/usb/core.py", line 416, in write
    return self.device.write(self, data, timeout)
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/usb/core.py", line 1003, in write
    return fn(
            self._ctx.handle,
    ...<3 lines>...
            self.__get_timeout(timeout)
        )
  File "/usr/lib/python3.13/site-packages/usb/backend/libusb1.py", line 841, in bulk_write
    return self.__write(self.lib.libusb_bulk_transfer,
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        dev_handle,
                        ^^^^^^^^^^^
    ...<2 lines>...
                        data,
                        ^^^^^
                        timeout)
                        ^^^^^^^^
  File "/usr/lib/python3.13/site-packages/usb/backend/libusb1.py", line 942, in __write
    _check(retval)
    ~~~~~~^^^^^^^^
  File "/usr/lib/python3.13/site-packages/usb/backend/libusb1.py", line 602, in _check
    raise USBTimeoutError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBTimeoutError: [Errno 110] Operation timed out

Any ideas? Thank you very much.

xenobro commented on 2025-04-07 20:11 (UTC) (edited on 2025-04-07 20:29 (UTC) by xenobro)

I'm trying to unbrick a Tanix Tx5 Pro (S905X, gxl_p212_2g) with pyamlboot, but I'm running into some issues with the program. Initially t gave me errors about "usb.core" missing, but that was solved by installing python-pyusb-git. But now the box disappears from lsusb after "boot.py" until disconnected and reconnected, and I'm not even sure what "boot.py" did:

[x@archlinux ~]$ lsusb
...
Bus 003 Device 003: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)
Bus 003 Device 017: ID 1b8e:c003 Amlogic, Inc. GX-CHIP
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
...
[x@archlinux ~]$ boot.py p212
/usr/bin/boot.py:9: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
Using GX Family boot parameters
ROM: 2.2 Stage: 0.0
Writing /usr/lib/python3.13/site-packages/files/p212/u-boot.bin.usb.bl2 at 0xd9000000...
[DONE]
Writing /usr/lib/python3.13/site-packages/files/usbbl2runpara_ddrinit.bin at 0xd900c000...
[DONE]
Running at 0xd9000000...
[DONE]
Waiting...
[DONE]
ROM: 2.2 Stage: 0.0
Writing /usr/lib/python3.13/site-packages/files/p212/u-boot.bin.usb.bl2 at 0xd9000000...
[DONE]
Writing /usr/lib/python3.13/site-packages/files/usbbl2runpara_runfipimg.bin at 0xd900c000...
[DONE]
Writing /usr/lib/python3.13/site-packages/files/p212/u-boot.bin.usb.tpl at 0x200c000...
[DONE]
Running at 0xd9000000...
[DONE]
[x@archlinux ~]$ lsusb
...
Bus 003 Device 003: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
...

There's also the deprecation warning, but the main issue is that, after the first "boot,py", this happens if it run it again, after the box is no longer in lsusb:

[x@archlinux ~]$ boot.py p212
/usr/bin/boot.py:9: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
Using GX Family boot parameters
Traceback (most recent call last):
  File "/usr/bin/boot.py", line 143, in <module>
    usb = BootUSB(args.board, fpath, args.upath)
  File "/usr/bin/boot.py", line 45, in __init__
    self.dev = pyamlboot.AmlogicSoC(timeout=args.timeout)
               ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/pyamlboot/pyamlboot.py", line 76, in __init__
    raise ValueError('Device not found')
ValueError: Device not found

Can somebody help? Thank you very much.