Skip to content

Issue connecting ESP32 with 16Mb FLASH since ESP-IDF 4.4 (OCD-547) #214

@tonyjackson-srt

Description

@tonyjackson-srt

Development Kit

Custom board

Module or chip used

ESP32-WROVER-IE

Debug Adapter

ESP-PROG

OpenOCD version

v0.11.0-esp32-20211220

Operating System

Windows 10

Using an IDE ?

No

OpenOCD command line

openocd -s %userprofile%\.espressif_4.4\tools\openocd-esp32\v0.11.0-esp32-20211220\openocd-esp32\share\openocd\scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f target/esp32.cfg -c "init; reset halt"

JTAG Clock Speed

default

ESP-IDF version

v4.4

Problem Description

  1. Launch OpenOCD with command line as given above.
  2. Launch gdb: xtensa-esp32-elf-gdb
  3. On (gdb) prompt enter: target remote :3333

Result from GDB:

Remote debugging using :3333
Remote communication error.  Target disconnected.: (undocumented errno 10061).

Debug Logs

Result from OpenOCD:

Info : accepting 'gdb' connection on tcp/3333
Warn : No symbols for FreeRTOS!
Info : esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
Error: Too many flash mappings 1852140917! Must be 2.
Warn : Failed to get flash mappings (-4)!
Info : esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
Error: Failed to get flash size!
Info : esp32.cpu0: Target halted, PC=0x400003C0, debug_reason=00000001
Error: Failed to get flash size!
Error: Failed to probe flash, size 0 KB
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected

Log with -d3 and -l to file in comment below (too large to attach directly in this report).

Expected behavior

If I use OpenOCD from the previous ESP-IDF 4.3 release, v0.10.0-esp32-20210401 then it connects and detects flash size correctly, with OpenOCD reporting:

Info : accepting 'gdb' connection on tcp/3333
Warn : No symbols for FreeRTOS!
Info : esp32.cpu0: Target halted, PC=0x40091C2A, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 255 KB
Info : Flash mapping 1: 0x50020 -> 0x400d0020, 967 KB
Info : esp32.cpu0: Target halted, PC=0x40091C2A, debug_reason=00000001
Info : Auto-detected flash bank 'esp32.cpu0.flash' size 16384 KB
Info : Using flash bank 'esp32.cpu0.flash' size 16384 KB
Info : esp32.cpu0: Target halted, PC=0x40091C2A, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 255 KB
Info : Flash mapping 1: 0x50020 -> 0x400d0020, 967 KB
Info : Using flash bank 'esp32.cpu0.irom' size 968 KB
Info : esp32.cpu0: Target halted, PC=0x40091C2A, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 255 KB
Info : Flash mapping 1: 0x50020 -> 0x400d0020, 967 KB
Info : Using flash bank 'esp32.cpu0.drom' size 256 KB
Info : New GDB Connection: 1, Target esp32.cpu0, state: halted

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions