Failed to get flash maps (5)! when debug with esp32s2 (IEP-425)
Describe the bug I am trying to use eclipse for esp32s2 (but esp32 works well) bugging with default configs from openocd debugging, which not work both on my Linux and Windows PC, error message like below. Seems flash Info can't be correctly probed from Jtag.
I also find solutions for me (but can't explain why):
For Linux: modify flash size to 4MB in menuconfig can fix
~~For Windonws: modify flash size not work, add set ESP_FLASH_SIZE "4M" in target\esp32s2.cfg can fix~~(not work now)
To Reproduce Steps to reproduce the behavior:
- build and flash hello_world
- use eclipse for esp32s2 bugging with default configs from openocd debugging
Environment Information: Eclipse > About Eclipse > Installation Details > Configuration > Copy to Clipboard eclipse install info.txt
ESP-IDF Tools Information:
Executing D:\.espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe D:\esp\tools\idf_tools.py list
* xtensa-esp32-elf: Toolchain for Xtensa (ESP32) based on GCC
- esp-2020r3-8.4.0 (recommended, installed)
* xtensa-esp32s2-elf: Toolchain for Xtensa (ESP32-S2) based on GCC
- esp-2020r3-8.4.0 (recommended, installed)
* xtensa-esp32s3-elf: Toolchain for Xtensa (ESP32-S3) based on GCC
- esp-2020r3-8.4.0 (recommended, installed)
* riscv32-esp-elf: Toolchain for 32-bit RISC-V based on GCC
- 1.24.0.123_64eb9ff-8.4.0 (recommended, installed)
* esp32ulp-elf: Toolchain for ESP32 ULP coprocessor
- 2.28.51-esp-20191205 (recommended, installed)
* esp32s2ulp-elf: Toolchain for ESP32-S2 ULP coprocessor
- 2.28.51-esp-20191205 (recommended, installed)
* cmake: CMake build system
- 3.16.4 (recommended, installed)
* openocd-esp32: OpenOCD for ESP32
- v0.10.0-esp32-20200709 (recommended, installed)
* ninja: Ninja build system
- 1.10.2 (recommended, installed)
* idf-exe: IDF wrapper tool for Windows
- 1.0.1 (recommended, installed)
* ccache: Ccache (compiler cache)
- 3.7 (recommended, installed)
* dfu-util: dfu-util (Device Firmware Upgrade Utilities)
- 0.9 (recommended, installed)
IDF Eclipse Plugin Version: ESPRESSIF SYSTEMS (SHANGHAI) CO., LTD ESP-IDF Eclipse Plugin 2.1.0.202104161244 com.espressif.idf.feature
Eclipse Error log:
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
Started by GNU MCU Eclipse
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 10000 kHz
Info : JTAG tap: esp32s2.cpu tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32s2: Debug controller 0 was reset.
Info : esp32s2: Core 0 was reset.
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Error: No symbols for FreeRTOS
Info : esp32s2: Target halted, PC=0x4009264A, debug_reason=00000000
Info : Detected ESP32-S2 chip
Info : esp32s2: Target halted, PC=0x400314A4, debug_reason=00000001
Error: Failed to get flash maps (5)!
Warn : Failed to get flash mappings (-4)!
Info : esp32s2: Target halted, PC=0x400314A4, debug_reason=00000001
Info : esp32s2: Target halted, PC=0x400314A4, debug_reason=00000001
Info : Auto-detected flash bank 'esp32s2.flash' size 0 KB
Info : Using flash bank 'esp32s2.flash' size 0 KB
Info : esp32s2: Target halted, PC=0x400314A4, debug_reason=00000001
Error: Failed to get flash maps (5)!
Warn : Failed to get flash mappings (-4)!
Info : esp32s2: Target halted, PC=0x400314A4, debug_reason=00000001
Info : Using flash bank 'esp32s2.irom' size 0 KB
Info : esp32s2: Target halted, PC=0x400314A4, debug_reason=00000001
Error: Failed to get flash maps (5)!
Warn : Failed to get flash mappings (-4)!
Info : esp32s2: Target halted, PC=0x400314A4, debug_reason=00000001
Info : Using flash bank 'esp32s2.drom' size 0 KB
Info : JTAG tap: esp32s2.cpu tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32s2: Target halted, PC=0x40022403, debug_reason=00000001
Info : esp32s2: Core 0 was reset.
Info : esp32s2: Target halted, PC=0x40000400, debug_reason=00000000
Hi @leeebo,
Before starting the debugger, can you please make sure your application is running on Esp32-S2 as expected. if your application is working well and still getting flash map error, then can you please provide the openocd logs with -d3 option? In the meantime you can try with the latest openocd release. https://github.com/espressif/openocd-esp32/releases/tag/v0.10.0-esp32-20210401
@erhankur Yes, the app running with normal output.
- v0.10.0-esp32-20210401 works for me now
- debug message for v0.10.0-esp32-20200709 here:debug message.txt
- v0.10.0-esp32-20210401 works for me now
- debug message for v0.10.0-esp32-20200709 here:debug message.txt
Seems first 1600 items missed in the log, any advice to save all of them?
-d3 -l debug_message.txt should work.
-d3 -l debug_message.txtshould work.
After adding options -d3 -l debug_message.txt, openocd blocked waiting for GDB connect, but GDB seem doesn't work anymore.
message from new debug_message.txt
Debug: 327 64 command.c:143 script_debug(): command - pld pld init
Debug: 329 68 pld.c:206 handle_pld_init_command(): Initializing PLDs...
Debug: 330 68 gdb_server.c:3491 gdb_target_start(): starting gdb server for esp32s2 on 3333
Info : 331 68 server.c:311 add_service(): Listening on port 3333 for gdb connections
Hi - what was the solution ?? I am running platformIO and VS-code: When I run "Hello World" without SPIFFS then everything is OK. But when I run the same procject WITH SPIFFS - then I get this one: Error: Failed to get flash maps (4294967290)! (when I try to upload the code - build is OK) Any help will be greatly appreciated...:-(
I found my problem - and it is NOT relevant in respect of Espressif. The problem description is misleading for my problem. I had two versions of python, two Espressif IDF`s on top of VS-code with platformIO, my IDF installation is on E: - with numerous irritating references to my windows userID. I deleted ALL old python references and installed Python all over. That helped