Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect to ESP32-S2 with OpenOCD / JTAG (OCD-683) #105

Closed
csobrinho opened this issue Apr 20, 2020 · 4 comments
Closed

Can't connect to ESP32-S2 with OpenOCD / JTAG (OCD-683) #105

csobrinho opened this issue Apr 20, 2020 · 4 comments

Comments

@csobrinho
Copy link

I tried to use the provided openocd but there doesn't seem to be any board config for the ESP32-S2. These cfgs seem to work:

interface.cfg

source [find interface/ftdi/esp32_devkitj_v1.cfg]
adapter_khz 26000

board.cfg

set ESP32_FLASH_VOLTAGE 3.3
set ESP32_RTOS freertos

source [find target/esp32s2.cfg]

# special function to program ESP32, it differs from the original 'program' that
# it verifies written image by reading flash directly, instead of reading memory mapped flash regions
proc program_esp32 {filename args} {
        program_esp $filename $args
}

add_help_text program_esp32 "write an image to flash, address is only required for binary images. verify, reset, exit are optional"
add_usage_text program_esp32 "<filename> \[address\] \[verify\] \[reset\] \[exit\]"

You also need a recent openocd, mine is:

Open On-Chip Debugger  v0.10.0-esp32-20200406 (2020-04-06-11:09)
@igrr
Copy link
Member

igrr commented Apr 20, 2020

Hi @csobrinho, currently there are no board configs for ESP32-S2 because Espressif has not released any ESP32-S2 development boards yet which would have built-in JTAG adapters.

For now it is okay to use -f interface/ftdi/esp32_devkitj_v1.cfg -f target/esp32s2.cfg, if you are connecting an FT2232H based adapter to an ESP32-S2 dev board.

@csobrinho csobrinho changed the title Can't connect to ESP32-S2 with OpenOCD ? JTAG Can't connect to ESP32-S2 with OpenOCD / JTAG Apr 21, 2020
@csobrinho
Copy link
Author

hi @igrr, yes that's basically what I'm doing except the "target/esp32s2.cfg" has no program_esp32 so maybe it can be added at the end? It's working well for me.

Only downside if that sometimes after a crash the core doesn't seem to properly reset (let's say this happens once every 1-2h) so I have to unplug the ESP32-S2 power and connect it again and the debug starts to work again.

@igrr
Copy link
Member

igrr commented Apr 21, 2020

program_esp32 has been replaced with non-target-specific program_esp, and it seems to be available for esp32s2, can you please check? program_esp32 is still available for the ESP32, for compatibility.

Regarding the reset issue, could you try to capture the log file with debug enabled (-d)?

@erhankur
Copy link
Collaborator

Closing this since not an issue anymore.

@github-actions github-actions bot changed the title Can't connect to ESP32-S2 with OpenOCD / JTAG Can't connect to ESP32-S2 with OpenOCD / JTAG (OCD-683) Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants