What does "Failed to get flash maps" and "Failed to get flash mappings" mean?

skanky
Posts: 20
Joined: Mon Nov 21, 2022 12:58 pm

What does "Failed to get flash maps" and "Failed to get flash mappings" mean?

Postby skanky » Mon Nov 21, 2022 9:49 pm

I'm having various issues with trying to get an ESP32-WROOM-32E (16MB) to successfully program via JTAG with openocd.

"Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED"
I get this when I try to do anything, but I can find no cause for this issue and operating continues on after it so I'm assuming it must be a false error (have seen forum posts indicating this can happen).

But these two errors have me baffled, because I can't find documentation on what causes them or resources on how to solve them:
Error: Failed to get flash maps (4294967290)!
Warn : Failed to get flash mappings (-4)!

Can anyone help me understand how I might be able to resolve them and get this part to program?

Here's the full VS Code terminal view of the programming operation:

Code: Select all

Executing task: openocd -d2 -f C:\Users\Dev\.espressif\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\share\openocd\scripts\interface\ftdi\esp32_devkitj_v1.cfg -f C:\Users\Dev\.espressif\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\share\openocd\scripts\board\esp-wroom-32.cfg -c 'program_esp  C:/_PROJECTS/MyProject/firm/oda-100-100_MyProject/build/bootloader/bootloader.bin 0x1000 verify' -c 'program_esp  C:/_PROJECTS/MyProject/firm/oda-100-100_MyProject/build/partition_table/partition-table.bin 0x8000 verify' -c 'program_esp  C:/_PROJECTS/MyProject/firm/oda-100-100_MyProject/build/ota_data_initial.bin 0xd000 verify' -c 'program_esp  C:/_PROJECTS/MyProject/firm/oda-100-100_MyProject/build/100_216_MyProject.bin 0x10000 verify' -c 'program_esp  C:/_PROJECTS/MyProject/firm/oda-100-100_MyProject/build/100_216_MyProject.bin 0x190000 verify;' -c 'program_esp C:/_PROJECTS/MyProject/firm/oda-100-100_MyProject/build/log_spiffs.bin 0x319000 reset exit'  

Open On-Chip Debugger  v0.11.0-esp32-20220706 (2022-07-06-15:48)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

adapter speed: 20000 kHz

WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
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 20000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : [esp32.cpu0] Target halted, PC=0x40000400, debug_reason=00000001
Info : [esp32.cpu1] Target halted, PC=0x40000400, debug_reason=00000000
Info : starting gdb server for esp32.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : [esp32.cpu0] requesting target halt and executing a soft reset
Info : [esp32.cpu0] Debug controller was reset.
Info : [esp32.cpu0] Core was reset.
Info : [esp32.cpu0] Target halted, PC=0x500000CF, debug_reason=00000000
Info : Set GDB target to 'esp32.cpu0'
Info : [esp32.cpu1] requesting target halt and executing a soft reset
Info : [esp32.cpu0] Core was reset.
Info : [esp32.cpu0] Target halted, PC=0x40000400, debug_reason=00000000
Info : [esp32.cpu1] Debug controller was reset.
Info : [esp32.cpu1] Core was reset.
Info : [esp32.cpu1] Target halted, PC=0x40000400, debug_reason=00000000
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Error: Failed to get flash maps (4294967290)!
Warn : Failed to get flash mappings (-4)!
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : Auto-detected flash bank 'esp32.cpu0.flash' size 4096 KB
Info : Using flash bank 'esp32.cpu0.flash' size 4096 KB
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Error: Failed to get flash maps (4294967290)!
Warn : Failed to get flash mappings (-4)!
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : Auto-detected flash bank 'esp32.cpu1.flash' size 4096 KB
Info : Using flash bank 'esp32.cpu1.flash' size 4096 KB
** Programming Started **
Error: timed out while waiting for target halted
Info : [esp32.cpu0] Target halted, PC=0x40064AFB, debug_reason=00000000
Error: xtensa_wait_algorithm: not halted 0, pc 0x40064afb, ps 0x60025
Error: Failed to wait algorithm (-302)!
Error: Algorithm run failed (-302)!
Error: Target is already running an algorithm
Error: Failed to start algorithm (-4)!
Info : PROF: Erased 20480 bytes in 87.933 ms
Error: Target is already running an algorithm
Error: Failed to start algorithm (-4)!
Info : PROF: Wrote 20480 bytes in 75.91 ms (data transfer time included)
** Programming Finished in 41626 ms **
** Verify Started **
Error: Target is already running an algorithm
Error: Failed to start algorithm (-4)!
Info : PROF: Flash verified in 79.046 ms
Error: **** Verification failure! ****
Error: target_hash 7cf29e...19dda
Error: file_hash: d116d8...ed7758
embedded:startup.tcl:1184: Error: ** Verify Failed **
in procedure 'program_esp'
in procedure 'program_error' called at file "C:/Users/Dev/.espressif/tools/openocd-esp32/v0.11.0-esp32-20220706/openocd-esp32/bin/../share/openocd/scripts/target/esp_common.cfg", line 149
at file "embedded:startup.tcl", line 1184

 *  The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command openocd -d2 -f C:\Users\Dev\.espressif\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\share\openocd\scripts\interface\ftdi\esp32_devkitj_v1.cfg -f C:\Users\Dev\.espressif\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\share\openocd\scripts\board\esp-wroom-32.cfg -c 'program_esp  C:/_PROJECTS/MyProject/firm/oda-100-100_MyProject/build/bootloader/bootloader.bin 0x1000 verify' -c 'program_esp  C:/_PROJECTS/MyProject/firm/oda-100-100_MyProject/build/partition_table/partition-table.bin 0x8000 verify' -c 'program_esp  C:/_PROJECTS/MyProject/firm/oda-100-100_MyProject/build/ota_data_initial.bin 0xd000 verify' -c 'program_esp  C:/_PROJECTS/MyProject/firm/oda-100-100_MyProject/build/100_216_MyProject.bin 0x10000 verify' -c 'program_esp  C:/_PROJECTS/MyProject/firm/oda-100-100_MyProject/build/100_216_MyProject.bin 0x190000 verify;' -c 'program_esp C:/_PROJECTS/MyProject/firm/oda-100-100_MyProject/build/log_spiffs.bin 0x319000 reset exit' " terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it.

skanky
Posts: 20
Joined: Mon Nov 21, 2022 12:58 pm

Re: What does "Failed to get flash maps" and "Failed to get flash mappings" mean?

Postby skanky » Wed Nov 30, 2022 10:38 am

This issue was resolved here: https://github.com/espressif/openocd-esp32/issues/260
The errors, in my case, could be ignored

Who is online

Users browsing this forum: No registered users and 110 guests