Continuing the discussion from ESP32-S3-DevKitC Module with WROOM-1-N16R8 on-board jtag not debugging:
Here’s the JSON I’m using. Also need to mention the debugger works fine on other ESP32s using the external JTAG esp-prog interface.
{
“build”: {
“arduino”:{
“ldscript”: “esp32s3_out.ld”,
“partitions”: “default_16MB.csv”,
“memory_type”: “qio_opi”
},
“core”: “esp32”,
“extra_flags”: [
“-DARDUINO_ESP32S3_DEV”,
“-DBOARD_HAS_PSRAM”,
“-DARDUINO_USB_MODE=1”,
“-DARDUINO_USB_CDC_ON_BOOT=1”
],
“f_cpu”: “240000000L”,
“f_flash”: “80000000L”,
“flash_mode”: “qio”,
“psram_type”: “opi”,
“hwids”: [
[
“0x303A”,
“0x1001”
]
],
“mcu”: “esp32s3”,
“variant”: “esp32s3”
},
“connectivity”: [
“wifi”,
“bluetooth”
],
“debug”: {
“default_tool”: “esp-builtin”,
“onboard_tools”: [
“esp-builtin”
],
“openocd_target”: “esp32s3.cfg”
},
“frameworks”: [
“arduino”,
“espidf”
],
“name”: “Espressif ESP32-S3-DevKitC-1-N16R8V (16 MB QD, 8MB PSRAM)”,
“upload”: {
“flash_size”: “16MB”,
“maximum_ram_size”: 327680,
“maximum_size”: 16777216,
“require_upload_port”: true,
“speed”: 921600
},
“url”: “ESP32-S3-DevKitC-1 - ESP32-S3 - — esp-dev-kits latest documentation”,
“vendor”: “Espressif”
}
Alternatively you can use the stock esp32-s3-devkitc-1
with a few additional settings in your platformio.ini:
[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
board_build.arduino.memory_type = qio_opi
board_build.flash_mode = qio
board_build.psram_type = opi
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
board_build.partitions = default_16MB.csv
board_build.extra_flags =
-DBOARD_HAS_PSRAM
See GitHub - sivar2311/ESP32-S3-PlatformIO-Flash-and-PSRAM-configurations: ESP32-S3 PlatformIO Flash and PSRAM configurations
Thanks, I’ll give this a try!
Sorry, still no good. I tried the modified esp32-s3-devkitc-1 and still no luck. Has anyone gotten this to work?
Which modified “esp32-s3-devkitc-1” do you mean?
No one of the settings in the link above does match your configuration!?
I own several ESP32-S3-N16R8 and all work perfectly with the corresponding settings.
Before start to using a debug probe etc.: Did you try to upload a simple “blink” or “hello world” sketch? Does it work?
I used the esp32-s3-devkitc-1 and the platformio.ini changes specified. No, I haven’t tried a blink. I’ll give that a try, but if it works then I’m confused, as I was using a known good piece of RTS code that I’ve been developing using an external JTAG interfeace. Thanks
There is one thing I missed:
[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
board_build.arduino.memory_type = qio_opi
board_build.flash_mode = qio
board_build.psram_type = opi
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
board_build.partitions = default_16MB.csv
board_build.extra_flags =
-DBOARD_HAS_PSRAM
-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1
Here is what I have in my ini file:
[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
board_build.arduino.memory_type = qio_opi
board_build.flash_mode = qio
board_build.psram_type = opi
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
board_build.partitions = default_16MB.csv
board_build.extra_flags =
-DBOARD_HAS_PSRAM
-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1
and this is what I see when trying to debug the program.
Reading symbols from /Users/fischp/Documents/PlatformIO/Projects/S3 test/.pio/build/esp32-s3-devkitc-1/firmware.elf…
PlatformIO Unified Debugger → Redirecting...
PlatformIO: debug_tool = esp-builtin
PlatformIO: Initializing remote target…
Open On-Chip Debugger v0.11.0-esp32-20220706 (2022-07-06-15:49)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect ‘jtag’
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
adapter speed: 40000 kHz
Warn : Transport “jtag” was already selected
adapter speed: 5000 kHz
Info : tcl server disabled
Info : telnet server disabled
Error: esp_usb_jtag: could not find or open device!
.pioinit:11: Error in sourced command file:
Remote connection closed
I’ve also tried using both of the USB-C connections on the module, I’m not clear if there’s a right one to use…
The program I’m trying to debug is the stub program created when making a new PIO project:
#include <Arduino.h>
// put function declarations here:
int myFunction(int, int);
void setup()
{
// put your setup code here, to run once:
int result = myFunction(2, 3);
}
void loop()
{
delay(1000);
}
// put function definitions here:
int myFunction(int x, int y)
{
return x + y;
}
You need to use the USB/OTG port, not the UART port!
Before debugging, bring the whole thing to work! Try to upload a hello world / blink sketch. If this fails, also debugging won’t work!
Understood. I tried a plain upload of my test program and it doesn’t seem like it’s finding my board. I tried a different USB cable and got the same results:
CURRENT: upload_protocol = esptool
Looking for upload port…
Auto-detected: /dev/cu.usbmodem1234561
Uploading .pio/build/esp32-s3-devkitc-1/firmware.bin
esptool.py v4.5.1
Serial port /dev/cu.usbmodem1234561
Connecting…
A fatal error occurred: Failed to connect to ESP32-S3: No serial data received.
For troubleshooting steps visit: Troubleshooting - ESP32 - — esptool latest documentation
*** [upload] Error 2
============================= [FAILED] Took 13.73 seconds =============================
For what it’s worth, I’m running on a Mac and haven’t had issues with the external JTAG. What is the esptool supposed to be set to?