rkflashkit icon indicating copy to clipboard operation
rkflashkit copied to clipboard

0.1.5-dev not working flash

Open antohami opened this issue 5 years ago • 4 comments

I made a backup of the u-boot partition, cleared the partition, tried to write it. As a result, such an error:

Traceback (most recent call last): File "/usr/lib/python3/site-packages/usb1/init.py", line 282, in create_initialised_buffer return string_type.from_buffer(init), init TypeError: memoryview: a bytes-like object is required, not 'str'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/site-packages/rkflashkit/main.py", line 278, in __flash_image_file op.flash_image_file(offset, size, image_file) File "/usr/lib/python3/site-packages/rkflashkit/rktalk.py", line 306, in flash_image_file self.__flash_image_file(offset, size, fh) File "/usr/lib/python3/site-packages/rkflashkit/rktalk.py", line 289, in __flash_image_file self.__dev_handle.bulkWrite(self.__write_endpoint, str(buf)) File "/usr/lib/python3/site-packages/usb1/init.py", line 1500, in bulkWrite data, _ = create_initialised_buffer(data) File "/usr/lib/python3/site-packages/usb1/init.py", line 286, in create_initialised_buffer init = bytearray(init) TypeError: string argument without an encoding

antohami avatar May 19 '20 10:05 antohami

I can confirm this happening here too anytime you want to flash. Reverting back to commit e43cb3dd63536f2147c0bc94ab39ff7147ecd40b which was before the python3 port makes it work again.

TheTimeWalker avatar Aug 08 '20 11:08 TheTimeWalker

I had the same issue, here's how I fixedit:

src/rkflashkit/rktalk.py on line 289

+++ self.__dev_handle.bulkWrite(self.__write_endpoint, buf)                    # this works
--- self.__dev_handle.bulkWrite(self.__write_endpoint, str(buf))

coderofsalvation avatar Nov 10 '22 17:11 coderofsalvation

I made a backup of the u-boot partition, cleared the partition, tried to write it. As a result, such an error:

Traceback (most recent call last): File "/usr/lib/python3/site-packages/usb1/init.py", line 282, in create_initialised_buffer return string_type.from_buffer(init), init TypeError: memoryview: a bytes-like object is required, not 'str'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/site-packages/rkflashkit/main.py", line 278, in __flash_image_file op.flash_image_file(offset, size, image_file) File "/usr/lib/python3/site-packages/rkflashkit/rktalk.py", line 306, in flash_image_file self.__flash_image_file(offset, size, fh) File "/usr/lib/python3/site-packages/rkflashkit/rktalk.py", line 289, in __flash_image_file self.__dev_handle.bulkWrite(self.__write_endpoint, str(buf)) File "/usr/lib/python3/site-packages/usb1/init.py", line 1500, in bulkWrite data, _ = create_initialised_buffer(data) File "/usr/lib/python3/site-packages/usb1/init.py", line 286, in create_initialised_buffer init = bytearray(init) TypeError: string argument without an encoding

HeavyChevyShell avatar Feb 16 '23 10:02 HeavyChevyShell