-
Notifications
You must be signed in to change notification settings - Fork 238
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
mcrun hangs on esp32-c3 (linux host) #1115
Comments
Hello @tve, I've been able to reproduce this. As you note in step 8 above, the host accepts the mod and runs fine after you kill mcrun and reattach to xsbug. In step #8 above, instead of doing a reinstall, you could use the xsbug target:
or launch serial2xsbug directly:
|
Thanks for testing and the workarounds! Unfortunately, running serial2xsbug manually doesn't help for me. Yes, the mod runs but the process hangs the same again and the xsbug connection thus doesn't work. The |
@tve - does your board have a reset button? If so, I'd be interested to know what happens if you hit that after you into the stalled state with mcrun (step 5 above). |
Pressing reset has no visible effect. Not in the mcrun terminal nor in xsbug. |
Thanks for trying. We've been looking into this further here. There is at least one strange behavior (bug) in the ESP32-C3 around USB that is complicating this. Hope to have some news in the coming days. |
Has there been any update on this? What is the "strange behavior (bug)"? I'm kind'a stuck on this at the moment... Thanks! |
@tve, I'm sorry I don't have a good answer for you yet. We have been working on it - the issue combines multiple devices (esp32, nrf52, etc.), access methods (serial, usb and uart) and hosts (mac, lin, win). The issue I'm currently seeing for the esp32/lolin_c3pico (and other usb-cdc-jtag devices) is that the device doesn't appear to read from the usb_serial_jtag driver after the rts/dtr reset. |
Q: can you reproduce the issue reliably? If so, would it help if you describe to me how to repro and what you're observing? I would give it a spin myself... |
I can reproduce the issue reliably. |
@tve, I'm working through windows right now, but I've got a patch that should work for you on Linux or macOS. If you're willing to try, checkout the |
I worked through esp32/lolin_c3mini and esp32/lolin_s2mini (and moddable_two). I'll eventually need to make a pass through the set to ensure they all operate. If you have problems, let me know. There are suggestive prompts in the output on when to press reset, etc. The s2 is a little picky about the reset. |
I rebased my fork on your branch and applied the patch. Good news is that I managed to load/run a mod a couple of times. Bad news is that the third or fourth time it hung and I couldn't ctrl-C:
Killing the stuck processes and re-running mcrun resulted in the same. Power cycling the board (and killing the processes again) made it work again. Update: I turned on mxTrace and mxTraceCommands and here it happened again. What you see is the last trace from the previous mcrun and then the new mcrun (it gets restarted by nodemon when I save a source file):
If I disconnect the USB cable when it's hung nothing happens. Serial2xsbug should get signals/errors that the serial device is gone and that should make it react somehow, no? |
One issue I'm also having is that WaitForNewSerialLinux (used by mcconfig) does not work for me. It just sits there printing dots waiting for the serial device to disappear. Not sure what would make it go away... |
If the first parameter is set, and the device is already mounted, we will wait for it to disappear and reappear. That is, we are waiting for the reset of the device which is indicated by the /dev/ttyACM0 device (for example) disappearing and reappearing. I've had good luck with the I've also found that I only need to press the RST button, and not the "9" button to get the host firmware installed. |
This is not working for me. Why do you need to do this? In the end you just call esptool.py and it deals with the flashing, no? Also, I really do not want to have to press a button (it's not prompting for that, so dunno whether I'm expected to). |
For a mod? No. It is installed through the debugger connection by |
My comment was about mcconfig. It's a bit off-topic, but the issue appeared with this branch&patch (unless it was there before and I had already commented out the whole reset thing, I don't remember). |
Build environment: Linux
Target device: Lolin C3 Pico (very similar to Adafruit qtpyc3, the differences don't matter here)
Description
Tooling / debugging hangs when using a host + mods
Steps to Reproduce
esptool -d /dev/ttyACM0 erase_flash
mcconfig -d -m -p esp32/qtpyc3
(the Alive... is printed every 10 seconds)
4. Build and attempt to load ReproApp using
mcrun -d -m -p esp32/qtpyc3
5. Observe that xsbug uploads the mod and restarts the esp32, but then hangs; it cannot be aborted using ctrl-C
The output from a build with tracing enabled:
Host
manifest.json:
main.js
Mod
manifest.json
app.js
The text was updated successfully, but these errors were encountered: