Question about uart_rx_one_char

jmcornil
Posts: 9
Joined: Mon Feb 10, 2020 1:42 pm

Question about uart_rx_one_char

Postby jmcornil » Mon Feb 17, 2020 9:47 am

Hello everybody

As I wanted a mean to drive a program with a simple char key pressed, and after searching the web, I found the uart_rx_one_char and uart_rx_one_char_block functions.

In order to wait a char, I can use each of these functions in a task and they work like a charm when I use

Code: Select all

idf.py flash monitor

But if I use an external monitor, like minicom, I get no result, that is my first question : why ? Which is the channel on which these functions are waiting and is it possible to change it ?

Then I dig the web and search info on these functions, but I get very little. So the following questions.
  • I read that they are "rom function" and I saw in the esp-ide components lot of "rom" folder. Among these, I found the "esp32/rom/uart.h" file that contains the prototypes. I also see an address provided by a .ld file. But what is here the meaning of "rom" : are these functions in a ROM of the chip?
  • I also found that I can use such a function without any UART initialization ; so are they totally independent of the UARTs?
Sorry if you find these questions elementary but I am new to ESP32 and I find the doc very scattered.
Thanks in advance for any answer or any useful link.
Best regards

PeterR
Posts: 311
Joined: Mon Jun 04, 2018 2:47 pm

Re: Question about uart_rx_one_char

Postby PeterR » Mon Feb 17, 2020 10:22 am

You have swapped idy.py for minicom.exe. That's all.
The change is therefore at the PC side, forget ROM and ESP drivers.
Probably your minicom serial port settings are wrong, baud rate, parity etc?
If you have several serial ports then again you will need to check your minicom serial port settings.

jmcornil
Posts: 9
Joined: Mon Feb 10, 2020 1:42 pm

Re: Question about uart_rx_one_char

Postby jmcornil » Mon Feb 17, 2020 11:22 am

Hello and thank you for your quick answer
PeterR wrote:
Mon Feb 17, 2020 10:22 am
You have swapped idy.py for minicom.exe. That's all.
I don't understand what you are meaning by "swap". I type

Code: Select all

idf.py flash
and then

Code: Select all

minicom
without .exe for I work with linux


PeterR wrote:
Mon Feb 17, 2020 10:22 am
Probably your minicom serial port settings are wrong, baud rate, parity etc?
If you have several serial ports then again you will need to check your minicom serial port settings.
I think that the settings of minicom are OK for it works fine with "printf".
Can it be a difference between input and ouput ?

PeterR
Posts: 311
Joined: Mon Jun 04, 2018 2:47 pm

Re: Question about uart_rx_one_char

Postby PeterR » Mon Feb 17, 2020 6:30 pm

No, in/out settings are the same.

Are you saying that you can see ESP32 log messages on minicom but your ESP program will not respond when you hit a key but did when you used idf.py?

If so minicom may be set up with flow control. Set the flow control to none.

jmcornil
Posts: 9
Joined: Mon Feb 10, 2020 1:42 pm

Re: Question about uart_rx_one_char

Postby jmcornil » Tue Feb 18, 2020 9:39 am

Oh thank you very much !
It was the flow control material which was ON
I put it OFF and all is OK.

But do you know wher I ca find documentation on these ROM functions ?

Best regards

Who is online

Users browsing this forum: No registered users and 17 guests