I have been having problems copying some files from the host (a Raspberry Pi 4B) to a Pico (RP2) using USB. The Pico has MicroPython v1.18 and I am using rshell v0.0.31 to do the copy.
If I try and copy any file that has a file size which is a multiple of 32 bytes but is *not* a multiple of 128 bytes then the file transfer results in the Pico hard hanging at the end of the transfer. The file does not end up being transferred, only a zero length file is created on the Pico. For example, files of size 32, 64, 96, 160, 192, 224, 288, etc bytes will fail to transfer. Files of other sizes that are not in the sequence transfer fine.
The rshell command I am using is:
Code: Select all
cp filename.ext /pyboard
I have done some debugging in rshell and the problem appears to be in the function recv_file_from_host which fails when it hits the line:
Code: Select all
bytes_read = sys.stdin.readinto(read_buf, read_size)
Note I have replicated the problem with two different Pico boards and MicroPython v1.17 and the latest nightly v1.18-218.
Any insight would be appreciated.
Regards - Mark