Merge branch 'docs/update_esp32s2_oocd_target_name' into 'master'

Updates OpenOCD commands

See merge request espressif/esp-idf!7906
This commit is contained in:
Ivan Grokhotkov 2020-03-17 01:15:10 +08:00
commit 454293159d
7 changed files with 30 additions and 34 deletions

View file

@ -68,7 +68,7 @@ idf.py -p PORT flash monitor
**Start App Trace:** In the telnet session window, trigger OpenOCD to start App Trace on the ESP32 by entering the command below. This command will collect 9000 bytes of JTAG log data and save them to `adc.log` file in `~/esp/openocd-esp32` folder.
```bash
esp32 apptrace start file://adc.log 0 9000 5 0 0
esp apptrace start file://adc.log 0 9000 5 0 0
```
**Note:** For more details on OpenOCD commands regarding App Trace, refer to the [OpenOCD Application Level Tracing Commands](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/app_trace.html#openocd-application-level-tracing-commands)
@ -156,7 +156,7 @@ Log records count: 428
### Unable to flash when OpenOCD is connected to ESP32
One likely cause would be an incorrect SPI flash voltage when starting OpenOCD. Suppose an ESP32 board/module with a 3.3 V powered SPI flash is being used, but the `board/esp32-wrover.cfg` configuration file is selected when starting OpenOCD which can set the SPI flash voltage to 1.8 V. In this situation, the SPI flash will not work after OpenOCD connects to the ESP32 as OpenOCD has changed the SPI flash voltage. Therefore, you might not be able to flash ESP32 when OpenOCD is connected.
One likely cause would be an incorrect SPI flash voltage when starting OpenOCD. Suppose an ESP32 board/module with a 3.3 V powered SPI flash is being used, but the `board/esp32-wrover.cfg` configuration file is selected when starting OpenOCD which can set the SPI flash voltage to 1.8 V. In this situation, the SPI flash will not work after OpenOCD connects to the ESP32 as OpenOCD has changed the SPI flash voltage. Therefore, you might not be able to flash ESP32 when OpenOCD is connected.
To work around this issue, users are suggested to use `board/esp32-wrover.cfg` for ESP32 boards/modules operating with an SPI flash voltage of 1.8 V, and `board/esp-wroom-32.cfg` for 3.3 V. Refer to [ESP32 Modules and Boards](https://docs.espressif.com/projects/esp-idf/en/latest/hw-reference/modules-and-boards.html) and [Set SPI Flash Voltage](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/jtag-debugging/tips-and-quirks.html#why-to-set-spi-flash-voltage-in-openocd-configuration) for more details.

View file

@ -36,7 +36,7 @@ telnet localhost 4444
idf.py menuconfig
```
The example will enable the following options by default:
The example will enable the following options by default:
* Enable the Application Tracing Module under `Component config -> Application Level Tracing -> Data Destination` by choosing `Trace memory`.
* Enable GCOV to host interface under `Component config -> Application Level Tracing -> GCOV to Host Enable`.
@ -60,7 +60,7 @@ See the Getting Started Guide for full steps to configure and use ESP-IDF to bui
### 1. Hard-coded Dump
The example will initially execute two hard-coded dumps. Therefore, when the application outputs `Ready to dump GCOV data...`, users should execute the `esp32 gcov dump` OpenOCD command. The example should output the following:
The example will initially execute two hard-coded dumps. Therefore, when the application outputs `Ready to dump GCOV data...`, users should execute the `esp gcov dump` OpenOCD command. The example should output the following:
```
blink_dummy_func: Counter = 0
@ -75,7 +75,7 @@ GCOV data have been dumped.
### 2. Instant Run-Time Dump
After the two hard-coded dumps, the example will continue looping through it's main blink function. Users can call `esp32 gcov` OpenOCD command to trigger an instant run-time dump. The output should resemble the following:
After the two hard-coded dumps, the example will continue looping through it's main blink function. Users can call `esp gcov` OpenOCD command to trigger an instant run-time dump. The output should resemble the following:
```
blink_dummy_func: Counter = 2
@ -144,7 +144,7 @@ If the following log is output when issuing an OpenOCD command via telnet, it co
```
Open On-Chip Debugger
> esp32 gcov dump
> esp gcov dump
Target halted. PRO_CPU: PC=0x4008AFF4 (active) APP_CPU: PC=0x400E396E
Total trace memory: 16384 bytes
Connect targets...

View file

@ -104,14 +104,14 @@ NOTE: In order to run this example you need OpenOCD version `v0.10.0-esp32-20181
5. It is useful to use GDB to start and/or stop tracing automatically. To do this you need to prepare special `gdbinit` file:
```
```
target remote :3333
mon reset halt
b app_main
commands
mon esp32 sysview start file:///tmp/sysview_example.svdat
mon esp sysview start file:///tmp/sysview_example.svdat
# For dual-core mode uncomment the line below and comment the line above
# mon esp32 sysview start file:///tmp/sysview_example0.svdat file:///tmp/sysview_example1.svdat
# mon esp sysview start file:///tmp/sysview_example0.svdat file:///tmp/sysview_example1.svdat
c
end
c
@ -119,8 +119,6 @@ NOTE: In order to run this example you need OpenOCD version `v0.10.0-esp32-20181
Using this file GDB will connect to the target, reset it, and start tracing when it hit breakpoint at `app_main`. Trace data will be saved to `/tmp/sysview_example.svdat`.
**Note:** if running the example on ESP32-S2, modify the command name in gdbinit file from `esp32 sysview` to `esp32_s2 sysview`.
6. Run GDB using the following command from the project root directory:
```
@ -132,7 +130,7 @@ NOTE: In order to run this example you need OpenOCD version `v0.10.0-esp32-20181
7. When program prints the last message, interrupt its execution (e.g. by pressing `CTRL+C`) and type the following command in GDB console to stop tracing:
```
mon esp32 sysview stop
mon esp sysview stop
```
You can also use another breakpoint to stop tracing and add respective lines to `gdbinit` at step 5.

View file

@ -5,9 +5,9 @@ flushregs
b app_main
commands
mon esp32 sysview start file:///tmp/sysview_example.svdat
mon esp sysview start file:///tmp/sysview_example.svdat
# For dual-core mode uncomment the line below and comment the line above
# mon esp32 sysview start file:///tmp/sysview_example0.svdat file:///tmp/sysview_example1.svdat
# mon esp sysview start file:///tmp/sysview_example0.svdat file:///tmp/sysview_example1.svdat
c
end

View file

@ -41,8 +41,6 @@ To run the example and collect trace data:
xtensa-esp32-elf-gdb -x gdbinit build/sysview_tracing_heap_log.elf
```
**Note**: if running the example on ESP32-S2, modify the command name in gdbinit file from `esp32 sysview` to `esp32_s2 sysview`, and run `xtensa-esp32s2-elf-gdb` instead of `xtensa-esp32-elf-gdb`.
2. When program stops at `heap_trace_stop` quit GDB.
3. Open trace data file in SystemView tool.

View file

@ -5,13 +5,13 @@ flushregs
tb heap_trace_start
commands
mon esp32 sysview start file:///tmp/heap_log.svdat
mon esp sysview start file:///tmp/heap_log.svdat
c
end
tb heap_trace_stop
commands
mon esp32 sysview stop
mon esp sysview stop
end
c

View file

@ -325,31 +325,31 @@
"versions": [
{
"linux-amd64": {
"sha256": "978213e8345dd19762c79d4bda309331bb78db3d2a7f7193641dfcc978f6e5e5",
"size": 1680363,
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.10.0-esp32-20191114/openocd-esp32-linux64-0.10.0-esp32-20191114.tar.gz"
"sha256": "23c9a50b6e109e845311d697bfe1caae7bc0df092e71669e9848bcecd96be948",
"size": 1724360,
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.10.0-esp32-20200309/openocd-esp32-linux64-0.10.0-esp32-20200309.tar.gz"
},
"linux-armel": {
"sha256": "3b41d889e54c03d26ebf4423084a1c25a9b0a8c5d93359a3eece1754377dbd81",
"size": 1730768,
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.10.0-esp32-20191114/openocd-esp32-armel-0.10.0-esp32-20191114.tar.gz"
"sha256": "04b75498138e6cca9fc0264479dd9f11e60b757ac0d2f14f008f9b54ec624b12",
"size": 1774177,
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.10.0-esp32-20200309/openocd-esp32-armel-0.10.0-esp32-20200309.tar.gz"
},
"macos": {
"sha256": "75ca2e235c35157d6dad2106cc62210ccb99b736da6940179aa1644fe1ae8c2b",
"size": 1765567,
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.10.0-esp32-20191114/openocd-esp32-macos-0.10.0-esp32-20191114.tar.gz"
"sha256": "b39ded478181da4ddcdcc5c52c1c73b60610f856eb0f13b494caa750bebc1d78",
"size": 1810061,
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.10.0-esp32-20200309/openocd-esp32-macos-0.10.0-esp32-20200309.tar.gz"
},
"name": "v0.10.0-esp32-20191114",
"name": "v0.10.0-esp32-20200309",
"status": "recommended",
"win32": {
"sha256": "698bfa5903c99e2ee0a1898379b3a40451fcecbc1fd4fde4f2f1494e5725e7ab",
"size": 2102699,
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.10.0-esp32-20191114/openocd-esp32-win32-0.10.0-esp32-20191114.zip"
"sha256": "31e2d12843386058ad13d27a5bb69c73ee185c93d76be9e4c03a832a2fdaef47",
"size": 2149578,
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.10.0-esp32-20200309/openocd-esp32-win32-0.10.0-esp32-20200309.zip"
},
"win64": {
"sha256": "698bfa5903c99e2ee0a1898379b3a40451fcecbc1fd4fde4f2f1494e5725e7ab",
"size": 2102699,
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.10.0-esp32-20191114/openocd-esp32-win32-0.10.0-esp32-20191114.zip"
"sha256": "31e2d12843386058ad13d27a5bb69c73ee185c93d76be9e4c03a832a2fdaef47",
"size": 2149578,
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.10.0-esp32-20200309/openocd-esp32-win32-0.10.0-esp32-20200309.zip"
}
}
]