-
Notifications
You must be signed in to change notification settings - Fork 1.3k
"could not complete raw paste" on SeeedStudio XIAO-ESP32C3 #8658
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
Comments
The same device (SeeedStudio XIAO-ESP32C3) is having problems also when trying to write files via the plain raw-REPL mode or via plain paste mode. In paste mode the echo starts going slightly off after a while, in raw mode the OK confirmation does not appear. Nevertheless, I don't think the problem is specific to writing files. I changed the file writing procedure to a no-op, but made sure that the amount of serial communication stayed the same. The problem still persisted. |
Oh, the ESP32-Cx serial implementation is at fault here, no doubt about that. |
The problem persists in CP 9.0b0. I wonder why is this issue in the "Long term" milestone? Is it too hard to be handled sooner or is it considered low priority? |
Thanks for retesting! It's a low priority because we only have one C3 board from Adafruit. It is hard to know difficulty until after it has been debugged and fixed. |
This is not a solution by any means but if you're keen on getting something working.... I have been able to use these board by uploading files using a serial transfer program similar to the way mpremote works. It's a little unfinished as I got it working "well enough" and left it at that. The UI is a bit weird but once you get used to it, works ok. https://github.com/RetiredWizard/Serial-File-Manager |
I have used ampy and the web file.manager without issue on c3 devices. With 8.2 through 9.1-beta. |
Nice, I knew about ampy (https://learn.adafruit.com/micropython-basics-load-files-and-run-code/install-ampy) once but completely forgot about it. |
I've also been experiencing this on my TinyC6 and had to use a modified version of the Serial-File-Manager by @RetiredWizard to be able to communicate with my C6 boards running CP when under test on my test jigs. It would be great if we could work out what this is as it seems to be specific to the Espressif serial UART setup in their C3/C6 chips, so will likely effect the H2, C61 and C5. |
There is a non-zero chance that @aivarannamaa can fix something in Thonny and it will work. But it would be good to understand exactly what the problem is. There seem to be solutions that work. (But I suspect that the problem lies with Ampy itself) I like the web file manager solution, thanks a lot for the tip, I'll give it a try |
Since the C3 was on my mind, I pulled one out for a project I was working on yesterday. I did use ampy to get the initial settings.toml file loaded, but once it was connected to WiFi, I used the Web Workflow for everything. The File Browser to transfer files, the Internet based full code editor and associated internet based serial interface (not the CP hosted serital console) and everything went very smoothly. I was even able to use the Web Workflow feature of Circup to check and update the libraries on the device. It was an enjoyable workflow to use although I don't believe, other than Circup for the libraries the Web Workflow can be used to transfer files via a script (yet?). Using Web Workflow is definitely another option to consider until the current serial UART isses are resolved. |
Can confirm that Web Workflow can be a sort of workaround.
I'm not sure how to use CircUp in the case of Web Workflow, it only tries to detect serial connections. Would be great if you could share how you achieve this. |
I've been doing some thorough testing of Ampy with my TinyC6 on my test jig setup - and I can confirm the issue is still present, but it's it succeeds more often than it fails. 90% of the time it works and I can The rest of the times a This is way better than what I have been experiencing with I'm unable to use a web-worlflow for my use case - it needs to be USB based serial comms. |
As there is some variety of very valuable in terms of makers chips, perhaps it is worth considering creating a new thread topic? Or maybe change the name to this one? |
Well, the C3 and C6 both use the same UART peripheral, so whatever works or doesn't work for one, will be the same for the other, and all new chips from Espressif that use the same peripheral, like the C5, C61 and I believe the H2 + H4 will also have the same issues, so I think it's relevant token this here and not part multiple threads. |
EDIT: I just re-read your message and the error you indicated actually suggests that your host machine can't reach the internet to get the full code editor and not a C3 WiFi range issue. In early testing I remember getting that message but I don't remember why it was happening. I haven't seen it recently. |
@RetiredWizard The problem lies in my browser settings. They're too restrictive. I've created a special profile to work with C3, although it's a rather controversial solution. |
Research this in esp-idf issues. See if increasing our buffer size would help. |
The larger buffer may help, but it looks to me like there's an XOFF/XON functionality missing. Once the buffer is full, the data seems to continue to flow and just get lost. I was trying to paste code into the REPL (after pressing CTRL-E) on an ESP32 Sunton board today and had to break the copy/pastes into smaller blocks because attempting to copy the whole file, about 24 lines of code, didn't work. The first few lines seem to paste fine but then some of the characters were dropped from the remaining text. The display board may exaggerate the issue because the speed of the REPL appears to be reduced dramatically when it's being displayed on the attached display. |
USB-serial converters don't need to literally send XON/XOFF in-band, usually, because they are able just to stall the USB transfer to do flow control. However, that is apparently not enabled or something on these C3 builds. I haven't looked at the code yet. |
Does anyone have a simpler reproduction case that involves just pasting into the REPL or similar, and not using a file manager? I tried pasting long lines, and they seem fine with 9.0.3 on the QT Py ESP32-C3. |
Did you mean ESP32-S3? I think this issue shows up on chips that don't support the Circuitpy drive, i.e. ESP32, ESP32-C3, ESP32-C6. |
No, sorry, that was a typo, and is fixed to C3. |
For me, plain ESP32 has been rock solid. I have only had issues on ESP-Cx. |
I've tried with both a QTPY Esp32-C3 and a SeeedXIAO-ESP32C3 to paste directly into the REPL after pressing CTRL-E, and the smaller pastes ~1.5k surprised me by working fine. When I tried pasting a larger python script (about 12.5k) the paste failed and left the board in a weird state. It didn't recognize Control keys and each key press seemed to process a bit of the paste buffer. I also tried an ItsyBitsy ESP32 and the paste into the REPL (CTRL-E) failed on the smaller 1.5K file but didn't leave the board in the strange state so perhaps there is a different issue on the ESP32. |
The USB-serial-jtag peripheral on the C3/C6 seems to have almost no configurable options. The doc seems to imply it will do USB stalling until its FIFO is read: https://docs.espressif.com/projects/esp-idf/en/stable/esp32c3/api-guides/usb-serial-jtag-console.html#data-buffering. But that is a rather high-level description of what is going on. |
Does the USB-to-Serial bridge chip mentioned here refer to a chip on these development boards?
If so, is this saying there is no flow control between these chips and the C3? |
There are no external chips. The Serial JTAG bridge is inside the C3/C6. It's a native peripheral. |
Chapter 30 in https://www.espressif.com/sites/default/files/documentation/esp32-c3_technical_reference_manual_en.pdf describes the peripheral. It is fairly autonomous in what it does. |
FYI, working from a Linux PC and connected with
For text files, I have noticed inconsistent behaviour of some other similar solutions I have tried: they worked very well at times and then stopped to work, it seems the serial connection is not stable in my setup, but I couldn't manage to find why so far. |
Could folks retry with 9.1.0? We fixed some things that improved C6 serial, and C3 serial might also be better. |
I tried both the ~1K and ~12K pastes into a Ctrl-E repl and both worked perfectly on the QTPY ESP32-C3. I then used Thonny to upload about 180 files (~800K) without issue. I also used mpremote to copy a 50K file without issue. Using 9.1.0, the ItsyBitsy ESP32 still won't paste even the smaller 1K file properly but perhaps that's a separate issue. |
@RetiredWizard: do you have any further information? I also have problems with the paste-mode on ESP32 (not ESP32-xx) chips. When CTRL-E pasting even only a few lines of code, some lines in between are just swallowed and I usually end up with invalid code in the REPL. Even with "normal paste" I have to be very careful and anything larger than 64 characters fails (it just seems to hang). And btw, I also have other problems with the REPL on ESP32, see #9362. Might also be related to the serial connection. |
I will give a try soon to 9.1.0. For those interested and using Linux host PC you could try this to read pasted contents and write files on the REPL side (and pasting as mentioned here)
Then you run |
@RetiredWizard But so far the research is very superficial. The overheating of the chip (which seemed to indicate a deeper problem) has also disappeared. upd: I've uploaded a lot of files without any problems. Looks like the problem has been fixed. |
Based on @berkut0's and others' testing I'm going to close this. @aivarannamaa if you still see this we can reopen it. |
CircuitPython version
Code/REPL
Behavior
Similar issue was discussed in the context of Thonny (#7158), but the problem is reproducible also with
mpremote
(version 1.21.0).Tried CP 8.2.8 and 9.0.0a5 on macOS Sonoma, Windows 11 and Ubuntu 23.10, also tried CP 8.1.0 on Ubuntu. All these tests failed in similar way -- mpremote would start writing the file but after a while wouldn't get raw paste confirmation from the device (it times out while trying to read a single byte).
I tried to upload this file: https://raw.githubusercontent.com/thonny/thonny/397679cd8f7eb11b20ba9075c694337f5aace54b/data/circuitpython-variants-esptool.json
When I cancelled the wait I got tracebacks like this (the first line shows the mpremote command line I used):
Description
No response
Additional information
The text was updated successfully, but these errors were encountered: