Arduino support for the ESP32-S2 is very challenging right now, we don't recommend it. Please use CircuitPython!

Blink

Now you can upload your first blink sketch!

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

Select ESP32-S2 Board in Arduino IDE

On the Arduino IDE, click:

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

If you don't see your board, make sure you have the latest version of the ESP32 board support package

Launch ESP32-S2 ROM Bootloader

ESP32-S2 support in Arduino does not yet auto-reset on upload, so you will have to put the board into ROM bootloader mode EVERY time you want to upload!

Before we upload a sketch, place your ESP32-S2 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

It should appear under Tools -> Port as ESP32-S2 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 must 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!

If you want to upload a new sketch, you will have to go through the same process:

  • Reset board into ROM bootloader with DFU/BOOT0 + Reset buttons
  • Select ESP ROM bootloader in Tools->Port menu
  • Upload sketch
  • Click reset button to launch code

We have opened an issue with Espressif and hopefully they will fix auto-reset-into-bootloader soon!

This guide was first published on Nov 04, 2020. It was last updated on Nov 04, 2020.

This page (Using with Arduino IDE) was last updated on Apr 21, 2021.

Text editor powered by tinymce.