PlatformIO Community

OpenOCD debug level for wrover jtag


#1

I’m using the WROVER Dev Kit (v3) and figured out how to use the JTAG port on MacOS - the reason for me to use the JTAG connection is not the debugger, but so I can keep another window open, listening to the serial port, while uploading new code revisions in the main CLI window.

My question is: can the openocd setup be configured to suppress its “Info : …” messages? There are 130+ lines, telling me all is well. Doh.

Also, somewhat surprisingly, JTAG uploads take more time than esptool upload. Maybe there’s a way to keep openocd running, and have pio connect into it whenever it needs to upload?

PS. And while on this topic: is there a way to further streamline uploads? Right now, we’re resending multiple flash partitions, which makes the process considerably slower than with STM32 builds, for example. It might be useful to have a full upload config for initial setup, and then just a re-flash of the code changes, just as -t uploadfs only re-flashes the SPIFFS partition.


#2

See https://github.com/platformio/platform-espressif32/blob/develop/builder/main.py#L328

You can declare your custom upload protocol and flash what you need. See example http://docs.platformio.org/en/latest/projectconf/advanced_scripting.html#custom-upload-tool

http://openocd.org/doc/html/General-Commands.html#debuglevel

Does it work?


#3

Yes, openocd file tweaking works - ~/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp32.cfg - edited to add debug_level 1 reduces verbosity a lot (29 lines now). Excellent, thanks for the tip. My vote would be to include this. Here is what remains, it’s more than enough for day to day use IMO:

Open On-Chip Debugger  v0.10.0-esp32-20190313 (2019-03-13-09:59)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 20000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
debug_level: 1
** Programming Started **
auto erase enabled
wrote 204800 bytes from file .pioenvs/esp32doit-devkit-v1/firmware.bin in 3.567845s (56.056 KiB/s)
** Programming Finished **
** Programming Started **
auto erase enabled
wrote 20480 bytes from file /Users/jcw/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin in 1.022751s (19.555 KiB/s)
** Programming Finished **
** Programming Started **
auto erase enabled
wrote 4096 bytes from file /Users/jcw/Code/jcw/pio/esp32-wrover/.pioenvs/esp32doit-devkit-v1/partitions.bin in 0.634305s (6.306 KiB/s)
** Programming Finished **
** Programming Started **
auto erase enabled
wrote 8192 bytes from file /Users/jcw/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin in 0.704276s (11.359 KiB/s)
** Programming Finished **
shutdown command invoked
Warn : Flash driver of esp32.flash does not support free_driver_priv()
Warn : Flash driver of irom does not support free_driver_priv()
Warn : Flash driver of drom does not support free_driver_priv()

#4

Can we use built-in upload_flags?

[env:myenv]
board = ...
upload_flags = 
  --debug
  1

#5

See my update to dev/platform

So, you can control verbosity level for upload command with pio run -v flag. Could you re-test with upstream version http://docs.platformio.org/en/latest/platforms/espressif32.html#upstream?


#6

Your git version fails without the -v flag: Unexpected command line argument: 1 - and with the -v it’s verbose, as expected. I haven’t set upload_flags.

Looks like openocd doesn’t like that way of calling it:

openocd --debug 1 -s /Users/jcw/.platformio/packages/tool-openocd-esp32 -s /Users/jcw/.platformio/packages/tool-openocd-esp32/share/openocd/scripts -f share/openocd/scripts/interface/ftdi/esp32_devkitj_v1.cfg -f share/openocd/scripts/board/esp32-wrover.cfg -c "program_esp32 {{.pioenvs/esp32doit-devkit-v1/firmware.bin}} 0x10000 verify" -c "program_esp32 {{/Users/jcw/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin}} 0x1000 verify" -c "program_esp32 {{/Users/jcw/Code/jcw/pio/esp32-wrover/.pioenvs/esp32doit-devkit-v1/partitions.bin}} 0x8000 verify" -c "program_esp32 {{/Users/jcw/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin}} 0xe000 verify" -c "reset run; shutdown"
Open On-Chip Debugger  v0.10.0-esp32-20190313 (2019-03-13-09:59)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
User : 13 1 command.c:544 command_print(): debug_level: 3
Debug: 14 1 configuration.c:42 add_script_search_dir(): adding /Users/jcw/.platformio/packages/tool-openocd-esp32
Debug: 15 1 configuration.c:42 add_script_search_dir(): adding /Users/jcw/.platformio/packages/tool-openocd-esp32/share/openocd/scripts
Unexpected command line argument: 1

#7

But --debug=1 would work, I think.


#8

Thanks! Fixed in

Could you re-test with pio update?