Skip to content

Lesson01: Arduino IDE Environment Setup and Serial Port Self-Test

1. Objectives

This lesson verifies that the Arduino IDE, ESP32-S3 board package, Flash, OPI PSRAM, and partition scheme are configured correctly. All subsequent lessons depend on this environment configuration, so this lesson is not a peripheral experiment but a foundational self-test for the entire course.

2. Requirements

  • Arduino IDE 2.3.6. (If compilation fails with another version, use 2.3.6.)
  • ESP32 by Espressif Systems 3.3.3.
  • Select ESP32S3 Dev Module as the board.
  • Set Flash Size to 16MB (128Mb).
  • Set PSRAM to OPI PSRAM.
  • Set Partition Scheme to Huge APP (3MB No OTA/1MB SPIFFS).
  • No third-party Arduino libraries are required for this lesson.

How to add library files:

  • No additional third-party libraries are required for this lesson. You only need Arduino IDE 2.3.6 and ESP32 by Espressif Systems 3.3.3.

3. How to Add the ESP32 3.3.3 Board Package

  1. Open Arduino IDE 2.3.6 and go to File > Preferences. lesson_1

  2. Add the Espressif ESP32 board index URL under Additional boards manager URLs: https://espressif.github.io/arduino-esp32/package_esp32_index.json. lesson_2

  3. Open Tools > Board > Boards Manager and search for esp32. lesson_3

  4. Select esp32 by Espressif Systems, choose version 3.3.3, and click Install. lesson_4

  5. After installation is complete, go to Tools > Board > esp32 and select ESP32S3 Dev Module. lesson_5

4. Arduino IDE Instructions

  1. Open Lesson01_Environment_Setup.ino in the Arduino IDE. lesson_6

  2. In the Tools menu, confirm that the selected board is ESP32S3 Dev Module. lesson_7

  3. Set Flash Size to 16MB (128Mb) and PSRAM to OPI PSRAM. lesson_8

  4. Set Partition Scheme to Huge APP (3MB No OTA/1MB SPIFFS). lesson_9

  5. Select the appropriate serial port, click Verify to compile, and then click Upload to flash the program. (Remember to connect the hardware and select the corresponding COM port.) lesson_10

  6. Open Serial Monitor and set the baud rate to 115200. lesson_11

5. Hardware Instructions

  1. Connect the development board to the computer using a USB data cable and confirm that the computer recognizes the corresponding serial port.

lesson_12

  1. No additional peripherals need to be connected, and there is no need to operate the screen or buttons.

  2. If there is no serial output, first check whether the USB cable supports data transfer, and then verify that the correct port is selected in the Arduino IDE.

6. Key Code Explanation

constexpr uint32_t kExpectedFlashBytes = 16UL * 1024UL * 1024UL;
const uint32_t flashBytes = ESP.getFlashChipSize();
const uint32_t psramBytes = ESP.getPsramSize();
const bool flashMatches = flashBytes == kExpectedFlashBytes;
const bool psramReady = psramFound();

This code converts 16MB of Flash into bytes and then reads the Flash and PSRAM capacities detected by the current board package. flashMatches checks whether the correct Flash Size is selected in the Arduino IDE menu, while psramReady checks whether OPI PSRAM is actually enabled. This verifies the runtime results and is more reliable than simply checking the menu settings.

esp_chip_info_t chipInfo = {};
esp_chip_info(&chipInfo);
Serial.printf("CPU cores: %u\n", static_cast<unsigned int>(chipInfo.cores));

esp_chip_info_t is a chip information structure provided by ESP-IDF. The code first creates and zero-initializes the structure, then calls esp_chip_info() to populate it, and finally prints the number of CPU cores. This code helps students understand that Arduino-ESP32 can directly access the underlying capabilities of ESP-IDF.

Download the Lesson 01 code