-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
system/console/basic example does not work on ESP32-S3 using USB serial/jtag controller (IDFGH-8166) #9662
Closed
3 tasks done
Labels
Resolution: Done
Issue is done internally
Status: Done
Issue is done internally
Type: Bug
bugs in IDF
Comments
Oh, and kudos for the new form for reporting bugs. That's nice! |
github-actions
bot
changed the title
system/console/basic example does not work on ESP32-S3 using USB serial/jtag controller
system/console/basic example does not work on ESP32-S3 using USB serial/jtag controller (IDFGH-8166)
Aug 28, 2022
Also, while this is the simplest case, many of the other examples that build on this also fail (I found this by trying to run examples/peripherals/i2c/i2c_tools). |
espressif-bot
added
Status: In Progress
Work is in progress
and removed
Status: Opened
Issue is new
labels
Aug 30, 2022
Thank you for reporting the issue! The fix is in review, and should be merged soon. I'm also attaching the patch file. |
espressif-bot
added
Status: Reviewing
Issue is being reviewed
Resolution: NA
Issue resolution is unavailable
Status: Done
Issue is done internally
Resolution: Done
Issue is done internally
and removed
Status: In Progress
Work is in progress
Status: Reviewing
Issue is being reviewed
Resolution: NA
Issue resolution is unavailable
labels
Aug 30, 2022
espressif-bot
pushed a commit
that referenced
this issue
Sep 22, 2022
The crash occurred when calling setvbuf(stdin,...) with stdin==NULL. This happened because esp_console_repl_task started running before its args->uart_channel was initialized; then esp_console_repl_task went into the code path 'uart_channel != CONFIG_ESP_CONSOLE_UART_NUM', and tried to 'fopen("/dev/uart/0");` Since the UART VFS is not registered when ESP_CONSOLE_USB_SERIAL_JTAG option is enabled, fopen failed and 'stdin' was NULL. Fix by moving the initialization of repl task arguments before the start of the task, same as it is done for the usb_cdcacm case. The crash started happening after the commit 287ab75. I haven’t verified this, but I guess the reason why it wasn’t happening before was that xTaskCreate was not correctly yielding to the newly created higher-priority 'repl' task, therefore the code which was setting the repl task arguments after xTaskCreate had time to execute. It should be noted that the 'uart_channel' argument is a bit hacky, in the first place. The code should be refactored to pass a callback function to the repl task, and let this callback initialize stdin and stdout based on the chosen console channel. Then esp_console_repl_task does not require assumptions about the specific interface used. Closes #9662
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Resolution: Done
Issue is done internally
Status: Done
Issue is done internally
Type: Bug
bugs in IDF
Answers checklist.
IDF version.
v5.1-dev-437-g5c1044d84d
Operating System used.
macOS
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
No response
Development Kit.
ESP32-S3-DevKit-C v1.0
Power Supply used.
USB
What is the expected behavior?
I tried to run the system/console/basic example when configured for the USB serial/jtag controller. I expected a working command line console over the USB port. I've seen this work in previous snapshots of the ESP-IDF.
What is the actual behavior?
The board goes into a continuous loop with the following console output:
Steps to reproduce.
Debug Logs.
No response
More Information.
The usb serial/jtag controller works, as my own code (which doesn't use esp_console_repl_task, but a broken out variant) is working just fine with the same version of ESP-IDF.
This is not the same as issue IDFGH-7840 (#9369), as the stack trace differs (and that bug was fixed).
Running the system/console/basic example in v5.1-dev-97-g1b51788872 works just fine, so this is a regression.
The text was updated successfully, but these errors were encountered: