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

Console demo does not read serial data when pin numbers are changed. (IDFGH-505) #2843

Closed
tommessick opened this issue Dec 17, 2018 · 6 comments

Comments

@tommessick
Copy link

Environment

  • Development Kit: none
  • Module or chip used: ESP32-WROOM-32
  • IDF version: v3.3-dev-424-g8b885fb93
  • Build System: Make
  • Compiler version: crosstool-ng-1.22.0-80-g6c4433a
  • Operating System: Linux
  • Power Supply: external 5V

I am running the console example from the IDF. If I build it with no changes it uses UART0 over the default pins and works fine.

The ESP32-WROOM-32 is on a board with an RS232 port through a MAX3232. Pin 32 is TX and pin 33 is RX. I have code that sends and receives data over these pins so I am sure they are wired up correctly.

If I use make menuconfig to configure the console to use pins 32 and 33 the console demo prints to the serial port but cannot receive any data.

I don't have a JTAG debugger. In uart.c uart_rx_intr_handler_default() there is code to check for these bits:
UART_RXFIFO_TOUT_INT_ST_M
UART_RXFIFO_FULL_INT_ST_M
UART_AT_CMD_CHAR_DET_INT_ST_M
I have modified uart.c to cause an exception when a character is received. I get the exception when i use the original UART setup but not when I switch to the other pins.

I have used make menuconfig to select UART0 or UART1 with the same results.

sdkconfig.txt
uart.c.txt

@Alvin1Zhang Alvin1Zhang changed the title Console demo does not read serial data when pin numbers are changed. [TW#27975] Console demo does not read serial data when pin numbers are changed. Dec 17, 2018
@koobest
Copy link
Contributor

koobest commented Dec 17, 2018

Can you provide you UART pin configuration?

@tommessick
Copy link
Author

This is the unaltered example from the IDF in examples/system/console.

@koobest
Copy link
Contributor

koobest commented Dec 17, 2018

@tommessick
You need to configure the pins, because the default log output uses UART0 and the pins are already configured during the boot stage.

@tommessick
Copy link
Author

Adding this line:

gpio_set_direction(GPIO_NUM_33, `GPIO_MODE_DEF_INPUT);

before the call to initialize_console() fixed the problem.
Thanks.

@igrr igrr reopened this Dec 19, 2018
@igrr
Copy link
Member

igrr commented Dec 19, 2018

Thanks for the feedback, will keep this open until this is fixed in IDF.

@projectgus projectgus changed the title [TW#27975] Console demo does not read serial data when pin numbers are changed. Console demo does not read serial data when pin numbers are changed. (IDFGH-505) Mar 12, 2019
@KonstantinKondrashov
Copy link
Collaborator

Fix for this issue is in our internal repo, it will be merged as soon as possible. Thanks.

@igrr igrr closed this as completed in 98c77ce May 21, 2019
igrr pushed a commit that referenced this issue Jun 3, 2019
The RXD pin is assigned as input (fix for custom uart option).

Closes: #2843

Closes: IDFGH-505
igrr pushed a commit that referenced this issue Jun 5, 2019
The RXD pin is assigned as input (fix for custom uart option).

Closes: #2843

Closes: IDFGH-505
igrr pushed a commit that referenced this issue Jun 21, 2019
The RXD pin is assigned as input (fix for custom uart option).

Closes: #2843

Closes: IDFGH-505
trombik pushed a commit to trombik/esp-idf that referenced this issue Aug 9, 2019
The RXD pin is assigned as input (fix for custom uart option).

Closes: espressif#2843

Closes: IDFGH-505
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

4 participants