when trying to debug an esp32dev with esp-prog I get the following error:
** Programming Started **
** Programming Started **
auto erase enabled
Error: couldn't open E:PlatformIOcorepackagesramework-arduinoespressif32 oolspartitionsoot_app0.bin
embedded:startup.tcl:480: Error: ** Programming Failed **
in procedure 'program_esp32'
however when I upload and run without debugging it works well:
Uploading .pio\build\esp32dev\firmware.bin
Open On-Chip Debugger v0.10.0-esp32-20190708 (2019-07-08-11:04)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 1
none separate
adapter speed: 20000 kHz
esp32 interrupt mask on
** Programming Started **
** Filename: {.pio\build\esp32dev\firmware.bin} **
auto erase enabled
wrote 204800 bytes from file .pio\build\esp32dev\firmware.bin in 2.474497s (80.825 KiB/s)
** Programming Finished **
Just edited my first post so it should look better now.
some additional info:
debugging works if I compile with build_type = debug and upload the firmware first.
When I then start debugging with F5 I still get the error that programing fails but since the firmware is already uploaded, JTAG debugging still works.
So it is really just an issue with the uploading of debug firmware that is built into the scripts that start the debug process.
yes, that’s the output.
It should be: E:\PlatformIO\core\packages\framework-arduinoespressif32\tools\partitions
It seems that
\f from \framework,
\t from \tools
and
\b from \boot_app0.bin get misinterpreted somewhere …
Maybe it helps to know that the filename passed to program_esp32 is already wrong.
To test I inserted an additional 2 lines (binary scan and echo) in program_esp32:
# start programming phase
echo "** Programming Started **"
binary scan $filename H* nameHex
echo "** Filename = $nameHex **"
if {[info exists address]} {
set flash_args "$filename $address"
} else {
set flash_args "$filename"
}
I’m running into the same issue here. It results in not being able to upload before debugging and breakpoints not being stopped at.
I’ve also found that the filename gets mangled somewhere before esp32.cfg gets called, so the solution found in http://openocd.zylin.com/#/c/4083/ does not help, because at that point the filename is already wrong. Does anyone know which file or process calls the program_esp32 procedure, so we can fix it there?