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

Serial not works on ESP-IDF5 #1367

Open
stc1988 opened this issue Jul 7, 2024 · 5 comments
Open

Serial not works on ESP-IDF5 #1367

stc1988 opened this issue Jul 7, 2024 · 5 comments

Comments

@stc1988
Copy link
Contributor

stc1988 commented Jul 7, 2024

Build environment: macOS
Moddable SDK version: 3bf5202
Target device: M5Stack, M5Stack_core2, Moddable_two

Steps to Reproduce

  1. Build and install the appexamples/io/serial/echo using this build command: mcconfig -d -m -p esp32/m5stack
  2. Quit xsbug
  3. Open esp-web-tools in browser
  4. Connect device and see Logs & Console
  5. Reset Device

Device keeps restarting.

Other information

It works in Moddable V4.1 and ESP-IDF v.4.2.3, so it seem to be affected by updating to ESP-IDF v5

@phoddie
Copy link
Collaborator

phoddie commented Jul 16, 2024

This might not be a bug.

You are using a debug build. On Moddable Two, that means that pins 1 and 3 are reserved for xsbug communication. Those pins are the default for a new serial connection, so the echo example is trying to use them. The Moddable SDK was updated some time ago to reserve the pins used by xsbug so that a project cannot interfere with the xsbug communication.

Please try using an instrumented build (-i instead of -d) or set the transmit and receive serial constructor options to unused pins.

@phoddie
Copy link
Collaborator

phoddie commented Aug 7, 2024

This issue has been idle for a bit. Is there an update?

@stc1988
Copy link
Contributor Author

stc1988 commented Aug 7, 2024

I’m sorry for the delayed report. The situation is stuck, and using the instrumented build or setting transmit and receive did not resolve it.
To add a bit of context, this issue stems from the recent problem of the stack-chan’s serial servo motor not working.

@phoddie
Copy link
Collaborator

phoddie commented Aug 8, 2024

I looked into this a bit more. I used Moddable Two, since that was listed in your report.

For a debug build, using the default pins throws an exception as expected. Changing them (I used 16 for transmit and 17 for receive) does not throw an exception (as expected).

For an instrumented build, no exception is thrown with the default pins. But... it does seem to hang - at least the serial port is not responding. Changing the port from 2 to 1 allows it to work with the default pins. I don't know why. Changing the transmit and receive as above, does work with port 2.

After some further experimentation, it seems that in IDF v5 port 2 is incompatible with the default pins (transmit 1 and receive 3).

@stc1988
Copy link
Contributor Author

stc1988 commented Aug 11, 2024

Instrumented build + using port 1 is works as expected.
Debug build also does not throw an exception but it seems that serial communication does not works.

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

2 participants