I have been trying to get started with debugging a board with an ESP32-S3-WROOM-1 micro.
I’m running platformio in VSCode on Windows 10, using the Arduino libraries.
As I understand it, this part has a built-in JTAG interface, which I’ve been trying to use.
Much of the advice I have seen online has referenced using OpenOCD. I have not been able to use OpenOCD, as I get “The term ‘openocd’ is not recognized as the name of a cmdlet. . .” error.
I see this whether I try to execute in the Powershell terminal or the PlatformIO Core CLI terminal. If I understand correctly, the Powershell terminal no longer has the correct environment variables, so I might expect it wouldn’t work there, but should in the CLI terminal.
I found this thread already:
To answer the questions there:
(1) I have a directory called “tool-openocd-esp32” at C:\Users<my name>.platformio\packages.
(2) A selection of the output of Advanced → Verbose Upload is:
PACKAGES:
- framework-arduinoespressif32 @ 3.20014.231204 (2.0.14)
- tool-esptoolpy @ 1.40501.0 (4.5.1)
- tool-mkfatfs @ 2.0.1
- tool-mklittlefs @ 1.203.210628 (2.3)
- tool-mkspiffs @ 2.230.0 (2.30)
- toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
- toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
(It seems strange that the list of packages here is shorter than the packages I see in the directory referenced in item (1)).
(3) The platform.ini file is
[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
monitor_speed = 115200
[env:debug]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
;monitor_speed = 115200
debug_tool = esp-builtin ; use the USB-JTAG built into the ESP32-S3-WROOM.
build_type = debug
debug_speed = 5000
debug_init_break = tbreak setup ;https://www.youtube.com/watch?v=HGB9PI3IDL0 26:13
; these ports may change - check Device Manager to confirm
upload_port = COM7 ; this is the Jtag/serial debug port listed in Device Manager - *debug* code is loaded through this port
monitor_port = COM9 ; the ordinary serial port that is on the USB ON THE BA PCB
lib_deps =
adafruit/Adafruit INA219 @ ^1.2.3
adafruit/Adafruit BusIO@^1.16.0
adafruit/RTClib @ ^2.1.4
build_flags =
-D USER_SETUP_LOADED
-D ST7796_DRIVER
-D TFT_INVERSION_OFF
-D TFT_BL=48
-D TFT_BACKLIGHT_ON=HIGH
-D TFT_MISO=37
-D TFT_MOSI=35
-D TFT_SCLK=36
-D TFT_CS=38
-D TFT_DC=18
-D TFT_RST=-1
-D LOAD_GLCD
-D LOAD_FONT2
-D LOAD_FONT4
-D LOAD_FONT6
-D LOAD_FONT7
-D LOAD_FONT8
-D LOAD_GFXFF
-D LOAD_RLE
-D SMOOTH_FONT
-D USE_HSPI_PORT
-D SPI_FREQUENCY=80000000
-Wl,--print-memory-usage,-Map,output.map
I also tried the advice in the other thread of deleting the “tool-openocd-esp32” directory, then rebuilt - however, the “tool-openocd-esp32” directory did NOT reappear after rebuilding.
Questions:
(1) how do I get OpenOCD working?
(2) Am I correct that to use OpenOCD, that I need to use the Core CLI terminal, not Powershell?
(3) Why is the list of packages shown during Verbose Upload shorter than the list of packages I see in my …/.platformio/packages directory?