can esp32 program receive serial text via usb flashing cable?

ethelstan
Posts: 2
Joined: Wed Sep 04, 2019 11:05 pm

can esp32 program receive serial text via usb flashing cable?

Postby ethelstan » Wed Sep 04, 2019 11:29 pm

Dear Forum,

newbie question:

it is possible for an ESP32 program to receive serial text/data via the usb cable/connector used to flash it? I thought this might be possible as when using the Arduino IDE this is possible with serial.read etc. using the serial monitor.

I have only managed to find information on serial communication in the esp-idf using the 3 UART channels (e.g. with USB-serial cables), rather than the USB cable.

Apologies if this has been asked before and many thanks for any help.

ESP_Sprite
Posts: 9769
Joined: Thu Nov 26, 2015 4:08 am

Re: can esp32 program receive serial text via usb flashing cable?

Postby ESP_Sprite » Thu Sep 05, 2019 3:02 am

Yes, the 'usb flashing cable' you have normally ends up in an usb-to-serial converter on your devboard (separate chip from the ESP32), which is connected to UART0 of the ESP32. All in all, you can just access it like any other serial port.

ethelstan
Posts: 2
Joined: Wed Sep 04, 2019 11:05 pm

Re: can esp32 program receive serial text via usb flashing cable?

Postby ethelstan » Thu Sep 05, 2019 11:33 am

many thanks ESP_Sprite!

I got it working on linux with the example code at:
https://github.com/espressif/esp-idf/bl ... ple_main.c
changing UART_1 to UART_0, as well as the pin numbers.
(took me ages to realize I had to turn off hardware control on minicom though!).

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], dzungpv, ESPBoards, MicroController, ok-home and 128 guests