# Upload sketch to ESP32 C6 Super mini

**URL:** <https://forum.arduino.cc/t/upload-sketch-to-esp32-c6-super-mini/1418208>\
**Category:** Networking, Protocols, and Devices\
**Created:** [December 5, 2025, 10:38pm UTC](https://forum.arduino.cc/t/upload-sketch-to-esp32-c6-super-mini/1418208 "2025-12-05T22:38:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnhb](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnhb/32/239468_2.png) [@johnhb](https://forum.arduino.cc/u/johnhb)\
**Post date:** [December 5, 2025, 10:38pm UTC](https://forum.arduino.cc/t/upload-sketch-to-esp32-c6-super-mini/1418208/1 "2025-12-05T22:38:21Z")

</div>

I purchased two ESP32 C6 super mini modules from Aliexpress. I want to use a small footprint bluetooth module to control a TB6612FNG module to experiment with battery powered HO scale model trains.

I was using the Live Mini Kit ESP32 which worked fine but was hoping to use the C6 smaller footprint.

However I cannot upload the sketch. I have tried several different boards in Arduino but no success.

I have tried to hold the boot button down , press and release the reset button. This brings on the blue led and changes the port available in Arduino from 10 to 14. But I get the same failed upload.

Here’s the code

```arduino
#include <BluetoothSerial.h>

// Check if Bluetooth is available

#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)

#error Bluetooth is not enabled! Please run `make menuconfig` to enable it

#endif

// Check Serial Port Profile

#if !defined(CONFIG_BT_SPP_ENABLED)

#error Serial Port Profile for Bluetooth is not available or not enabled. It is only available for the ESP32 chip.

#endif

BluetoothSerial SerialBT;

const int PWM_CHANNEL = 0; // ESP32 has 16 channels which can generate 16 independent waveforms

const int PWM_FREQ = 3000; // Recall that Arduino Uno is ~490 Hz. Official ESP32 example uses 5,000Hz

const int PWM_RESOLUTION = 8; // We'll use same resolution as Uno (8 bits, 0-255) but ESP32 can go up to 16 bits 

// The max duty cycle value based on PWM resolution (will be 255 if resolution is 8 bits)

const int MAX_DUTY_CYCLE = (int)(pow(2, PWM_RESOLUTION) - 1); 

const int OUTPUT_PIN = 19;

const int DELAY_MS = 100; // delay between fade increments

// input codes from Battery Throttle

bool Power = 0; // P0 = power off, P1 = power on

bool Direction = 1; // D0 = reverse, D1 = forward

bool HLights = 0; // HL0 = headlights off, HL1 = headlights on

bool TLights = 0; // TL0 = taillights off, TL1 = taillights on.

bool Horn = 0; // S0 = Horn off, S1 = Horn on

int AIN1 = 16; // D2 direction output

int AIN2 = 17; // D3 direction output

int STBY = 32; // D4 must be High to drive motor

String loco_ID = "L4599"; //store loco_ID etc in eeprom.

char buffer[2];

int DataReadIn[2];

bool locoDirection = 0; //forward

int Speed = 0;

int debug = 1; //set to 1 to show debug info on serial port.

String commandString;

void setup() {

  pinMode(AIN1, OUTPUT);

  pinMode(AIN2, OUTPUT);

  pinMode(STBY, OUTPUT);

  digitalWrite(STBY, HIGH); //high to enable DRV8833

  Serial.begin(115200);

  SerialBT.begin(loco_ID);

  DataReadIn[0] = 0;

  DataReadIn[1] = 0;

  DataReadIn[2] = 0;

  // Sets up a channel (0-15), a PWM duty cycle frequency, and a PWM resolution (1 - 16 bits) 

  ledcAttachChannel(OUTPUT_PIN, PWM_FREQ, PWM_RESOLUTION, PWM_CHANNEL);

 }

void loop() {

  if (SerialBT.available()>0) {

    commandString = SerialBT.readStringUntil(62); //>

    interpretCommand();

    if (debug){

    Serial.print("Values In [0]= ");

    Serial.print(DataReadIn[0]);

    Serial.print(" and [1]= ");

    Serial.print(DataReadIn[1]);

    Serial.print(" and [2]= ");

    Serial.println(DataReadIn[2]);

  }

    delay(2000);

}

    SerialBT.flush();

}

void interpretCommand(){

  int index1 = commandString.indexOf("L");

  String whichLoco = commandString.substring(index1, 5);

  if (whichLoco == loco_ID){

    Serial.println ("Command is for this loco");

    int commandCode = commandString.substring(6, 1).toInt();

  switch (commandCode){

    case 1: {doEStopStart();} break; // Emergency stop

    case 2: {doDirection();} break; // direction

    case 3: {doSpeed();} break; // speed

    case 4: {doHLights();} break; // head lights

    case 5: {doTLights();} break; // tail lights

    case 6: {doHorn();} break; // horn

  } 

  }

}

void doHLights(){

int commandValue = commandString.substring(7, 1).toInt();

  switch (commandValue){

    case 0: {Serial.println("Head lights Off");} break; // Hlights off

    case 1: {Serial.println("Head lights On");} break;

  }

}

void doTLights(){

int commandValue = commandString.substring(7, 1).toInt();

  switch (commandValue){

    case 0: {Serial.println("Tail lights Off");} break; // Tlights off

    case 1: {Serial.println("Tail lights On");} break;

  }

}

void doHorn(){

int commandValue = commandString.substring(7, 1).toInt();

  switch (commandValue){

    case 0: {Serial.println("Horn Off");} break; // horn off

    case 1: {Serial.println("Horn On");} break;

  }

}

void doDirection(){

int commandValue = commandString.substring(7, 1).toInt();

switch(commandValue){

  case 0: {Serial.println("Direction is reverse");

              digitalWrite(AIN1, LOW);

              digitalWrite(AIN2, HIGH);} break;

  case 1: {Serial.println("Direction is forward");

              digitalWrite(AIN1, HIGH);

              digitalWrite(AIN2, LOW);} break;

              }

}

void doSpeed(){

int commandValue = commandString.substring(7, 1).toInt();

        if (commandValue>=0){

          if (debug){

        Serial.print("Speed is ");

        Serial.println(commandValue);

          }

        int dutyCycle = (commandValue);

        analogWrite(OUTPUT_PIN, dutyCycle);

        }

        if (debug) {

          Serial.print("Speed is ");

          Serial.println(commandValue);

        }

}

void doEStopStart(){

int commandValue = commandString.substring(7, 1).toInt();

  switch (commandValue){

    case 0:{

    digitalWrite(STBY, LOW);

    digitalWrite(AIN1, LOW);

    digitalWrite(AIN2, LOW);

    Serial.println("STOP");} break;

    case 1:{

    digitalWrite(STBY, HIGH);

    Serial.println("RUN");} break;

    }

}

```

and this is the error message

Compilation error. #error Bluetooth is not enabled! Please run _make menuconfig_ to enable it.

Where can I find _make menuconfig_? A search on Google only directs me to Linux articles.

The board selected is the ESP32C3 Dev module. I get the same error when ESP32C6 Dev module selected.

My apologies if I have posted this article in the wrong place.

Hope someone can make sense of my problem and help me out.

---

<div class="post-metadata">

**Author:** ![kmin](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kmin/32/1147370_2.png) [@kmin](https://forum.arduino.cc/u/kmin)\
**Post date:** [December 5, 2025, 10:47pm UTC](https://forum.arduino.cc/t/upload-sketch-to-esp32-c6-super-mini/1418208/2 "2025-12-05T22:47:58Z")

</div>

> [@johnhb](#):
>
> `BluetoothSerial.h`

I would expect that library using classic bluetooth, which C6 doesn't have (BLE only).

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [December 6, 2025, 5:07am UTC](https://forum.arduino.cc/t/upload-sketch-to-esp32-c6-super-mini/1418208/3 "2025-12-06T05:07:16Z")

</div>

> [@johnhb](#):
>
> My apologies if I have posted this article in the wrong place.

The category where you posted is OK. Your topic title a little less so 😉  
When I did read the title I thought it was an upload problem but it is a compile problem.

Maybe you should change the topic title 😉

Pushing whatever button on your board will not solve compile problems. Compilation can actually be done without a board connected.

---

<div class="post-metadata">

**Author:** ![horace](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/horace/32/1014299_2.png) [@horace](https://forum.arduino.cc/u/horace)\
**Post date:** [December 6, 2025, 6:40am UTC](https://forum.arduino.cc/t/upload-sketch-to-esp32-c6-super-mini/1418208/4 "2025-12-06T06:40:02Z")

</div>

if you have a look at [Comparison chips (SoCs) table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6](https://gist.github.com/sekcompsci/2bf39e715d5fe47579fa184fa819f421) - it shows the ESP32C6 only supports BLE  
try File\>Examples\>BLE\>UART for a BLE serial example

if you require Bluetooth Classic try the original ESP32

---

<div class="post-metadata">

**Author:** ![GolamMostafa](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/golammostafa/32/239011_2.png) [@GolamMostafa](https://forum.arduino.cc/u/GolamMostafa)\
**Post date:** [December 6, 2025, 6:51am UTC](https://forum.arduino.cc/t/upload-sketch-to-esp32-c6-super-mini/1418208/5 "2025-12-06T06:51:50Z")

</div>

Information in the atached file may help you:  
[Text-1ESP32C3SuperMini (1).pdf](https://forum.arduino.cc/uploads/short-url/1w1OguRQ5p5YmHz8BRs4TrdTRSn.pdf) (360.8 KB)

---

<div class="post-metadata">

**Author:** ![johnhb](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnhb/32/239468_2.png) [@johnhb](https://forum.arduino.cc/u/johnhb)\
**Post date:** [December 8, 2025, 1:42am UTC](https://forum.arduino.cc/t/upload-sketch-to-esp32-c6-super-mini/1418208/6 "2025-12-08T01:42:18Z")

</div>

Thank you sterretje,. I have compiled two example sketches, Server.ino and Scan.ino from the BLE examples. No problems in compiling but I cannot upload either sketch unless I hold down the boot btn. However, after what appears to be a successful upload I see nothing on the system monitor despite the setup having a Serial.println(“Stating BLE work!”)

---

<div class="post-metadata">

**Author:** ![johnhb](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnhb/32/239468_2.png) [@johnhb](https://forum.arduino.cc/u/johnhb)\
**Post date:** [December 8, 2025, 1:46am UTC](https://forum.arduino.cc/t/upload-sketch-to-esp32-c6-super-mini/1418208/7 "2025-12-08T01:46:27Z")

</div>

thank you horace. I tried two example sketches from the BLE section - Scan.ino and Servo. ino. If I hold the boot btn down I can upload either sketch but when I open the system monitor I see nothing despite the setup having the code Serial.println(“Starting BLE work!”).

---

<div class="post-metadata">

**Author:** ![Brazilino](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/brazilino/32/1198404_2.png) [@Brazilino](https://forum.arduino.cc/u/Brazilino)\
**Post date:** [December 8, 2025, 1:56am UTC](https://forum.arduino.cc/t/upload-sketch-to-esp32-c6-super-mini/1418208/8 "2025-12-08T01:56:09Z")

</div>

Make sure to have the option USB-CDC on boot “enabled”

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/e/5/4/e543d0a81301f8f17e49e4739d4c5b57040e705f.png)

---

<div class="post-metadata">

**Author:** ![johnhb](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnhb/32/239468_2.png) [@johnhb](https://forum.arduino.cc/u/johnhb)\
**Post date:** [January 31, 2026, 2:54am UTC](https://forum.arduino.cc/t/upload-sketch-to-esp32-c6-super-mini/1418208/9 "2026-01-31T02:54:41Z")

</div>

Thank you to all who replied to my post with various suggestions. A very simple solution - I bypassed my USB hub and used a cable directly to a second USB port on the PC. Problem solved, sketches upload without any issues.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 30, 2026, 2:55am UTC](https://forum.arduino.cc/t/upload-sketch-to-esp32-c6-super-mini/1418208/10 "2026-07-30T02:55:17Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
