platform-espressif32: [ESP32C3, macOS/Apple Silicon] Debugging does not upload nor start.

I’m on an Apple Mac Studio (Apple Silicon) with the latest vscode, platformio, etc.

I have a project w/ an ESP32C3. Compiling, uploading, running works fine.

Debugging does not work at all. It starts compiling the project, but then stops.

Successfully created esp32c3 image.
================================================================================================================================================== [SUCCESS] Took 19.38 seconds ==================================================================================================================================================

In the tab ‘Debugging-Console’, I see the following:

Info : telnet server disabled
Info : esp_usb_jtag: serial (34:B4:72:01:74:7C)
Info : esp_usb_jtag: Device found. Base speed 40000KHz, div range 1 to 255
Info : clock speed 5000 kHz
Info : JTAG tap: esp32c3.cpu tap/device found: 0x00005c25 (mfg: 0x612 (Espressif Systems), part: 0x0005, ver: 0x0)
Info : datacount=2 progbufsize=16
Info : Examined RISC-V core; found 1 harts
Info :  hart 0: XLEN=32, misa=0x40101104
Info : starting gdb server for esp32c3 on pipe
Info : accepting 'gdb' connection from pipe
Warn : No symbols for FreeRTOS!
Info : [esp32c3] Found 8 triggers
Info : Flash mapping 0: 0x10020 -> 0x3c050020, 127 KB
Info : Flash mapping 1: 0x30020 -> 0x42000020, 312 KB
Info : Auto-detected flash bank 'esp32c3.flash' size 4096 KB
Info : Using flash bank 'esp32c3.flash' size 4096 KB
Info : Flash mapping 0: 0x10020 -> 0x3c050020, 127 KB
Info : Flash mapping 1: 0x30020 -> 0x42000020, 312 KB
Info : Using flash bank 'esp32c3.irom' size 316 KB
Info : Flash mapping 0: 0x10020 -> 0x3c050020, 127 KB
Info : Flash mapping 1: 0x30020 -> 0x42000020, 312 KB
Info : Using flash bank 'esp32c3.drom' size 128 KB

Here’s my platformio.ini:

[platformio]
build_dir = /Volumes/ramdisk/platformio

[env:esp32-c3-wican]
platform = espressif32
board = esp32-c3-devkitm-1
framework = espidf
monitor_speed = 115200
monitor_filters = direct
build_flags = 
  -DCONFIG_BOARD_WICAN
  -DCONFIG_TWAI_TX=0
  -DCONFIG_TWAI_RX=3
  -DCONFIG_LED_HEARTBEAT=7
  -DCONFIG_LED_MOBILE=8
  -DCONFIG_LED_HARDWARE=9
extra_scripts = pre:computeVersion.py
upload_protocol = esp-builtin
debug_tool = esp-builtin
upload_port = /dev/cu.usbmodem2123101
monitor_port = /dev/cu.usbmodem2123101

board_build.flash_mode = qio
board_build.f_flash = 40000000L
board_build.partitions = partitions.csv
check_skip_packages = yes

Any idea what could be wrong?

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 16 (9 by maintainers)

Commits related to this issue

Most upvoted comments

I am having a similar problem. I have a custom board with an ESP32-C3. I am using vscode and Platformio on a windows machine. I believe what is happening is that the firmware gets loaded and the IDE enters debug mode but the chip does not get reset automatically. Therefore, the loaded program does not initialize and then run. The code seems to be stuck in FreeRTOS and not the code that has been loaded. The program will only run after the chip is reset. If you reset the chip, you loose connection to the debugger.

This article refers to the possible problem: https://esp32s3.com/getting-started.html

“NOTE! There is a ROM Mask bug in the current ESP32-S3 silicon that prevents the flashing process from resetting the board after flashing has finished, which means for now, you need to manually press the [RESET] button after flashing to manually reset the board so your code start running. Updated silicon from Espressif will fix this issue hopefully!”

I have spent the last 3 weeks trying to simply get connected to the custom board that we are using so that I can debug it. The code for the firmware is simple. Trying to get the stinking chip to work with seemingly different permutations of settings, configuration files and hidden calls for every minor variation of board and chip is beyond frustrating. The documentation is extensive but I have yet to find an explanation that explains, in a strait forward way, what is needed in general to get a chip running. There are extensive forum posts such as this that many wonderful people provide help. I would like to find a concise, explanation of what is required to get basic things (such as debug) running. The ESP32 is a great platform, unfortunately there are too many hardware variations with each requiring an obscure setting or tweak to run or debug. Certainly different IDE’s create difficulties not controlled by Espressif. I would love to find a good reference including a concise summary of exactly what is needed to get the chip to communicate and operate in debug mode. There are many references to configuration settings without reference to where the actual files are or are supposed to be, each explained as if you already know what they are referring to. The complexity continues with settings that go in the platformio.ini file and proper driver requirements, launch.json settings, etc… The complexity is understandable the frustration comes from trying to piece this together based on clued gleamed from help forums.

I am sorry for the rant, but hopefully, I have missed something and hopefully the frustrations listed will be helpful in this post to locate a solution. I have read extensive posts over the last few weeks with people having similar problems. It would be great to find a definitive, high level reference for this information that could be supplemented by Espressiff’s detailed web reference.

Thanks to those of you that are giving your time to help people such as myself.