Build is successful
Upload is successful
Debugging doesn’t work. I have a breakpoint on the setup method but when I select Run → Start Debugging, the breakpoint is not hit and the debug control panel displays:
Please, can anyone advise on what I’m doing wrong?
Thanks for your response, Max, and simplification of my platformio.ini but unfortunately the result is the similar.
Build and upload are successful but Run → Start Debugging results in:
Again, the debug panel shows the same; I can restart and stop but nothing else.
No breakpoints are hit.
I realise from the result screenshot that there is an issue with ‘Obsolete PIO Core v6.0.2’ but this doesn’t appear to be critical.
I’m new to the esp32 environment and debugging sounded to be a simple process. I’m really confused.
Have you any other suggestions?
I’ve removed debug_port = /dev/cu.usbserial-14100 from platformio.ini
The build is successful.
The upload responds in various ways. I’ve listed below the differences but in all ‘successful’ uploads the debug panel is the same as always
and no breakpoints are hit.
UPLOAD 1…
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
Warn : Unsupported syscall 3f4014c8!
Warn : Unsupported syscall ffffffff!
shutdown command invoked
============================================ [SUCCESS] Took 144.14 seconds ============================================
UPLOAD 2…
Warn : JTAG tap: esp32.cpu1 UNEXPECTED: 0x1a7285fd (mfg: 0x2fe (W5 Networks), part: 0xa728, ver: 0x1)
Error: JTAG tap: esp32.cpu1 expected 1 of 1: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Error: Trying to use configured scan chain anyway...
Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 2 -expected-id 0x00000000"
Error: auto0.tap: IR capture error; saw 0x0003 not 0x0001
Warn : Bypassing JTAG setup events due to errors
Warn : target esp32.cpu0 examination failed
Warn : target esp32.cpu1 examination failed
Error: auto0.tap: IR capture error; saw 0x0003 not 0x0001
Warn : Bypassing JTAG setup events due to errors
Error: Couldn't halt target before SoC reset
embedded:startup.tcl:1162: Error: ** Unable to reset target **
in procedure 'program_esp'
in procedure 'program_error' called at file "/Users/[USER]/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 93
at file "embedded:startup.tcl", line 1162
*** [upload] Error 1
============================================= [FAILED] Took 2.56 seconds =============================================
UPLOAD 3…
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
Warn : Unsupported syscall 3f4014c8!
Warn : xtensa_write_memory: esp32.cpu1: target not halted
Error: Failed to write ESP32_TIMG0WDT_PROTECT (-304)!
Warn : Unsupported syscall ffffffff!
Warn : Unsupported syscall ffffffff!
shutdown command invoked
============================================ [SUCCESS] Took 146.19 seconds ============================================
UPLOAD 4…
Warn : Unsupported syscall ffffffff!
...
... [repeated 19 times]
...
Warn : Unsupported syscall ffffffff!
Error: timed out while waiting for target halted
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
Warn : Unsupported syscall 3f4014c8!
Warn : Unsupported syscall ffffffff!
shutdown command invoked
============================================ [SUCCESS] Took 158.35 seconds ============================================
The connection seems to be quite unstable if it detects these wrong things… there are multiple biterrors there. However, you already set the connection speed down to 100khz…
Are you plugging the ESP-Prog directly into the dev board via female-to-female cables, without a breadboard? Have you tried other cables?
The cabling has been messy. Initially, I did use female-to-female cables between the esp-prog and the dev board. I’m currently using breadboards to mount the dev board with female-to-male and does appear to be more stable.
I’m also using 2 USB cables to power each board. I have occasionally used just 1 USB to the esp-prog and used the power supply from it to the dev board but opted to use 2 USB’s to at least be sure of the power supply. Which approach is better?
The upload now shows a consistent response which is:
Error: Failed to get flash maps (4294967295)!
Warn : Failed to get flash mappings (-4)!
Error: Failed to get flash maps (4294967295)!
Warn : Failed to get flash mappings (-4)!
** Programming Started **
** Programming Finished **
** Verify Started **
Error: **** Verification failure! ****
Error: target_hash f12b21...20e145
Error: file_hash: eee764...6ea591
embedded:startup.tcl:1162: Error: ** Verify Failed **
in procedure 'program_esp'
in procedure 'program_error' called at file "/Users/[USER]/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 135
at file "embedded:startup.tcl", line 1162
*** [upload] Error 1
============================================= [FAILED] Took 89.18 seconds =============================================
Hopefully this is narrowing the problem down but I’m still lost and your help is really, REALLY appreciated! Thank you!!
A common cause for this is to use the JTAG pins for something else, e.g. by wiring up LEDs, buttons or other peripherals or by configuring them in software as GPIO, I2C etc.
I recommend to upload the simplest firmware/sketch possible, like a Blink sketch using an LED pin that certainly does not conflict with JTAG.
I’m not using any other peripherals.
I’ve switched between 3 different dev boards but the results are the same.
I used a fresh set of wires and have checked my wiring matches this:
Looks ok except for VDD -> 5V. The ESP-Prog does not provide sufficient power to also feed the ESP32. It will become unreliable as it crashes when it gets insufficient power during spikes of power consumption.
Absolutely perfect!!! Thanks to maxgerhardt and manuelbl for patiently guiding me to a solution.
For the benefit of others - I’m a newbie with esp32 programming and my objective was to use an eps32 board with an esp-prog board to step-through debug a ‘Hello world’ app.
I believe the fundamental problem that I didn’t even realise I was experiencing was bad wiring, which maxgerhardt raised. I had been using wires between the boards but then mounting the dev board on a breadboard and using a new set of wires has certainly stabilised things. However, the wiring is still not perfect and I’m still getting an occasional error but now I know it means the cables need checking!
I also think that I caused problems for myself by finding ‘potential’ fixes to the various errors (misinterpreted by me) and over complicating platformio.ini, plus me adding things that ‘appeared’ to be a good idea. maxgerhardt advised substantially reducing platformio.ini and this eliminated conflicts I didn’t realise I’d invoked. This narrowed down and revealed a single error. Subsequently, manuelbl suggested to go right back to the bare minimum and this solved my self-inflicted problem.
Another crucial mistake I’d made was noticed when manuelbl explained adding the monitor_* parameters. I’d not realised the monitor_port should be for the dev board and not the esp-prog board.