So I would like to compile with
platform = espressif32, framework = arduino, espidf
for the board adafruit_qtpy_esp32s2.
and I started with the often cited Espidf-arduino-blink.
Fact: Just running the example as it is on github works well for the given predefined boards (esp32dev, espea32, esp320).
But when I add the following board lines (testing various boards, I always get the same errors for the esp32s2, see below).
[env]
platform = espressif32
framework = arduino, espidf
build_flags =
-D CONFIG_BLINK_GPIO=2
monitor_speed = 115200
; [env:esp32dev]
; board = esp32dev
; [env:espea32]
; board = espea32
; [env:esp320]
; board = esp320
[env:adafruit_qtpy_esp32s2]
board = adafruit_qtpy_esp32s2
[env:seeed_xiao_esp32c3]
board = seeed_xiao_esp32c3
[env:adafruit_qtpy_esp32]
board = adafruit_qtpy_esp32
[env:adafruit_feather_esp32s2_tft]
board = adafruit_feather_esp32s2_tft
Result of pio run
:
Environment Status Duration
---------------------------- -------- ------------
adafruit_qtpy_esp32s2 FAILED 00:00:38.389
seeed_xiao_esp32c3 SUCCESS 00:03:46.079
adafruit_qtpy_esp32 SUCCESS 00:03:59.153
adafruit_feather_esp32s2_tft FAILED 00:00:44.090
The error I get is:
src/Blink.cpp: In function 'void setup()':
src/Blink.cpp:64:5: error: 'Serial' was not declared in this scope
Serial.begin(115200);
^~~~~~
src/Blink.cpp:64:5: note: suggested alternative: 'Serial1'
Serial.begin(115200);
^~~~~~
Serial1
src/Blink.cpp: In function 'void loop()':
src/Blink.cpp:70:5: error: 'Serial' was not declared in this scope
Serial.println("Hello!");
^~~~~~
src/Blink.cpp:70:5: note: suggested alternative: 'Serial1'
Serial.println("Hello!");
^~~~~~
Serial1
My trials of using Serial1 (reluctantly) did not work out. Also Serial0 did not work out. It seams, the framework compiles main()
instead of setup
and loop
.
I found no esp32s2
board which I could compile the example with. All esp32s2
end up in the same error message. All the other boards I tried compile without any error.
Any idea how to fix this is highly appreciated. best regards
Phil