-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
USB serial jtag console does not take input if enter is being pressed too soon (IDFGH-12989) #13940
Comments
@congyue Thanks for noticing this! I could reproduce this and it looks like a bug. We'll take a look and come back here once we know more about this. |
Hi @congyue, I seem to have isolated the issue that causes the console to freeze when pressing basically any key too quickly after restart. The USB Serial JTAG driver is initialized, the interrupt bit for data reception is cleared without checking if data has been received. So any input received before the driver is initialized is basically ignored it seems. I tried reading data (if any) before clearing the interrupt bit during initialization of the driver and it fixes the issue. I will keep you updated as I implement the fix properly and submit it for review internally. |
When data was sent through USB Serial JTAG before the driver was installed, the bus was malfunctioning. This was because the interrupt bit for data reception was cleared regardless of whether data was received or not. Consequently, usb_serial_jtag_isr_handler_default was not triggered and the data was never read causing the bus to malfunction. This commit is modifying usb_serial_jtag_driver_install to prevent clearing USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT and USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY thus allowing the callback usb_serial_jtag_isr_handler_default to trigger for possible data exchanged prior to the call to usb_serial_jtag_driver_install. This commit also modified the while logic in linenoiseProbe to discard any data that doesn't match the expected chaaracter sequences to prevent random input from interfering with evaluating whether the terminal supports escape sequences or not. See #13940
When data was sent through USB Serial JTAG before the driver was installed, the bus was malfunctioning. This was because the interrupt bit for data reception was cleared regardless of whether data was received or not. Consequently, usb_serial_jtag_isr_handler_default was not triggered and the data was never read causing the bus to malfunction. This commit is modifying usb_serial_jtag_driver_install to prevent clearing USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT and USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY thus allowing the callback usb_serial_jtag_isr_handler_default to trigger for possible data exchanged prior to the call to usb_serial_jtag_driver_install. This commit also modified the while logic in linenoiseProbe to discard any data that doesn't match the expected chaaracter sequences to prevent random input from interfering with evaluating whether the terminal supports escape sequences or not. See #13940
When data was sent through USB Serial JTAG before the driver was installed, the bus was malfunctioning. This was because the interrupt bit for data reception was cleared regardless of whether data was received or not. Consequently, usb_serial_jtag_isr_handler_default was not triggered and the data was never read causing the bus to malfunction. This commit is modifying usb_serial_jtag_driver_install to prevent clearing USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT and USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY thus allowing the callback usb_serial_jtag_isr_handler_default to trigger for possible data exchanged prior to the call to usb_serial_jtag_driver_install. This commit also modified the while logic in linenoiseProbe to discard any data that doesn't match the expected chaaracter sequences to prevent random input from interfering with evaluating whether the terminal supports escape sequences or not. See #13940
Closing the issue since it was fixed and merged (see 87b1e45) |
When data was sent through USB Serial JTAG before the driver was installed, the bus was malfunctioning. This was because the interrupt bit for data reception was cleared regardless of whether data was received or not. Consequently, usb_serial_jtag_isr_handler_default was not triggered and the data was never read causing the bus to malfunction. This commit is modifying usb_serial_jtag_driver_install to prevent clearing USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT and USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY thus allowing the callback usb_serial_jtag_isr_handler_default to trigger for possible data exchanged prior to the call to usb_serial_jtag_driver_install. This commit also modified the while logic in linenoiseProbe to discard any data that doesn't match the expected chaaracter sequences to prevent random input from interfering with evaluating whether the terminal supports escape sequences or not. See #13940
Answers checklist.
General issue report
Setup
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
Expected behavior
The console should work as expected:
Actual behavior
If developer tries to press enter too soon when the chip is still booting up, then the console won't take input anymore and the console seems frozen. e.g.
The impact for this issue would be:
If this is a feature instead of bug, may I know how to disable it? Thanks!
@igrr @mythbuster5
The text was updated successfully, but these errors were encountered: