Page 1 of 1

ESP-Prog suddenly not working after working for long time. Replaced, still not working.

Posted: Mon Jan 30, 2023 11:13 am
by haddow777
Hello, I've been programming for weeks now with a NODEMCU ESP-32S V1 plugged in through the ESP-Prog's JTAG and Serial interfaces. I have it interfacing through PlatformIO on a mac. I have used it many times to upload firmware into the ESP32 and run it.
Tonight, it suddenly stopped loading code up. I keep getting errors like these:

Code: Select all

** Programming Started **
** Programming Finished in 4932 ms **
** Verify Started **
** Verify OK **
** Programming Started **
Error: timed out while waiting for target halted
Error: xtensa_wait_algorithm: not halted 0, pc 0x4000c2e0, ps 0x60e23
Error: Failed to wait algorithm (-302)!
Error: Algorithm run failed (-302)!
Error: Target is already running an algorithm
Error: Failed to start algorithm (-4)!
Error: Target is already running an algorithm
Error: Failed to start algorithm (-4)!
** Programming Finished in 40496 ms **
** Verify Started **
Error: Target is already running an algorithm
Error: Failed to start algorithm (-4)!
Error: **** Verification failure! ****
Error: target_hash 000...6f726d
Error: file_hash: 21e9f9...4ca966
embedded:startup.tcl:1184: Error: ** Verify Failed **
in procedure 'program_esp' 
in procedure 'program_error' called at file "/Users/Psycho/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 149
at file "embedded:startup.tcl", line 1184
*** [upload] Error 1
I figured, the connection must have gotten messed up. I checked and the USB port had changed. I updated it and the same thing. Here is the Platformio.ini:

Code: Select all

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
debug_tool = esp-prog
upload_protocol = esp-prog
upload_port = /dev/cu.usbserial-14200
lib_deps = 
	bblanchon/ArduinoJson@^6.20.0
	esphome/AsyncTCP-esphome@^2.0.0
There are two ports available, the one above and 14201. I tried both. In fact, I moved the USB cable around as before it was in the 100s. So, thing's I've tried. I checked for loos wire connections, found some that may be loose and replaced them. Checked all of them for connections, seem fine. Got a back up ESP32 and plugged it in directly and commented out the ESP-PROG configs. Worked fine. So I replaced the ESP32 in the setup. Still won't work. Finally I replaced the ESP-PROG with a backup, still the same. I've changed the USB port, some of the wires, the ESP32, and the ESP-Prog. I even hacked the code down to a Hello World blasted file. It's worked great for weeks now.

Any ideas at all? It's all wired in through a bread board, but would it suddenly become an issue after so long? Would wires just suddenly quit working? They are bread board wires, but still. Is there tools or config options that may give a better idea? I'm going to have to just forego using an ESP-PROG, which is super annoying, if just for the fact that I haven't had to hold down the blasted button every load for the last while. Any help would be awesome, thanks.

Re: ESP-Prog suddenly not working after working for long time. Replaced, still not working.

Posted: Mon Jan 30, 2023 10:53 pm
by haddow777
Update. I wanted to be sure. I made completely new setup. An ESP-Prog attached to an ESP32 board directly using completely new fresh wires. The wires are female on both sides so I could attached them directly to each board without including a breadboard. I even replaced the USB cable. Same problem.

Yesterday, I started using the AsyncTCP library to try it out. I had just installed it and run one test compile. It uploaded and ran. My test app connected to it through TCP, but I has placed a few print statements in the wrong spot. i corrected the minor mistake, and hit the upload button like I've been doing for weeks. It failed and has failed ever since. I can upload it directly to the ESP32 the normal way and it runs.

Does anyone have a clue what the issue could be? Is it possible my installing the AsyncTCP library updated some setting that would possibly allow it compile in once but then cause a failure after that? Does the fact that it uses another core for some operations possibly open the window to messing something up? Could the ESP32 Arduino library update behind the scenes while I'm just coding like that and have changed something that suddenly makes uploading through the ESP-Prog fail constantly?

I'm at a serious loss. It uploaded one second and started failing the second with no apparent changes to anything but some print statements. I've replaced every single physical component except for the laptop I have it connected to.

Re: ESP-Prog suddenly not working after working for long time. Replaced, still not working.

Posted: Mon Jan 30, 2023 11:37 pm
by haddow777
Second update. Okay, I don't really know if this is abnormal behavior or not, but I thought I would mention this just so everyone has all the details. First a technical detail I failed to mention. I'm running the power from the ESP-Prog to the ESP32 using 5v. It's running through the 5V pin and this was recommended in the wiring setup I followed. This is how it's always be powered.

Okay, so I tried to upload a sketch to the ESP32 directly through its USB connector while it was still wired to the ESP-Prog. I noticed that power was flowing from the ESP32 to the ESP-Prog, so I kind of expected this would cause strange behavior. In any event, the upload failed because it said the ESP32 was in the wrong boot mode, that it needed to be in download mode. I could see the ESP-Prog sending control signals that would conflict this way, so it's probably normal behavior, but I don't know for sure, so I thought I would mention it. Also, yes, I pushed the button as it was a direct upload this time.

I got out a second backup ESP32 and hooked it up directly. It uploaded just fine and worked.