Unable to load sketch into ESP32-c2 devkit

I bought the chinese clone ESP32-C2-devkit as I wanted bluetooth feature.

I used BluetoothSerial SerialBT; for my (esp32 wroom and that works). I am trying to use the same sketch for c2 devkit.

I see the device is using COM5 (CH340) in the device manager.

Problem: when uploading, it tries to connect and exits citing not connected on COM5

there is no cable issue, I used speed 115200 (so lowered). Tried pressing boot button...nothing worked

Board selected = ESP32 dev module ( as there is no c2 specific)

can you please suggest how to fix upload issue?

That will never work. Update your esp32 core and find that C2-board.

Also, have a look here:

the ESP32-C2 only supports BLE 5.0 - have a look at File>Examples>BLE>UART
the ESP32 supports Bluetooth Classic and BLE 4.2

have a look at Comparison table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6

not sure why I get google results that state - c2 is hidden for a reason

understood. but is that the only reason?

I am updating sketch to use
```

#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>

..#define SERVICE_UUID        "6E400001-B5A3-F393-E0A9-E50E24DCCA9E"#define CHARACTERISTIC_UUID_RX "6E400002-B5A3-F393-E0A9-E50E24DCCA9E"#define CHARACTERISTIC_UUID_TX "6E400003-B5A3-F393-E0A9-E50E24DCCA9E"....

but no luck yesterday. will try again

under Tools>Board ESP32 I cannot see the ESP32-C2

to connect to BLE UART on Android I use Serial Bluetooth Terminal
in menu under Devices select Bluetooth LE and click UART Service to connect

do i need to select esp32s3 ? I was using esp32 dev module

any particular reason to not use the ESP32 dev module?
give more details of the project?

I tend to use ESP32-S3 dev modules all the time unless there is something specific requiring a different dev module, e.g. used a ESP32-C6 for application requiring two Canbus interfaces

The IDE does not support the C2.

The developers of the platform configured the board definition so that it will be hidden from the menu. If you look in the boards.txt file, you will see it:

esp32c2.name=ESP32C2 Dev Module
esp32c2.hide=true

esp32c2.bootloader.tool=esptool_py
esp32c2.bootloader.tool.default=esptool_py

esp32c2.upload.tool=esptool_py
esp32c2.upload.tool.default=esptool_py
esp32c2.upload.tool.network=esp_ota

esp32c2.upload.maximum_size=1310720
esp32c2.upload.maximum_data_size=327680
esp32c2.upload.flags=
esp32c2.upload.erase_cmd=
esp32c2.upload.extra_flags=
esp32c2.upload.use_1200bps_touch=false
esp32c2.upload.wait_for_upload_port=false

esp32c2.serial.disableDTR=false
esp32c2.serial.disableRTS=false

esp32c2.build.tarch=riscv32
esp32c2.build.target=esp
esp32c2.build.mcu=esp32c2
esp32c2.build.core=esp32
esp32c2.build.variant=esp32c2
esp32c2.build.board=ESP32C2_DEV
esp32c2.build.bootloader_addr=0x0

esp32c2.build.cdc_on_boot=0
esp32c2.build.f_cpu=120000000L
esp32c2.build.flash_size=2MB
esp32c2.build.flash_freq=60m
esp32c2.build.flash_mode=qio
esp32c2.build.boot=qio
esp32c2.build.partitions=minimal
esp32c2.build.defines=

esp32c2.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS)
esp32c2.menu.PartitionScheme.minimal.build.partitions=minimal
esp32c2.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)
esp32c2.menu.PartitionScheme.default.build.partitions=default
esp32c2.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS)
esp32c2.menu.PartitionScheme.defaultffat.build.partitions=default_ffat
esp32c2.menu.PartitionScheme.no_fs=No FS 4MB (2MB APP x2)
esp32c2.menu.PartitionScheme.no_fs.build.partitions=no_fs
esp32c2.menu.PartitionScheme.no_fs.upload.maximum_size=2031616
esp32c2.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS)
esp32c2.menu.PartitionScheme.no_ota.build.partitions=no_ota
esp32c2.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
esp32c2.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS)
esp32c2.menu.PartitionScheme.noota_3g.build.partitions=noota_3g
esp32c2.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576
esp32c2.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS)
esp32c2.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat
esp32c2.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152
esp32c2.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS)
esp32c2.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat
esp32c2.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576
esp32c2.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS)
esp32c2.menu.PartitionScheme.huge_app.build.partitions=huge_app
esp32c2.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
esp32c2.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/128KB SPIFFS)
esp32c2.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
esp32c2.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080

esp32c2.menu.FlashMode.qio=QIO
esp32c2.menu.FlashMode.qio.build.flash_mode=dio
esp32c2.menu.FlashMode.qio.build.boot=qio
esp32c2.menu.FlashMode.dio=DIO
esp32c2.menu.FlashMode.dio.build.flash_mode=dio
esp32c2.menu.FlashMode.dio.build.boot=dio

esp32c2.menu.FlashFreq.60=60MHz
esp32c2.menu.FlashFreq.60.build.flash_freq=60m
esp32c2.menu.FlashFreq.30=30MHz
esp32c2.menu.FlashFreq.30.build.flash_freq=30m

esp32c2.menu.FlashSize.2M=2MB (16Mb)
esp32c2.menu.FlashSize.2M.build.flash_size=2MB
esp32c2.menu.FlashSize.4M=4MB (32Mb)
esp32c2.menu.FlashSize.4M.build.flash_size=4MB

esp32c2.menu.UploadSpeed.921600=921600
esp32c2.menu.UploadSpeed.921600.upload.speed=921600
esp32c2.menu.UploadSpeed.115200=115200
esp32c2.menu.UploadSpeed.115200.upload.speed=115200
esp32c2.menu.UploadSpeed.256000.windows=256000
esp32c2.menu.UploadSpeed.256000.upload.speed=256000
esp32c2.menu.UploadSpeed.230400.windows.upload.speed=256000
esp32c2.menu.UploadSpeed.230400=230400
esp32c2.menu.UploadSpeed.230400.upload.speed=230400
esp32c2.menu.UploadSpeed.460800.linux=460800
esp32c2.menu.UploadSpeed.460800.macosx=460800
esp32c2.menu.UploadSpeed.460800.upload.speed=460800
esp32c2.menu.UploadSpeed.512000.windows=512000
esp32c2.menu.UploadSpeed.512000.upload.speed=512000

esp32c2.menu.DebugLevel.none=None
esp32c2.menu.DebugLevel.none.build.code_debug=0
esp32c2.menu.DebugLevel.error=Error
esp32c2.menu.DebugLevel.error.build.code_debug=1
esp32c2.menu.DebugLevel.warn=Warn
esp32c2.menu.DebugLevel.warn.build.code_debug=2
esp32c2.menu.DebugLevel.info=Info
esp32c2.menu.DebugLevel.info.build.code_debug=3
esp32c2.menu.DebugLevel.debug=Debug
esp32c2.menu.DebugLevel.debug.build.code_debug=4
esp32c2.menu.DebugLevel.verbose=Verbose
esp32c2.menu.DebugLevel.verbose.build.code_debug=5

esp32c2.menu.EraseFlash.none=Disabled
esp32c2.menu.EraseFlash.all=Enabled
esp32c2.menu.EraseFlash.all.upload.erase_cmd=-e

Note this line:

esp32c2.hide=true

Reference:

https://arduino.github.io/arduino-cli/latest/platform-specification/#hiding-boards

I started my project using wemos d1 mini 4.0
I found that I can't access the webserver because of a possible firewall

So I need to use a controller that supports bluetooth.

I have only one esp32 -wroom that I used for another project and dont want to distrub that.

I need to order wrooms, and there can be 1 week delay.

I have 2 esp32-c2-devkit handy. This is the reason.

I was not aware of the c2 limitations till I tried a sketch y'day.

Any solution?

no problem.
I want to know , will unhide let me upload? goal is uploading the sketch

No. It will only add the item to Arduino IDE's Tools > Board > esp32 menu. It doesn't resolve the fundamental lack of support for this microcontroller that was previously pointed out in this topic. In order to resolve that, you must perform the procedure specified in the documentation:

https://docs.espressif.com/projects/arduino-esp32/en/latest/getting_started.html#supported-soc-s

ESP32-C2 and ESP32-C61 are also supported by Arduino-ESP32 but require using Arduino as an ESP-IDF component or rebuilding the static libraries. For more information, see the Arduino as an ESP-IDF component documentation or the Lib Builder documentation, respectively.

This is a very advanced endeavor. If you are looking for a challenge, or to learn about the low level details of the Espressif development framework, then maybe it will be worth doing. But if you would rather spend your time progressing with your project, then you should just buy a board that is supported out of the box by Arduino IDE.


My comment about the hide property was only to address the comment @horace made:

I tried to use Vscode + ESP IDF ...still no luck...hmm

what is the best ESP dev board ...Wroom ? or S3 ? or C5 ?

I dont want to buy S3 and struggle again as I see some have 2 USB-c ports?

I have just purchased two more esp32-s3-devkitc-1 modules so can recommend them

they have two USB ports which can be very useful

  1. UART for programming and serial monitor
  2. USB OTG Device and HOST - the ESP32 can act as a USB device (keyboard, mouse, etc) and HOST (connect a keyboard, RS232 serial, etc and read/writer from/to the device)

in the main you just use the USB UART port

it does not support Classic Bluetooth as on the ESP32
it does support BLE which can communicate with Bluetooth Terminal on an Android phone

You said:

I used BluetoothSerial SerialBT; for my (esp32 wroom and that works)

@jim-p makes a good point - if the ESP32 BluetoothSerial SerialBT worked why not get another ESP32 rather than an ESP32-S3 and then have to figure out BLE UART? BLE is much more complex than Bluetooth Classic

seller gave me this link.

will work for only 2 days

I dont understand why hello world also does not work

Did you try following the advice from the error message?:

Note: Please set a higher baud rate (--baud) if ESP32-C2 doesn't connect (at least 115200 Bd is recommended).
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html

cant see about baud rate (though I did change to 74880 and was able to build...not flash)

I cant see that note