OpenOCD
Serial monitor (make app-flash monditor):sudo ./src/openocd -s ./tcl -f tcl/interface/ftdi/olimex-arm-usb-ocd.cfg -f ./sparkfun-esp32-thing.cfg
[sudo] password for permal:
Open On-Chip Debugger 0.10.0-dev-gcc5b0f7 (2017-08-10-17:21)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz
force hard breakpoints
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: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
Info : accepting 'gdb' connection on tcp/3333
Info : Target halted. PRO_CPU: PC=0x400D0D84 (active) APP_CPU: PC=0x00000000
esp32: target state: halted
Info : Use core0 of target 'esp32'
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 7416 bytes at address 0x40090000
Error: no working area available, can't alloc space for stub code!
Error: Failed to load stub (-308)!
Error: Algorithm run faied (-308)!
Info : Auto-detected flash size 0 KB
Error: Failed to probe flash, size 0 KB
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: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
esp32: target state: halted
Info : esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
esp32: target state: halted
Info : Target halted. PRO_CPU: PC=0x400D1713 (active) APP_CPU: PC=0x40084083
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFAFD8C
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFAF6C0
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFB4728
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFAF0A4
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFB42C0
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFAEAEC
Debugger:➜ blink git:(master) ✗ make app-flash monitor
Flashing app to serial port /dev/ttyUSB0, offset 0x10000...
esptool.py v2.1-beta1
Connecting........_
Chip is ESP32D0WDQ6 (revision 0)
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 120032 bytes to 57751...
Wrote 120032 bytes (57751 compressed) at 0x00010000 in 5.2 seconds (effective 184.7 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting...
MONITOR
--- idf_monitor on /dev/ttyUSB0 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0010,len:4
load:0x3fff0014,len:5076
load:0x40078000,len:0
load:0x40078000,len:12652
entry 0x40078f44
I (30) boot: ESP-IDF v3.0-dev-203-gdce7fcb 2nd stage bootloader
I (30) boot: compile time 21:40:43
I (57) boot: Enabling RNG early entropy source...
I (57) boot: SPI Speed : 40MHz
I (59) boot: SPI Mode : DIO
I (72) boot: SPI Flash Size : 4MB
I (84) boot: Partition Table:
I (95) boot: ## Label Usage Type ST Offset Length
I (117) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (141) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (164) boot: 2 factory factory app 00 00 00010000 00100000
I (187) boot: End of partition table
I (200) boot: Disabling RNG early entropy source...
I (217) boot: Loading app partition at offset 00010000
I (235) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x0438c ( 17292) map
I (282) esp_image: segment 1: paddr=0x000143b4 vaddr=0x3ffb0000 size=0x01edc ( 7900) load
I (300) esp_image: segment 2: paddr=0x00016298 vaddr=0x40080000 size=0x00400 ( 1024) load
0x40080000: _iram_start at ??:?
I (319) esp_image: segment 3: paddr=0x000166a0 vaddr=0x40080400 size=0x07280 ( 29312) load
I (382) esp_image: segment 4: paddr=0x0001d928 vaddr=0x400c0000 size=0x00000 ( 0) load
I (383) esp_image: segment 5: paddr=0x0001d930 vaddr=0x00000000 size=0x026e0 ( 9952)
I (417) esp_image: segment 6: paddr=0x00020018 vaddr=0x400d0018 size=0x0d4a0 ( 54432) map
0x400d0018: _flash_cache_start at ??:?
I (506) cpu_start: Pro cpu up.
I (506) cpu_start: Starting app cpu, entry point is 0x40080e64
0x40080e64: call_start_cpu1 at /home/permal/esp/esp-idf/components/esp32/./cpu_start.c:192
I (0) cpu_start: App cpu up.
I (515) heap_init: Initializing. RAM available for dynamic allocation:
I (536) heap_init: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
I (555) heap_init: At 3FFB2698 len 0002D968 (182 KiB): DRAM
I (574) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (593) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (613) heap_init: At 40087680 len 00018980 (98 KiB): IRAM
I (632) cpu_start: Pro cpu start user code
I (690) cpu_start: Starting scheduler on PRO CPU.
I (187) cpu_start: Starting scheduler on APP CPU.
ets Jun 8 2016 00:22:57
rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0010,len:4
load:0x3fff0014,len:5076
load:0x40078000,len:0
load:0x40078000,len:12652
entry 0x40078f44
I (29) boot: ESP-IDF v3.0-dev-203-gdce7fcb 2nd stage bootloader
I (29) boot: compile time 21:40:43
I (56) boot: Enabling RNG early entropy source...
I (56) boot: SPI Speed : 40MHz
I (59) boot: SPI Mode : DIO
I (71) boot: SPI Flash Size : 4MB
I (83) boot: Partition Table:
I (94) boot: ## Label Usage Type ST Offset Length
I (117) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (140) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (163) boot: 2 factory factory app 00 00 00010000 00100000
I (187) boot: End of partition table
I (200) boot: Disabling RNG early entropy source...
I (217) boot: Loading app partition at offset 00010000
I (235) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x0438c ( 17292) map
I (281) esp_image: segment 1: paddr=0x000143b4 vaddr=0x3ffb0000 size=0x01edc ( 7900) load
I (299) esp_image: segment 2: paddr=0x00016298 vaddr=0x40080000 size=0x00400 ( 1024) load
0x40080000: _iram_start at ??:?
I (318) esp_image: segment 3: paddr=0x000166a0 vaddr=0x40080400 size=0x07280 ( 29312) load
I (382) esp_image: segment 4: paddr=0x0001d928 vaddr=0x400c0000 size=0x00000 ( 0) load
I (383) esp_image: segment 5: paddr=0x0001d930 vaddr=0x00000000 size=0x026e0 ( 9952)
I (416) esp_image: segment 6: paddr=0x00020018 vaddr=0x400d0018 size=0x0d4a0 ( 54432) map
0x400d0018: _flash_cache_start at ??:?
I (505) cpu_start: Pro cpu up.
I (505) cpu_start: Starting app cpu, entry point is 0x40080e64
0x40080e64: call_start_cpu1 at /home/permal/esp/esp-idf/components/esp32/./cpu_start.c:192
I (500) cpu_start: App cpu up.
I (515) heap_init: Initializing. RAM available for dynamic allocation:
I (536) heap_init: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
I (555) heap_init: At 3FFB2698 len 0002D968 (182 KiB): DRAM
I (574) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (593) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (613) heap_init: At 40087680 len 00018980 (98 KiB): IRAM
I (632) cpu_start: Pro cpu start user code
I (690) cpu_start: Starting scheduler on PRO CPU.
I (688) cpu_start: Starting scheduler on APP CPU.
This is what I got when I followed the tutorial using "blink", at the point where you continue after setting breakpoints. No output in the UART console.➜ blink git:(master) ✗ xtensa-esp32-elf-gdb -x gdbinit build/blink.elf
GNU gdb (crosstool-NG crosstool-ng-1.22.0-61-gab8375a) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-build_pc-linux-gnu --target=xtensa-esp32-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from build/blink.elf...done.
warning: while parsing target memory map (at line 2): Required element <memory> is missing
0x00000000 in ?? ()
JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
esp32: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
esp32: target state: halted
esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
esp32: target state: halted
Hardware assisted breakpoint 1 at 0x400d1713: file /home/permal/esp/esp-idf/examples/get-started/blink/main/./blink.c, line 43.
0x0: 0x00000000
Target halted. PRO_CPU: PC=0x400D1713 (active) APP_CPU: PC=0x40084083
[New Thread 1073413516]
[New Thread 1073413160]
[New Thread 1073432360]
[New Thread 1073410212]
[New Thread 1073431232]
[New Thread 1073408748]
[New Thread 1073411340]
[Switching to Thread 1073411776]
Temporary breakpoint 1, app_main ()
at /home/permal/esp/esp-idf/examples/get-started/blink/main/./blink.c:43
---Type <return> to continue, or q <return> to quit---
gdb output:Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFAEAEC
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: Debug controller was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core was reset (pwrstat=0x5F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000
esp32: target state: halted
Info : esp32: Core was reset (pwrstat=0x1F, after clear 0x0F).
Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400
esp32: target state: halted
Info : Target halted. PRO_CPU: PC=0x400D1713 (active) APP_CPU: PC=0x40084083
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFAFD8C
lInfo : Target halted. PRO_CPU: PC=0x400D16F2 (active) APP_CPU: PC=0x40084083
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFAF6C0
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFB42C0
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFAEAEC
Info : Target halted. PRO_CPU: PC=0x400D16F4 (active) APP_CPU: PC=0x40084083
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFAF6C0
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFAF0A4
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFB42C0
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFAEAEC
Info : Target halted. PRO_CPU: PC=0x400D1700 (active) APP_CPU: PC=0x400D0D84
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFAFD8C
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFB42C0
Error: cpu0: xtensa_read_memory (line 588): DSR (8000CC13) indicates DIR instruction generated an exception!
Warn : cpu0: Failed reading 1024 bytes at address 0x3FFAF0A4
Program received signal SIGTRAP, Trace/breakpoint trap.
0x400803c0 in _DoubleExceptionVector ()
(gdb) c
Continuing.
cpu1: esp32_fetch_all_regs (line 163): DSR (80008413) indicates DIR instruction generated an exception!
cpu0: esp32_fetch_all_regs (line 234): DSR (8000CC13) indicates DIR instruction generated an exception!
cpu0: esp32_fetch_all_regs (line 190): DSR (8000CC13) indicates DIR instruction generated an exception!
Exception reading ccompare1!
esp32: xtensa_step: Stepping doesn't seem to change PC!
Target halted. PRO_CPU: PC=0x400803C0 (active) APP_CPU: PC=0x40084083
Program received signal SIGTRAP, Trace/breakpoint trap.
0x400803c0 in _DoubleExceptionVector ()
(gdb) c
Continuing.
cpu0: esp32_fetch_all_regs (line 190): DSR (8000CC13) indicates DIR instruction generated an exception!
Exception reading ccompare1!
cpu0: esp32_fetch_all_regs (line 190): DSR (8000CC13) indicates DIR instruction generated an exception!
Exception reading epc2!
cpu0: esp32_fetch_all_regs (line 190): DSR (8000CC13) indicates DIR instruction generated an exception!
Exception reading epc2!
cpu1: esp32_fetch_all_regs (line 163): DSR (80008413) indicates DIR instruction generated an exception!
cpu0: esp32_fetch_all_regs (line 190): DSR (8000CC13) indicates DIR instruction generated an exception!
Exception reading epc2!
esp32: xtensa_step: Stepping doesn't seem to change PC!
cpu0: esp32_fetch_all_regs (line 190): DSR (8011CC13) indicates DIR instruction generated an exception!
Exception reading epc2!
Target halted. PRO_CPU: PC=0x400803C0 (active) APP_CPU: PC=0x40084083
Program received signal SIGTRAP, Trace/breakpoint trap.