-
Notifications
You must be signed in to change notification settings - Fork 11
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
rshell cp fails if connection is via UART #10
Comments
ok - thanks - I'll look into this |
Is this over a wireless link? Or using something like an FTDI connection? |
Initial analysis suggests that the uart read buffer is getting messed up. The host side wrote 512 bytes. I tried: modifying your boot.py to look like:
it got the first 198 bytes fine, and then it dropped 8 characters. I confirmed (using my logic analyzer) that the correct characters arrived on the Rx line. I probably won't get much further tonight, so I thought I'd write this up to let you know what I found. |
And it definitely looks like a software issue. I toggled a GPIO for each character received and the dropped characters were received. |
Nope - I see some dropped IRQs. So that tells me that interupts were disabled or some higher priority handler was running. |
Sorry for the delay getting back to you but we are separated by a few degrees of longitude :) I was testing using an FTDI adaptor lead connected by short jumpers to Pyboard UART6. The link seems reliable. |
I opened: micropython/micropython#1555 From my logic analyzer traces it looks like interupts are being disabled to do sdcard I/O and that's causing dropped characters. I'm going to see if I can figure out how to do UART Rx using DMA. |
This should be addressed by micropython/micropython#1608 |
I'm still seeing this with a Pyboard connected via an FTDI adaptor. Rshell works fine except for copying files to the Pyboard SD card where it hangs. The card in a card reader shows a zero length file. This is with current firmware. |
I stumbled across this last night as well on my NUCLEO 401 board. In that On Wed, Feb 10, 2016 at 5:07 AM, Peter Hinch [email protected]
Dave Hylands |
@peterhinch Are you using rshell from this repository? This repository is now obsolete and has been replaced by: https://github.com/dhylands/rshell and you can now install rshell using pip. |
Installing with pip sounds so easy. Unless you have boxes running rather old versions of Debian. I'll tackle that can of worms tomorrow. On this relatively up to date laptop (Mint 17.1) I managed to install with pip3 (pip threw errors). The following presumably implies I'm running the right version:
Version I'm running
Attempt to run
|
Good question. I don't think that there is, but I'll figure out a way to do that. And yeah - you need to use pip3 because rshell requires python3. I guess I should make sure I say that :) |
I also discovered that if you have python3, you can run |
Thanks for the tip re pip3. I'm puzzled you've closed this as I'm still experiencing the hanging problem. To try to settle the version issue I used pip3 to uninstall rshell and deleted the directories in /usr/local/lib/python3.4/dist-packages. I then reinstalled it with pip3 checking that the code had re-appeared in the same location. I then cloned your repository into ~/temp using
Finally I ran the following checks, which have convinced me I'm running the right version - but if I'm doing something dumb do please enlighten me!
|
The closing wasn't intentional. I must have just clicked on the wrong button. |
I just wanted to make sure you were using the pip installed version, because I seem to recall fixing a few issues. I'm homing in on the issue (I think). At least for me on the Nucleo. I suspect that your problem is somehow related. Could you try with --buffer-size=30 and see if that makes any difference? |
Yes! A quick test was successful: I copied a small file to /sd, 'cat'-ed it and deleted it all OK. |
What seems to be happening is that something slowed down a bit and rshell is no longer processing buffers as quickly as it used to. rshell has a default bufer size of 512, however, the UART only has a buffer of 32 (or maybe 64). This host side sends a buffer of data and waits for an ACK before sending another buffer worth of data. If the micropython side processes the data quickly enough then it can deal with more than the UART buffer worth, however, it seems like we were really close to the edge of "running in real-time" and something has slowed down enough that the python side is taking more than a character time to process each character. All it takes is one character to be dropped and the file transfer grinds to a halt. Now to figure out a workaround. |
ctrl S ctrl Q flow control in the UART driver? Alas it would need a firmware change, but perhaps a useful option. Another one I get occasionally on a USB connection is this "serial port /dev/pyboard closed". It's benign in that you can restart the link and carry on, but I thought it worth mentioning. The sequence below was just after dropping back from the REPL with ctrl X. After the error I hit ctrl D and fired up rshell again, without resetting the Pyboard.
|
SD card contains only boot.py:
Typical rshell session copying a 2.9KB file (I don't always get trace data: sometimes it just hangs)
This seems similar to using rshell with the WiPy: most functionality works except for cp.
The text was updated successfully, but these errors were encountered: