Problem using Make Flash in command line [solved]

salomonreinach
Posts: 18
Joined: Tue Jan 08, 2019 11:57 am

Problem using Make Flash in command line [solved]

Postby salomonreinach » Wed Feb 06, 2019 1:05 pm

Hi all,

I'm trying to flash my ESP32 but I have that kind of error which seems more or less common :

Code: Select all

Flashing binaries to serial port /dev/ttyUSB0 (app at offset 0x10000)...
esptool.py v2.6-beta1
Serial port /dev/ttyUSB0
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
/home/rem/esp/esp-idf/components/esptool_py/Makefile.projbuild:62 : la recette pour la cible « flash » a échouée
make: *** (flash) Erreur 2
I tried all the suggestions in the different topics : change the USB cable, put the GPIO0 pin to a GND while connecting,change the USB port,...

The weird thing is that I can flash using the command in the esp/openocd-esp32 file:

Code: Select all

openocd -f tcl/interface/ftdi/olimex-arm-usb-ocd-h.cfg -f tcl/target/esp32.cfg -c "program_esp32 myproject.bin  0x10000 verify exit"
As you can see I'm using the olimex-arm-usb-ocd-h with JTAG. How could you explain I can flash using that command but I can't using make flash ?

I would like to use eclipse and see the output of my esp using the make monitor command to see for example wifi scan. But it is the same error when I want to flash from eclipse. The only way I found to see my wifi scan is using the debug mode in eclipse and seeing the values in the variables.

Do you have any ideas how I could see my results and the print messages I used in my code ? When I'm using make monitor I only have the lines in the attach file.

I'm using :
Eclipse IDE for C/C++ Developers

Version: 2018-12 (4.10.0)

Thank you for your help :D
Attachments
Capture du 2019-02-06 13-58-47.png
Capture du 2019-02-06 13-58-47.png (39.76 KiB) Viewed 12893 times
Last edited by salomonreinach on Wed Feb 13, 2019 8:40 am, edited 1 time in total.

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: Problem using Make Flash in command line

Postby ESP_igrr » Wed Feb 06, 2019 1:35 pm

Which development board are you using? Based on lack of monitor output, it seems that /dev/ttyUSB0 is not connected to the UART of ESP32. If you see multiple /dev/ttyUSBx ports in your system, you might try other ports and see if one of them works.

salomonreinach
Posts: 18
Joined: Tue Jan 08, 2019 11:57 am

Re: Problem using Make Flash in command line

Postby salomonreinach » Wed Feb 06, 2019 1:45 pm

I'm using the ESP-WROOM 32 without a development board, just the ESP32 module connected with JTAG to the olimex arm usb ocd h.

It seems that I only have ttyUSB0 in my dev file. Else it's only ttyXX ot ttySXX
Attachments
Capture du 2019-02-06 14-45-17.png
Capture du 2019-02-06 14-45-17.png (117.61 KiB) Viewed 12882 times

User avatar
ESP_krzychb
Posts: 400
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Problem using Make Flash in command line

Postby ESP_krzychb » Wed Feb 06, 2019 1:49 pm

Hi salomonreinach,
salomonreinach wrote:
Wed Feb 06, 2019 1:05 pm
As you can see I'm using the olimex-arm-usb-ocd-h with JTAG. How could you explain I can flash using that command but I can't using make flash ?

With "make flash" you are using serial pins U0TXD (GPIO1) / U0RXD (GPIO3) for program upload and GPIO0 to put the ESP32 into download mode. You should see "waiting for download" message on the monitor if you select correct USB port, pull GPIO0 down and this interface works correctly, see also viewtopic.php?f=12&t=9103&p=38027#p38024

On the other hand with JTAG you send the program using JTAG interface pins GPIO12, GPIO13, GPIO14, GPIO15 and EN.

salomonreinach
Posts: 18
Joined: Tue Jan 08, 2019 11:57 am

Re: Problem using Make Flash in command line

Postby salomonreinach » Wed Feb 06, 2019 1:50 pm

And when I'm running

Code: Select all

ls /dev/tty*
it's the ttyUSB0 that appear and disappear when I plugged and unplugged my esp32.
Attachments
Capture du 2019-02-06 14-49-15.png
Capture du 2019-02-06 14-49-15.png (113.23 KiB) Viewed 12878 times

User avatar
ESP_krzychb
Posts: 400
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Problem using Make Flash in command line

Postby ESP_krzychb » Wed Feb 06, 2019 1:57 pm

I believe the single ttyUSB0 you see is associated with olimex-arm-usb-ocd-h and works for the JTAG interface only. To flash with "make flash" you need a separate USB-to-serial interface dongle connected to the UART pins I mentioned above.

salomonreinach
Posts: 18
Joined: Tue Jan 08, 2019 11:57 am

Re: Problem using Make Flash in command line

Postby salomonreinach » Wed Feb 06, 2019 2:02 pm

Ok thank you for your answer, I also can't use the make monitor command with JTAG but with a serial interface using TXd and RXD pin ?
Or is there an other solution to see my messages in the code I send to the ESP32 elsewhere than in the debug mode ?

User avatar
ESP_krzychb
Posts: 400
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Problem using Make Flash in command line

Postby ESP_krzychb » Wed Feb 06, 2019 2:17 pm

The command "make monitor" works over the serial interface. You need an extra USB dongle connected to TXD and RXD pins.

To avoid multiple wires and two additional physical devices (one for JTAG debugging and one for serial logs) please consider https://docs.espressif.com/projects/esp ... r-kit-v4-1

How it works is described in https://docs.espressif.com/projects/esp ... w-it-works

salomonreinach
Posts: 18
Joined: Tue Jan 08, 2019 11:57 am

Re: Problem using Make Flash in command line

Postby salomonreinach » Wed Feb 06, 2019 2:21 pm

Thank you very much for your answers :)

Who is online

Users browsing this forum: Google [Bot] and 68 guests