When will ESP32-S2 add to Arduino?

stephenwu
Posts: 1
Joined: Thu May 14, 2020 12:19 am

When will ESP32-S2 add to Arduino?

Postby stephenwu » Thu May 14, 2020 12:26 am


User avatar
ESP_Me-no-dev
Posts: 77
Joined: Mon Jan 04, 2016 6:30 pm

Re: When will ESP32-S2 add to Arduino?

Postby ESP_Me-no-dev » Thu May 14, 2020 8:52 am

It's already added, just not in the master branch. Check the arduino repo for "esp32s2" branch and give it a go. Be warn that it's a work in progress so some things might be broken.

chegewara
Posts: 2210
Joined: Wed Jun 14, 2017 9:00 pm

Re: When will ESP32-S2 add to Arduino?

Postby chegewara » Sat May 16, 2020 1:44 am

In past few days i had a chance to test esp32s2 with arduino. I would like to share my experience so far:
- for some time i tested with arduino as component against esp-idf master branch and it looks promising with one exception, but i know espressif is working on it; i could not use additional components for sensors, because was problem with SPI class

- now tests with arduino IDE and esp32s2 branch; tests are mostly positive, i tested few I2C and SPI devices and with just 1 or 2 tweaks in libraries it worked; i had to change a bit wifi library to make it works, but i know @me-no-dev is working on it, so be patient; my advice for now is to use for SPI pins < 20

I want to thanks @me-no-dev because i believe he did really great job with esp32s2 on arduino and lets hope it can be merged to master very soon

chegewara
Posts: 2210
Joined: Wed Jun 14, 2017 9:00 pm

Re: When will ESP32-S2 add to Arduino?

Postby chegewara » Sun May 17, 2020 8:36 pm

Here is short test of wifi + spi with pure arduino code:
https://www.youtube.com/watch?v=6MHUlJmN67E

chegewara
Posts: 2210
Joined: Wed Jun 14, 2017 9:00 pm

Re: When will ESP32-S2 add to Arduino?

Postby chegewara » Tue May 19, 2020 2:58 am

Another simple test. This time comparison of multitasking, esp32 vs esp32s2 (arduino code):
https://www.youtube.com/watch?v=aNnJmFqsTZY

Code: Select all

//mandelbrot06.ino
// http://rosettacode.org/wiki/Mandelbrot_set
// https://www.khanacademy.org/computer-programming/mandelbrot-set/1054272371
// https://github.com/cslarsen/mandelbrot-js
// http://falcosoft.hu/html5_mandelbrot.html
//
long startTime = 0;
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"

// For the Adafruit shield, these are the default.

  #define HSPI_MISO   12
  #define HSPI_MOSI   13
  #define HSPI_SCLK   14
  #define HSPI_SS     15

#if CONFIG_IDF_TARGET_ESP32S2
#define HSPI FSPI
#endif

#define TFT_DC 4
#define TFT_RST 5
SPIClass * hspi = new SPIClass(HSPI);
Adafruit_ILI9341 tft = Adafruit_ILI9341(hspi, TFT_DC, HSPI_SS, TFT_RST);

void setup() {
  Serial.begin(115200);
  hspi->begin(HSPI_SCLK, HSPI_MISO, HSPI_MOSI, HSPI_SS);
  
  tft.begin(80000000);

  tft.setRotation(3);
  tft.fillScreen(ILI9341_BLACK);
  xTaskCreate(task1, "t1", 4*1024, NULL, 5, NULL); // in first part priority 5
  xTaskCreate(task2, "t2", 4*1024, NULL, 5, NULL); // in first part priority 4
  xTaskCreate(task3, "t3", 4*1024, NULL, 5, NULL); // in first part priority 3
  xTaskCreate(task4, "t4", 4*1024, NULL, 5, NULL); // in first part priority 2
}

void task1(void*p)
{
  while(1)
  {
    tft.fillRect(0, 0, 160, 120, ILI9341_PINK);
    myMandel(-2.000, 1.000, -1.000,  1.000, 99, 120, 160, 0, 0);
    delay(3000);    
  }
}

void task2(void*p)
{
  while(1)
  {
    tft.fillRect(0, 120, 160, 120, ILI9341_RED);
    myMandel(-2.0262812499999998, -1.7157656249999997, 0.1242708333333333, -0.1088020833333334, 99, 240, 160, 120, 0);
    delay(3000);   
  }
}

void task3(void*p)
{
  while(1)
  {
    tft.fillRect(160, 0, 160, 120, ILI9341_GREEN);
    myMandel(0.3086785098726753, 0.5163214901273253, -0.2804711524861787, -0.4345288475138219, 150, 120, 320, 0, 160);
    delay(3000);
  }
}

void task4(void*p)
{
  while(1)
  {
    tft.fillRect(160, 120, 160, 120, ILI9341_BLUE);
    myMandel(0.4329398558688174, 0.4498108480145078, -0.3687333735957660, -0.3812505613167620, 200, 240, 320, 120, 160);
    delay(3000);
  }
}

void loop() {
  delay(1000000);
}

void myMandel(double realMin, double realMax, double imagMin, double imagMax, int maxIterations, double ySize, double xSize, int y0, int x0) {
  // http://rosettacode.org/wiki/Mandelbrot_set#AWK
  startTime = millis();
  String myString = "\n\nrealMin=" + String(realMin) + ", realMax=" + String(realMax) + ", imagMin=" + String(imagMin) + ", imagMax=" + String(imagMax) + ", maxIterations=" + String(maxIterations) + ", startTime=" + String((startTime / 1000.0)) + "s";
  Serial.print(myString);
  //================================================================
  double xStep = (realMax - realMin) / xSize;
  double yStep = (imagMax - imagMin) / ySize;
  int color = 0;
  for (int y = y0; y < ySize; y++) {
    double imagY = imagMin + yStep * y;
    for (int x = x0; x < xSize; x++) {
      double realX = realMin + xStep * x;
      double realZ = realX;
      double imagZ = imagY;
      for (int n = 0; n <= maxIterations; n++) {
        color = n;
        double a = realZ * realZ;
        double b = imagZ * imagZ;
        if (a + b > 4.0) break;
        imagZ = 2 * realZ * imagZ + imagY;
        realZ = a - b + realX;
      }
      if(color != maxIterations )
        tft.drawPixel(x, y, color*128*64);
    }
    delay(1);
  }
  //================================================================
  long elapseTime = millis() - startTime;
  myString = "\nelapseTime=" + String((elapseTime / 1000.0)) + "s";
  Serial.print(myString);
}

chchyong89
Posts: 1
Joined: Mon Jun 08, 2020 3:20 pm

Re: When will ESP32-S2 add to Arduino?

Postby chchyong89 » Mon Jun 08, 2020 3:22 pm

Can you show some guides in adding the S2 board file into arduino IDE?

chegewara
Posts: 2210
Joined: Wed Jun 14, 2017 9:00 pm

Re: When will ESP32-S2 add to Arduino?

Postby chegewara » Sun Jun 21, 2020 5:00 pm

https://github.com/espressif/arduino-es ... structions

You have to delete old version or to have second arduino IDE installation on windows and use this option to install:
Using Arduino IDE with the development repository

RobLatour
Posts: 12
Joined: Mon Dec 30, 2019 4:23 am

Re: When will ESP32-S2 add to Arduino?

Postby RobLatour » Mon Jul 06, 2020 2:11 am

This video shows how to set up the Arduino IDE for use with an esp32-s2
https://www.youtube.com/watch?v=L6IoSVdKwNM

please note, at 7:35 there is a reference to running get.exe
on my system I had to run this as an administrator for the setup to work correctly

shumifan16
Posts: 3
Joined: Sat Apr 24, 2021 12:29 pm

Re: When will ESP32-S2 add to Arduino?

Postby shumifan16 » Sat Apr 24, 2021 12:35 pm

I know this is an old thread, however, I would like to know whether that ESP32-S2 support is now in the main branch or whether I still need the specialised installation of the Arduino IDE that supports the ESP32-S2 but not the ESP32. Whenever I do a google search it just brings back to instructions to install the ESP32-S2 support but removes support for the ESP32.

chegewara
Posts: 2210
Joined: Wed Jun 14, 2017 9:00 pm

Re: When will ESP32-S2 add to Arduino?

Postby chegewara » Sun Apr 25, 2021 4:20 pm

You can use master branch or even easier you can use boards manager with v2.0.0-beta1. This version supports all esp32 models: esp32, esp32-S2, esp32-C3. It is still development version, but fairly stable.

Who is online

Users browsing this forum: Google [Bot] and 136 guests