Blink

Now you can upload your first blink sketch!

Plug in the ESP32-S2/S3 board and wait for it to be recognized by the OS (just takes a few seconds).

Select ESP32-S2/S3 Board in Arduino IDE

On the Arduino IDE, click:

Tools -> Board -> ESP32 Arduino -> Your Adafruit ESP32-S2/S3 board 

The screenshot shows Metro S2 but you may have a different board. Make sure the name matches the exact product you purchased. If you don't see your board, make sure you have the latest version of the ESP32 board support package

Launch ESP32-S2/S3 ROM Bootloader

ESP32-S2/S3 support in Arduino uses native USB which can crash. If you ever DON'T see a serial/COM port, you can always manually enter bootloading mode. This bootloader is in ROM, it is 'un-brickable' so you can always use this technique to get into the bootloader. However, after uploading your Arduino code you MUST press reset to start the sketch

Before we upload a sketch, place your ESP32-S2/S3 board into ROM bootloader mode.

Look for the Reset button and a second DFU / BOOT0 button

HOLD down the DFU/Boot0 button while you click Reset. Then release DFU/Boot0 button

The GIF shows a Metro S2 but your board may look different. It will still have BOOT and Reset buttons somewhere

It should appear under Tools -> Port as ESP32-S2/S3 Dev Module

Do not select any other port than the one that is called "ESP32S2 Dev Module" or "ESP32S3 Dev Module"

Load Blink Sketch

Now open up this Blink example in a new sketch window

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize built in LED pin as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  // initialize USB serial converter so we have a port created
  Serial.begin();
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}
Note that we use LED_BUILTIN not pin 13 for the LED pin. That's because we don't always use pin 13 for the LED on boards. For example, on the Metro ESP32-S2 the LED is on pin 42!

And click upload! After uploading, you may see something like this:

And click upload! After uploading, you may see something like this, warning you that we could not get out of reset.

This is normal! Press the RESET button on your board to launch the sketch

That's it, you will be able to see the red LED blink. You will also see a new serial port created.

You may call Serial.begin(); in your sketch to create the serial port so don't forget it, it is not required for other Arduinos or previous ESP boards!

You can now select the new serial port name which will be different than the bootloader serial port. Arduino IDE will try to use auto-reset to automatically put the board into bootloader mode when you ask it to upload new code

If you ever DON'T see a serial port, or something is not working out with upload you can always manually enter bootloader mode:

  • Reset board into ROM bootloader with DFU/BOOT0 + Reset buttons
  • Select the ESP32S2/S3 Dev Board ROM bootloader serial port in Tools->Port menu
  • Upload sketch
  • Click reset button to launch code

This guide was first published on Jan 12, 2022. It was last updated on Mar 28, 2024.

This page (Using with Arduino IDE) was last updated on Mar 08, 2024.

Text editor powered by tinymce.