ESP32-S3-DevKitC-1.1-N8R2-v1.1 configuration assistance (odd problems)

Hi,

It seems I am overlooking something obvious as I get the impression people have long ago resolved this issue and I am not able to move a millimeter forward. I am trying to avoid the use the JTAG 4-pin interface as the Espressif literature seems to state that the USB native port, is the way to go for simple upload and debugging of the C3 and S3 family. I paid special attention to maxgerhardt posts to no avail. My goal is to be able to setup a configuration for any ESP32-S3-DevKitC-1.1-NxRy, to upload and debug over the native USB interface. I expect to use this Wroom processors in two coming projects.

In this case I am trying to have a successful setup for an ESP32-S3-DevKitC-1.1-N8R2-v1.1 using the native ESP32-S3 USB interface (D+ and D- for uploading and debugging) and despite having played with many platformio.ini options (not shown for keeping this post as short and as clean as possible, that I tried during 2 days of dozens of suggestions) I have never been able to get a different “Flash” and “RAM” total, like the one showed in the snippet further down (327.680 RAM and 3.342.336 Flash) which is odd as many PlatformIO community posts, report having succeeded to recognize their particular processor storage FLASH/PSRAM combination (I assume my case is qio_qio).

My board has an USB and UART microUSB port (S3-DevKitC-version 1.1) and on both I am able to upload the code but only on the USB port I am able to get the output of the Serial Monitor (printf instructions in code). I have installed the libsub (Win USB) driver in my machine and when the board is plugged on the PC-USB port I get COM26. Not sure how to enforce libsub usage?
As you can notice on platformio.ini, I tried to use a different board directive “board = esp32-s3-devkitc-1-n8r2v”, that I stored in the OpenOCD “boards” directory with the changes that might have an effect, but with no success as shown further down with the message “Error: esp_usb_jtag: could not find or open device!”

Thanks for any advice, the lines staring with a bunch of “*” have text at the end describing what comes next.

Thomas

****************************** Compiler output

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-s3-devkitc-1.html
PLATFORM: Espressif 32 (6.6.0) > Espressif ESP32-S3-DevKitC-1-N8 (8 MB QD, No PSRAM)
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
DEBUG: Current (esp-builtin) On-board (esp-builtin) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 @ 3.20014.231204 (2.0.14)
 - tool-esptoolpy @ 1.40501.0 (4.5.1)
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 34 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Retrieving maximum program size .pio\build\esp32-s3-devkitc-1\firmware.elf
Checking size .pio\build\esp32-s3-devkitc-1\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   5.7% (used 18820 bytes from 327680 bytes)
Flash: [=         ]   7.9% (used 265189 bytes from 3342336 bytes)

****************************** OS & machine
Thinkpad Intel Core i7
Windows 10 Pro / 22H2 / 32GB RAM

****************************** Visual Studio Code version
VSC Version: 1.89.0 (user setup)
Commit: b58957e67ee1e712cebf466b995adf4c5307b2bd
Date: 2024-05-01T02:09:22.859Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Windows_NT x64 10.0.19045

****************************** PlatformIO version
PlatformIO IDE v3.3.3

****************************** Windows USB driver (Installed using “UsbDriverTool-2.1.exe” from Automatic USB driver installer for FTDI and LibUSB drivers)
libsub (Win USB) drivers

****************************** Open OCD install
// “C:\Users<User Name>.platformio\penv\Scripts” was added to Windows PATH environment variable for terminal “pio” command
pio pkg install --global --tool “platformio/tool-openocd@^3.1200.0”
// “C:\Users<User Name>.platformio\packages\tool-openocd\bin” was added to Windows PATH environment variable for “openocd” command
openocd -c ‘set ESP_RTOS none’ -f board/esp32s3-builtin.cfg

****************************** platformio.ini

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
;board = esp32-s3-devkitc-1-n8r2v
framework = arduino
monitor_speed = 115200

build_flags = 
    -DBOARD_HAS_PSRAM 
;    -mfix-esp32-psram-cache-issue
    -DARDUINO_ESP32S3_DEV
    -DCORE_DEBUG_LEVEL=5
    -DCONFIG_SPIRAM_USE

****************************** main.cpp

#include <Arduino.h>

int total_loop_runs = 0;

// put function declarations here:
int myFunction(int, int);

void setup() {
  Serial.begin(115200);
  Serial.printf("Program Setup Start!\n");
  // put your setup code here, to run once:
  int result = myFunction(2, 3);
}

void loop() {
  // put your main code here, to run repeatedly:
  total_loop_runs++;
  Serial.printf("Program loop execution %d\n", total_loop_runs);
  // Wait 5 seconds before repeat
  delay(5000);
}

// put function definitions here:
int myFunction(int x, int y) {
  return x + y;
}

****************************** Serial Monitor output

--- Terminal on COM26 | 115200 8-N-1
--- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a80
entry 0x403c98d0
[   304][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
Program Setup Start!
Program loop execution 1
Program loop execution 2
Program loop execution 3
Program loop execution 4
Program loop execution 5
Program loop execution 6
Program loop execution 7
Program loop execution 8
Program loop execution 9

****************************** Preparing for code debugging (fail, no idea how to fix)

openocd -c 'set ESP_RTOS none' -f board/esp32s3-builtin.cfg
xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-15:04)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
none
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
Warn : Transport "jtag" was already selected
force hard breakpoints
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: esp_usb_jtag: could not find or open device!

Really simple. Plug in the USB cable into the native USB port of the dev board (not the UART one). Boot the ESP32S3 into bootloader mode (BOOT button held down, EN button pressed once, BOOT button released). Open Zadig (https://zadig.akeo.ie/) and make it list all devices. Is there any “USB JTAG” sounding device there at all? What driver does it have?

Hi, thanks for looking at the issue.

Hi,

Is this zadig utility doing the same as what I have done with the utility at Automatic USB driver installer for FTDI and LibUSB drivers?
It too installed a WinUsb (libusb)

It was my hope that in my new designs I didn’t need to replicate the two buttons. Maybe it would be easier to have the JTAG connectors and burn the fuse (with the espressif utility) so that 4-pin JTAG is directly available?

I’m not sure if needs libusb or WinUSB. Try both, with Zadig.

Hi,
I haven’t done the zadig stuff assuming that the utility I mentioned in my original post is equivalent?
Did two different things with no apparent effect nor better result of “openocd -c ‘set ESP_RTOS none’ -f board/esp32s3-builtin.cfg”.

  1. Plugged cable into native USB port (red LED lit on). Pressed BOOT without releasing, then pressed RESET for one second and then released BOOT.
  2. With the board not connected to the PC (no power and no red LED on) I pressed the BOOT button, then plugged the USB cable (red LED turned on), then pressed the RESET button for a second and then released the BOOT button.

No effect noticed and this is shown at the properties of the device manager after the procedure:

When running the command (I assume it is required???) I get the same output.

openocd -c ‘set ESP_RTOS none’ -f board/esp32s3-builtin.cfg
xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-15:04)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
none
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
Warn : Transport “jtag” was already selected
force hard breakpoints
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: esp_usb_jtag: could not find or open device!

Sorry for the spanish OS (it is the company computer, I work in Chile)

Will do the Zadig stuff now and will come back with the result.

Hi,
After running Zadig and installing two things/drivers:
libusb0 (v1.2.7.3) → WinUSB (v6.1.7600.16385)
libusb0 (v1.2.7.3) → libusb-win32(v1.2.7.3)

I repeat the BOOT-RESET procedure and then I open Zadig and show the list of devices, looking like this:

Do not see any JTAG stuff. Maybe I should first get rid of all lib-usb entries?
imagen

Hi,
Because nothing was happening (at least that was my impression) I decided to remove from device manager the two lib-usb entries I showed before, after running Zadig the first time:

  1. Removed libusb (WinUSB) devices
    WinUSB Generic Device
  2. libusb-win32 devices
    CP2102N USB to UART Bridge Controller

Then I used Zadig again to install WinUSB and libusb-win32 (in this same order) and the result in device manager was:
imagen

Because I was missing WinUSB, I used Zadig to install it, making the assumption it was a problem of installation order, but after doing it, libusb-win32 was not present anymore in device manager, so it seems it is either one or the other. Reinstalled libusb-win32, but when doing the button sequence I do not notice anything and it is not clear to me what I should notice or what should change?

Now I have a new problem and it is related to no COM port being added when I plug the DevKitC into the USB port and therefore lost the ability to upload code. I will probably need to reinstall a USB to serial bridge from Silicon Labs. Now why is a SiliconLabs bridge required for a native Espressif device, is a mistery to me.

What I do not get (because it now seems to me this is an issue that is probably not related to PlatformIO) that after so much time, since this processors where released, I can not find an idiot-proof method of connecting the ESP32-S3-DevKitC-1 (with any storage Flash/PSRAM combination to a Windows PC)? And ending up (due to lack of knowledge about PlatformIO) bothering this comunity for help.

Sorry for the rant, but I am struggling since thursday last week with this problems. I am sick of doing printf code debugging :slight_smile:

New scenario!

Not sure how I got here (maybe start from scratch in the near future to understand better) but now I have the ESP32-S3-DevKitC-1.1 N8R2, connected by the board USB port to my PC and the device manager is now showing 2 JTAG interfaces, that are only available when using the USB port of the Kit.
imagen

If I change to the UART port of the KIT they disappear and COM28 shows up.
imagen

So now the BOOT/RESET sequence (while connected to the USB port of the KIT) generates a sound on the PC at press of RESET and at release of RESET.

Now if I execute this command I get a bit further (I am running this program with no understanding or clarity that it is needed :slight_smile: )
openocd -c ‘set ESP_RTOS none’ -f board/esp32s3-builtin.cfg
xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-15:04)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
none
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
Warn : Transport “jtag” was already selected
force hard breakpoints
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : esp_usb_jtag: Device found. Base speed 40000KHz, div range 1 to 255
Info : clock speed 40000 kHz
Info : JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Error: Unexpected OCD_ID = 00000000
Warn : target esp32s3.cpu1 examination failed
Info : starting gdb server for esp32s3.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Info : [esp32s3.cpu0] Debug controller was reset.
Info : [esp32s3.cpu0] Core was reset.
Error: Unexpected OCD_ID = 00000000
Error: Unexpected OCD_ID = 00000000
Error: Unexpected OCD_ID = 00000000
Error: Unexpected OCD_ID = 00000000
Error: Unexpected OCD_ID = 00000000

Now using the USB port only I cannot load the code (maybe I have to use two cables?)
Anyway it was loaded before and I select at the bottom of VSC_PIO
PIO Debug (Without uploading) and things do not go very well afterwards.
imagen

This is the JSON file offered by the window
// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY
//
// PlatformIO Debugging Solution
//
// Documentation: Debugging — PlatformIO v6.1 documentation
// Configuration: Debugging options — PlatformIO v6.1 documentation

{
“version”: “0.2.0”,
“configurations”: [
{
“type”: “platformio-debug”,
“request”: “launch”,
“name”: “PIO Debug”,
“executable”: “c:/Data/Project/Guardian/NewPCB_2/Code/Test/TestDevKit_00/.pio/build/esp32-s3-devkitc-1/firmware.elf”,
“projectEnvName”: “esp32-s3-devkitc-1”,
“toolchainBinDir”: “C:/Users/tmagdahl/.platformio/packages/toolchain-xtensa-esp32s3/bin”,
“internalConsoleOptions”: “openOnSessionStart”,
“preLaunchTask”: {
“type”: “PlatformIO”,
“task”: “Pre-Debug”
}
},
{
“type”: “platformio-debug”,
“request”: “launch”,
“name”: “PIO Debug (skip Pre-Debug)”,
“executable”: “c:/Data/Project/Guardian/NewPCB_2/Code/Test/TestDevKit_00/.pio/build/esp32-s3-devkitc-1/firmware.elf”,
“projectEnvName”: “esp32-s3-devkitc-1”,
“toolchainBinDir”: “C:/Users/tmagdahl/.platformio/packages/toolchain-xtensa-esp32s3/bin”,
“internalConsoleOptions”: “openOnSessionStart”
},
{
“type”: “platformio-debug”,
“request”: “launch”,
“name”: “PIO Debug (without uploading)”,
“executable”: “c:/Data/Project/Guardian/NewPCB_2/Code/Test/TestDevKit_00/.pio/build/esp32-s3-devkitc-1/firmware.elf”,
“projectEnvName”: “esp32-s3-devkitc-1”,
“toolchainBinDir”: “C:/Users/tmagdahl/.platformio/packages/toolchain-xtensa-esp32s3/bin”,
“internalConsoleOptions”: “openOnSessionStart”,
“loadMode”: “manual”
}
]
}

These are the errors reported on the console
Reading symbols from c:\Data\Project\Guardian\NewPCB_2\Code\Test\TestDevKit_00.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:48)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
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: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Error: libusb_get_string_descriptor_ascii() failed with -5
.pioinit:11: Error in sourced command file:
Remote communication error. Target disconnected.: Success.

Sorry if all this dumped stuff is usless garbage, but I am trying to avoid the time lost in asking for it and eventually some clue I cannot detect is hidden in it.

At least it seems to me that I entered the PlatformIO realm :slight_smile:

I have been struggling with this issue with no positive results.

I am not sure if this might be the root of the problem, but when I use Zadig to install drivers, I select Interface 0 and load “USB Serial (CDC)”, but I do not get a green check mark on the WCID box. If I select Interface 2 and inmediately go back to Interface 0 the box remains with a red cross and on the selectable driver list box I have WinUSB (v6.1.7600.16385). Should this selector show what is installed at that interface or is that the dafault value when you change to any interface?

Anyway, despite how that selector box is filled, I think the problem is that I have a red cross on the WCID.

This URL seemed to be the solution to my difficulties but I think I am stuck at the driver level.

I was able to discover my problem.

Do not why I got the crazy idea, that when plugging the USB labeled port of ESP32-S3-DevKitC into the PC, I had to end up (after using Zadig) with two COM ports (one related to interface 0 and the other related to interface 2).

Always holding this as true, there was no way debugging would ever succeed.

Even got down the path of installing ESP-IDF as a plugin into VSC and later installing Espressif’s ESP-IDE with ESP-IDF with no success either. Maybe with time you can get accustomed to the complexity of configuration options (including voltages) that you have in Eclipse, not to mention OS environment variables that at least in my case never got initialized, but compared to platformio, it was a scary experience :blush:. Anyway going down that path I noticed that only Interface 0 had to be seen as a COM port, which made me decide to reattempt platformIO and everything worked.

Thanks https://community.platformio.org/u/maxgerhardt for your help attempt, because I am sure you got fed up with all the information I provided :rofl:.

This is my platformio.ini setting if anyone wants to look at it.

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
monitor_speed = 115200
upload_port = COM34
monitor_port = COM34
build_flags =
-DARDUINO_USB_CDC_ON_BOOT=1
monitor_dtr = 1
monitor_rts = 1
lib_deps = adafruit/Adafruit [NeoPixel@^1.12.2](mailto:NeoPixel@%5e1.12.2)

I will open another topic to solve my doubds regarding FLASH size and PSRAM as this one is cluttered with useless posts (mine).

Regards