esp-idf 5.1 arduino 3.0 Wemos Lolin S2 mini Hello World 'USBSerial' was not declared in this scope
Posted: Sun Dec 03, 2023 9:10 pm
Recently switched to
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:
sdkconfig includes
Output...
And to prove the point... this code:
throws similar errors...
Somebody mess up arduino.h for this chip??
Code: Select all
- framework-arduinoespressif32 @ 3.0.0
- framework-espidf @ 3.50102.0 (5.1.2)
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: Select all
#include <Arduino.h>
void setup() {
Serial.begin(115200);
while(!Serial){}
}
void loop() {
printf("Hello World\n");
Serial.println("Serial.println Hello World");
}
Code: Select all
CONFIG_AUTOSTART_ARDUINO=y
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
Code: Select all
#include <Arduino.h>
void setup() {
}
void loop() {
}
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