ESP32-C6 Firmware Update Guide

This chapter describes how to update the firmware of the on-board ESP32-C6. You can follow this tutorial to update a custom firmware for the ESP32-C6.

Hardware Preparation

  • USB-to-TTL tool
  • Jumper wires

Software Preparation

Hardware Connection

Hardware Connection
It is recommended to use male jumper wires for the ESP32-C6 side. If male jumper wires are not available, you can insert jumper wires into pin headers to make a simple programming tool.
Hardware Connection

Operation Steps

  1. Connect the hardware according to the wiring diagram, then connect the TTL tool to the computer.
  2. Open Flashdown Tool and select the main control model and download mode.
    Operation Steps
  3. Configure the firmware, COM port and other settings, erase the ESP32-C6 flash, then program the firmware to the ESP32-C6.
    Operation Steps
  4. Test the functions with the following code.
/*
 *  This sketch sends a message to a TCP server
 *
 */

#include <WiFi.h>
#include <WiFiMulti.h>

WiFiMulti WiFiMulti;

void setup() {
  Serial.begin(115200);
  delay(10);

  // We start by connecting to a WiFi network
  WiFiMulti.addAP("SSID", "passpasspass");

  Serial.println();
  Serial.println();
  Serial.print("Waiting for WiFi... ");

  while (WiFiMulti.run() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
  }

  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

  delay(500);
}

void loop() {
  //    const uint16_t port = 80;
  //    const char * host = "192.168.1.1"; // ip or dns
  const uint16_t port = 1337;
  const char *host = "192.168.1.10";  // ip or dns

  Serial.print("Connecting to ");
  Serial.println(host);

  // Use NetworkClient class to create TCP connections
  NetworkClient client;

  if (!client.connect(host, port)) {
    Serial.println("Connection failed.");
    Serial.println("Waiting 5 seconds before retrying...");
    delay(5000);
    return;
  }

  // This will send a request to the server
  //uncomment this line to send an arbitrary string to the server
  //client.print("Send this data to the server");
  //uncomment this line to send a basic document request to the server
  client.print("GET /index.html HTTP/1.1\n\n");

  int maxloops = 0;

  //wait for the server's reply to become available
  while (!client.available() && maxloops < 1000) {
    maxloops++;
    delay(1);  //delay 1 msec
  }
  if (client.available() > 0) {
    //read back one line from the server
    String line = client.readStringUntil('\r');
    Serial.println(line);
  } else {
    Serial.println("client.available() timed out ");
  }

  Serial.println("Closing connection.");
  client.stop();

  Serial.println("Waiting 5 seconds before restarting...");
  delay(5000);
}

Others

  • Introduction to Test Points of FireBeetle 2 ESP32-P4.
    Introduction to Test Points of FireBeetle 2 ESP32-P4.
  • Firmware source code project address: https://github.com/espressif/esp-hosted-mcu/tree/main/slave

Was this article helpful?

ON THIS PAGE

TOP