Skip to content

ANY Arduino build for ESP32-s2 for board = lolin_s2_mini fails with USBSerial not declared in scope of HardwareSerial.h (IDFGH-11650) #8977

@peteDDD

Description

@peteDDD

Board

ESP32-S2 lolin_s2_mini

Device Description

(Wemos) lolin_s2_mini

Hardware Configuration

Not relevant to the issue.

Version

v2.0.14

IDE Name

Visual Studio Code with Platformio

Operating System

Windows 10

Flash frequency

does not matter

PSRAM enabled

no

Upload speed

does not matter

Description

ANY CODE built with espidf @ 3.50102.0 (5.1.2)/arduinoespressif32 @ 3.0.0 specifying lolin_s2_mini as the board and with CONFIG_AUTOSTART_ARDUINO=y fails in
HardwareSerial.h:360:16: with error: 'USBSerial' was not declared in this scope

Sketch

#include <Arduino.h>

void setup()
{}

void loop()
{}

Debug Message

In file included from C:/Users/peted/.platformio/packages/framework-arduinoespressif32-src-16f16f9b46f255eba682607449bb3231/cores/esp32/Arduino.h:196,
                 from C:/Users/peted/.platformio/packages/framework-arduinoespressif32-src-16f16f9b46f255eba682607449bb3231/cores/esp32/chip-debug-report.cpp:17:
C:/Users/peted/.platformio/packages/framework-arduinoespressif32-src-16f16f9b46f255eba682607449bb3231/cores/esp32/chip-debug-report.cpp: In function 'void printBeforeSetupInfo()':     
C:/Users/peted/.platformio/packages/framework-arduinoespressif32-src-16f16f9b46f255eba682607449bb3231/cores/esp32/HardwareSerial.h:360:16: error: 'USBSerial' was not declared in this scope; did you mean 'Serial'?
  360 | #define Serial USBSerial
      |                ^~~~~~~~~
C:/Users/peted/.platformio/packages/framework-arduinoespressif32-src-16f16f9b46f255eba682607449bb3231/cores/esp32/chip-debug-report.cpp:260:3: note: in expansion of macro 'Serial'

Other Steps to Reproduce

Using

  • framework-arduinoespressif32 @ 3.0.0
  • framework-espidf @ 3.50102.0 (5.1.2)
    which was downloaded clean on 9 December 2023 at 13:00 UTC

Platformio.ini:

[env:lolin_s2_mini]
platform = espressif32
board = lolin_s2_mini
framework = espidf, arduino

sdkconfig includes:
CONFIG_AUTOSTART_ARDUINO=y

Proceed to build the most simple of sketches using platformio build button or command

(For the record, no issue doing the same with esp32-s3-devkitc-1 including using printf and ESP_LOG).

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Labels

IDE: PlaformIOIssue relates to PlatformIO IDEStatus: SolvedThe issue has been resolved and requires no further action.Type: QuestionOnly question

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions