Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.1.5-dev not working flash #20

Open
antohami opened this issue May 19, 2020 · 3 comments
Open

0.1.5-dev not working flash #20

antohami opened this issue May 19, 2020 · 3 comments

Comments

@antohami
Copy link

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

@TheTimeWalker
Copy link

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

@coderofsalvation
Copy link

coderofsalvation commented Nov 10, 2022

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))

@HeavyChevyShell
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants