I’ve been coding on a project for the Lilygo T-deck for a while, in Arduino IDE. Everything is good and working, but the compiling is so slow. Then i found PlatformIO which is said to be faster so, now I’m trying to import my project to it.
My code is in main.cpp
Having some problems compiling…
Error:
Executing task: C:\Users\Michael\.platformio\penv\Scripts\platformio.exe run --target upload --upload-port COM12
Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.11.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 3.20017.241212+sha.dcc1105b
- tool-esptoolpy @ 1.40501.0 (4.5.1)
- tool-mkfatfs @ 2.0.1
- tool-mklittlefs @ 1.203.210628 (2.3)
- tool-mkspiffs @ 2.230.0 (2.30)
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 40 compatible libraries
Scanning dependencies...
Dependency Graph
|-- CST816S @ 1.3.0+sha.03e28b7
|-- RadioLib @ 7.2.0
|-- TFT_eSPI @ 2.5.43
|-- Time @ 1.6.1
|-- ArduinoJson @ 7.4.2
|-- SensorLib @ 0.3.1
|-- Preferences @ 2.0.0
|-- SPI @ 2.0.0
Building in release mode
Linking .pio\build\esp32dev\firmware.elf
c:/users/michael/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\src\main.cpp.o: plugin needed to handle lto object
c:/users/michael/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\libFrameworkArduino.a(main.cpp.o): plugin needed to handle lto object
c:/users/michael/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\libFrameworkArduino.a(esp32-hal-uart.c.o): plugin needed to handle lto object
c:/users/michael/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Michael\.platformio\packages\framework-arduinoespressif32\tools\sdk\esp32\lib\libfreertos.a(port_common.c.obj):(.literal.main_task+0x18): undefined reference to `app_main'
c:/users/michael/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\Michael\.platformio\packages\framework-arduinoespressif32\tools\sdk\esp32\lib\libfreertos.a(port_common.c.obj): in function `main_task':
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/port_common.c:130: undefined reference to `app_main'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32dev\firmware.elf] Error 1
=============================================================================================================== [FAILED] Took 8.78 seconds ===============================================================================================================
* The terminal process "C:\Users\Michael\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload', '--upload-port', 'COM12'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
Ive also changed now to the settings you supplied for platformio.ini.
And still same problem. Stuck rebooting. This should be a problem in my code perhaps, but it works when uploading from Arduino IDE…So still need to find it.
Here is my working settings in the Arduino IDE, can you maybe see what I’m missing in platformio?
You also have to apply the extra settings (flash_mode, psram_type etc etc) I have mentioned above. Use the platformio.ini from my posting above.
I’ve noticed USB Mode: "Hardware CDC and JTAG" and USB CDC On Boot: "Enabled" in your ArduinoIDE settings so i added this to the platformio.ini as well.
Sure thing. So thank you for the help with compiling/uploading to the T-deck. Your settings are totally right. There is just something in my code that does not compile correctly / or the same as in Arduino IDE. Hm…
So, I just remembered I had an issue in the Arduino IDE when first beginning to code the T-deck. The library for the screen, TFT_eSPI, is not compatible with ESP32 boardmanager above 2.0.14. Having a higher version gave the same problem, the T-deck constantly rebooting. So I need to downgrade PIO just like I did in board manager in Arduino IDE. Not sure how though. More about this here
This is wonderful. That version-translation was very much needed. Now the code runs on the T-deck, I can see my code printing stuff in Serial Monitor. But the screen is not showing any graphics. Looking in to it after dinner. Your help are very much appreciated.