Page 1 of 1

Problems debugging ESP32 Pico V3 in vscode/platformio/openocd

Posted: Sun Oct 25, 2020 4:08 pm
by 0xDEADBEEF
Hello Gentlemen!
I have made a new prototype for a project I am working on and switched from Pico D4 to Pico V3. I've left the pin connections and the connector the same and expected everything to work just fine, however I am not able to upload with espprog, only via serial and the onboard CP2104.

This is the error I am getting in the vscode console:

Code: Select all

Building in release mode
Retrieving maximum program size .pio/build/esp32dev/firmware.elf
Checking size .pio/build/esp32dev/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [====      ]  35.9% (used 117632 bytes from 327680 bytes)
Flash: [======    ]  58.4% (used 1836203 bytes from 3145728 bytes)
Configuring upload protocol...
AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esp-prog
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
Error: cpu0: xtensa_write_memory (line 807): DSR (FFFFFFFF) indicates target still busy!
Error: cpu0: xtensa_write_memory (line 807): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: cpu0: xtensa_write_memory (line 807): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
Warn : esp32: Failed writing 4 bytes at address 0x3ff48000, data - 00, 20, 49, 9c, e7, 7c, 01, b8
Error: xtensa_write_uint32_list: error writing to 3ff48000
Warn : esp32_soc_reset xtensa_write_uint32_list (reg_value_pairs_pre) err=-4
in procedure 'program_esp32'

embedded:startup.tcl:480: Error: ** Unable to reset target **
in procedure 'program_esp32' 
in procedure 'program_error' called at file "/Users/wolfgang/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp32.cfg", line 119
at file "embedded:startup.tcl", line 480
Warn : Flash driver of esp32.flash does not support free_driver_priv()
Warn : Flash driver of irom does not support free_driver_priv()
Warn : Flash driver of drom does not support free_driver_priv()
*** [upload] Error 1
After that the ESP locks up, If I try uploading again right after the error changes:

Code: Select all

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
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
*** [upload] Error -11
After resetting the esp the error is the same as the first. There is no output on uart.

I was suspecting my wiring broke, but the old prototype with pico d4 works as expected with the same connector. I have also buildt two prototypes with the exact same issue.
Any idea what the issue could be?

Thanks!
0xD

Re: Problems debugging ESP32 Pico V3 in vscode/platformio/openocd

Posted: Mon Oct 26, 2020 12:50 am
by ESP_Sprite
You possibly need to update your OpenOCD packages... the V3 ESP32 silicon has some small changes to the way JTAG works, and your OpenOCD doesn't seem to take that into account.

Re: Problems debugging ESP32 Pico V3 in vscode/platformio/openocd

Posted: Mon Oct 26, 2020 8:59 am
by 0xDEADBEEF
Ah thanks sprite! Good to know it's not a hardware issue. I'm using the platformio integration for vscode, which comes with openocd, so I don't really have a way to update openocd. Guess I'll have to take this issue to the platformio community ...
thank you!

Re: Problems debugging ESP32 Pico V3 in vscode/platformio/openocd

Posted: Mon Oct 26, 2020 9:10 am
by 0xDEADBEEF
The platformio-supplied version of tool-openocd-esp32 is 1.1000.20190709 (10.0) by the way.

Re: Problems debugging ESP32 Pico V3 in vscode/platformio/openocd

Posted: Mon Oct 26, 2020 10:24 am
by 0xDEADBEEF
I have now tried the openocd version from here: https://github.com/espressif/openocd-es ... 2-20200709

now I get this error:

Code: Select all

Uploading .pio/build/esp32dev/firmware.bin
Open On-Chip Debugger  v0.10.0-esp32-20200709 (2020-07-09-08:54)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

adapter speed: 20000 kHz

WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
** Programming Started **
embedded:startup.tcl:449: Error: ** Programming Failed **
in procedure 'program_esp32' 
in procedure 'program_esp' called at file "/Users/username/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp32.cfg", line 64
in procedure 'program_error' called at file "/Users/username/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 106
at file "embedded:startup.tcl", line 449
*** [upload] Error 1
Is there any newer version around?

Re: Problems debugging ESP32 Pico V3 in vscode/platformio/openocd

Posted: Wed Nov 04, 2020 7:47 am
by 0xDEADBEEF
To update and close this, the very responsive guys at PlatformIO have updated open ocd in their repositories, and debugging the Pico V3 works just fine now!