Problems debugging ESP32 Pico V3 in vscode/platformio/openocd

0xDEADBEEF
Posts: 12
Joined: Sun Oct 25, 2020 3:58 pm

Problems debugging ESP32 Pico V3 in vscode/platformio/openocd

Postby 0xDEADBEEF » Sun Oct 25, 2020 4:08 pm

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
Attachments
Bildschirmfoto 2020-10-23 um 01.25.13.png
My pin connections
Bildschirmfoto 2020-10-23 um 01.25.13.png (9.3 KiB) Viewed 6210 times
Bildschirmfoto 2020-10-23 um 01.25.32.png
the connector pinout as connected to the espprog. Mind while 3V3 is connected to the espprog, the voltage selection jumper is left open.
Bildschirmfoto 2020-10-23 um 01.25.32.png (12.95 KiB) Viewed 6210 times

ESP_Sprite
Posts: 9709
Joined: Thu Nov 26, 2015 4:08 am

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

Postby ESP_Sprite » Mon Oct 26, 2020 12:50 am

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.

0xDEADBEEF
Posts: 12
Joined: Sun Oct 25, 2020 3:58 pm

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

Postby 0xDEADBEEF » Mon Oct 26, 2020 8:59 am

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!

0xDEADBEEF
Posts: 12
Joined: Sun Oct 25, 2020 3:58 pm

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

Postby 0xDEADBEEF » Mon Oct 26, 2020 9:10 am

The platformio-supplied version of tool-openocd-esp32 is 1.1000.20190709 (10.0) by the way.

0xDEADBEEF
Posts: 12
Joined: Sun Oct 25, 2020 3:58 pm

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

Postby 0xDEADBEEF » Mon Oct 26, 2020 10:24 am

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?

0xDEADBEEF
Posts: 12
Joined: Sun Oct 25, 2020 3:58 pm

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

Postby 0xDEADBEEF » Wed Nov 04, 2020 7:47 am

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!

Who is online

Users browsing this forum: No registered users and 16 guests