Long time user of the ESP IDF, using their python scripts etc to build. Decided to make the leap to using platformio.
I have a project, which compiles fine from the command line with
idf.py build but platformio is throwing me the error
Error: Couldn't find the main target of the project!
The project structure is slightly different than the norm:
- Inside the project dir, there is a folder called “core” which houses two other folders, “Src” and “Inc”. Where “Src” houses
main.cpp. The “core” component is registered in the “CMakeLists.txt” file in this “core” folder.
- Inside the project dir there is another folder called “application” which houses several folders which are setup as components, each with their own `CMakeLists.txt"
platformio.ini is, and where I think my error must be:
[platformio] src_dir = core/Src [env] platform = espressif32 framework = espidf platform_packages = framework-espidf [env:fm-devkit] board = fm-devkit
And the terminal log:
Executing task in folder esp32: C:\Users\Simon.platformio\penv\Scripts\platformio.exe run <
Processing fm-devkit (board: fm-devkit; platform: espressif32; framework: espidf)
Verbose mode can be enabled via
PLATFORM: Espressif 32 1.12.0 > ESP32 FM DevKit
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (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)
- framework-espidf 3.40000.200303 (4.0.0)
- tool-cmake 3.16.5
- tool-esptoolpy 1.20600.0 (2.6.0)
- tool-idf 1.0.1
- tool-mconf 1.4060000.20190628 (406.0.0)
- tool-ninja 1.9.0
- toolchain-esp32ulp 1.22851.190618 (2.28.51)
- toolchain-xtensa32 2.80200.200226 (8.2.0)
Reading CMake configuration…
Error: Couldn’t find the main target of the project!
======================================================================================== [FAILED] Took 14.60 seconds ========================================================================================
The terminal process terminated with exit code: 1
Terminal will be reused by tasks, press any key to close it.