esp-idf 5.1 arduino 3.0 Wemos Lolin S2 mini Hello World 'USBSerial' was not declared in this scope

PeteDD
Posts: 45
Joined: Sat Sep 24, 2022 5:22 pm

esp-idf 5.1 arduino 3.0 Wemos Lolin S2 mini Hello World 'USBSerial' was not declared in this scope

Postby PeteDD » Sun Dec 03, 2023 9:10 pm

Recently switched to

Code: Select all

 - framework-arduinoespressif32 @ 3.0.0
 - framework-espidf @ 3.50102.0 (5.1.2)
Trying to do a quick project with (Wemos) Lolin s2 Mini
Having problems with libraries wanting to use USBSerial and not finding it. In fact, just including arduino.h throws these errors.

platformio:

Code: Select all

[env:lolin_s2_mini]
platform = espressif32
board = lolin_s2_mini
framework = espidf, arduino
monitor_speed = 115200
lib_ldf_mode = deep
Code:

Code: Select all

#include <Arduino.h>

void setup() {
  Serial.begin(115200);
  while(!Serial){}
}

void loop() {
   printf("Hello World\n");
   Serial.println("Serial.println Hello World");
}
sdkconfig includes

Code: Select all

CONFIG_AUTOSTART_ARDUINO=y
Output...

Code: Select all

In file included from C:/Users/peted/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:196,
Compiling .pio\build\lolin_s2_mini\console\argtable3\arg_cmd.o
                 from src/main.cpp:1:
Compiling .pio\build\lolin_s2_mini\console\argtable3\arg_date.o
src/main.cpp: In function 'void setup()':
C:/Users/peted/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.h:359:16: error: 'USBSerial' was not declared in this scope; did you mean 'Serial'?
  359 | #define Serial USBSerial
      |                ^~~~~~~~~
src/main.cpp:5:3: note: in expansion of macro 'Serial'
    5 |   Serial.begin(115200);
      |   ^~~~~~
src/main.cpp: In function 'void loop()':
C:/Users/peted/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.h:359:16: error: 'USBSerial' was not declared in this scope; did you mean 'Serial'?
  359 | #define Serial USBSerial
      |                ^~~~~~~~~
src/main.cpp:11:4: note: in expansion of macro 'Serial'
   11 |    Serial.println("Serial.println Hello World");
      |    ^~~~~~
*** [.pio\build\lolin_s2_mini\src\main.o] Error 1
And to prove the point... this code:

Code: Select all

#include <Arduino.h>

void setup() {
}

void loop() {
}
throws similar errors...

Code: Select all

In file included from C:/Users/peted/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:196,
                 from C:/Users/peted/.platformio/packages/framework-arduinoespressif32/cores/esp32/chip-debug-report.cpp:17:
C:/Users/peted/.platformio/packages/framework-arduinoespressif32/cores/esp32/chip-debug-report.cpp: In function 'void printBeforeSetupInfo()':
C:/Users/peted/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.h:359:16: error: 'USBSerial' was not declared in this scope; did you mean 'Serial'?
  359 | #define Serial USBSerial
      |                ^~~~~~~~~
C:/Users/peted/.platformio/packages/framework-arduinoespressif32/cores/esp32/chip-debug-report.cpp:260:3: note: in expansion of macro 'Serial'
  260 |   Serial.begin(0);
      |   ^~~~~~
*** [.pio\build\lolin_s2_mini\chip-debug-report.o] Error 1
In file included from C:/Users/peted/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:196,
                 from C:/Users/peted/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:4:
C:/Users/peted/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp: In function 'void app_main()':
C:/Users/peted/.platformio/packages/framework-arduinoespressif32/cores/esp32/HardwareSerial.h:359:16: error: 'USBSerial' was not declared in this scope; did you mean 'Serial'?
  359 | #define Serial USBSerial
      |                ^~~~~~~~~
C:/Users/peted/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:80:5: note: in expansion of macro 'Serial'
   80 |     Serial.begin();
      |     ^~~~~~
*** [.pio\build\lolin_s2_mini\main.o] Error 1
Somebody mess up arduino.h for this chip??
Last edited by PeteDD on Sat Dec 09, 2023 12:16 am, edited 1 time in total.

PeteDD
Posts: 45
Joined: Sat Sep 24, 2022 5:22 pm

Re: esp-idf 5.1 arduino 3.0 Wemos Lolin S2 mini Hello World 'USBSerial' was not declared in this scope

Postby PeteDD » Mon Dec 04, 2023 7:33 pm

Anybody???

PeteDD
Posts: 45
Joined: Sat Sep 24, 2022 5:22 pm

Re: esp-idf 5.1 arduino 3.0 Wemos Lolin S2 mini Hello World 'USBSerial' was not declared in this scope

Postby PeteDD » Fri Dec 08, 2023 10:21 pm

Still no one has an idea on this?

Who is online

Users browsing this forum: No registered users and 100 guests