PlatformIO Community

CodeBlocks: targets are missing, inconsistent builds

Hello,
Here is the output from CB -> Build -> Select Target ->Debug output vs pio tun -target debug:
CB:

-------------- Build: **Debug** in Proj_arduino (compiler: GNU GCC Compiler)---------------

Checking if target is up-to-date: 1
Running command: /home/az/.platformio/penv/bin/pio -f -c codeblocks run
Processing esp32doit-devkit-v1 (platform: espressif32; board: esp32doit-devkit-v1; framework: arduino)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 1.12.4 > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 160MHz, 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)
PACKAGES: 
 - framework-arduinoespressif32 3.10004.200129 (1.0.4) 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Looking for ESPAsyncWebserver library in registry
Warning! Library `{'requirements': None, 'name': 'ESPAsyncWebserver'}` has not been found in PlatformIO Registry.
You can ignore this message, if `{'requirements': None, 'name': 'ESPAsyncWebserver'}` is a built-in library (included in framework, SDK). E.g., SPI, Wire, etc.
Found 37 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <RCSwitch> 2.52

    |   |-- <WiFi> 1.0
    **Building in release mode**
    Linking .pio/build/esp32doit-devkit-v1/firmware.elf
    Retrieving maximum program size .pio/build/esp32doit-devkit-v1/firmware.elf
    Checking size .pio/build/esp32doit-devkit-v1/firmware.elf
    Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
    RAM:   [=         ]  **13.7%** (used 44784 bytes from 327680 bytes)
    Flash: [========  ]  79.0% (used 1035961 bytes from 1310720 bytes)
    ========================= [SUCCESS] Took 13.86 seconds =========================
    Process terminated with status 0 (0 minute(s), 14 sec

So is it built in DEBUG or in RELEASE ? Very confusing.

Now same run thru pio:

    [az@dell5000 Proj_arduino]$ ~/.platformio/penv/bin/pio run -t debug
    Processing esp32doit-devkit-v1 (platform: espressif32; board: esp32doit-devkit-v1; framework: arduino)
    ----------------------------------------------------------------------------------------------------------------------------------------------------
    Verbose mode can be enabled via `-v, --verbose` option
    CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
    PLATFORM: Espressif 32 1.12.4 > DOIT ESP32 DEVKIT V1
    HARDWARE: ESP32 160MHz, 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)
    PACKAGES: 
     - framework-arduinoespressif32 3.10004.200129 (1.0.4) 
     - tool-esptoolpy 1.20600.0 (2.6.0) 
     - toolchain-xtensa32 2.50200.80 (5.2.0)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Looking for ESPAsyncWebserver library in registry
    Warning! Library `{'requirements': None, 'name': 'ESPAsyncWebserver'}` has not been found in PlatformIO Registry.
    You can ignore this message, if `{'requirements': None, 'name': 'ESPAsyncWebserver'}` is a built-in library (included in framework, SDK). E.g., SPI, Wire, etc.
    Found 37 compatible libraries
    Scanning dependencies...
    Dependency Graph
    |-- <RCSwitch> 2.52

|   |-- <FS> 1.0
Building in debug mode
Compiling .pio/build/esp32doit-devkit-v1/src/Sensor_DHT.cpp.o

    Building .pio/build/esp32doit-devkit-v1/firmware.bin
    Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
    RAM:   [=         ]  13.7% (used 44784 bytes from 327680 bytes)
    Flash: [========  ]  83.6% (used 1095136 bytes from 1310720 bytes)
    esptool.py v2.6

Based on memory usage i can conclude that it is debug build. But the messages from CB build are misleading and confusing.

RELEASE:
In CB -> Buiuld -> Select Target - Release :
-------------- Build: Release in Proj_arduino (compiler: GNU GCC Compiler)---------------

Checking if target is up-to-date: 1
Running command: /home/az/.platformio/penv/bin/pio -f -c codeblocks run
Processing esp32doit-devkit-v1 (platform: espressif32; board: esp32doit-devkit-v1; framework: arduino)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 1.12.4 > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 160MHz, 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)
PACKAGES: 
 - framework-arduinoespressif32 3.10004.200129 (1.0.4) 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Looking for ESPAsyncWebserver library in registry
Warning! Library `{'requirements': None, 'name': 'ESPAsyncWebserver'}` has not been found in PlatformIO Registry.
You can ignore this message, if `{'requirements': None, 'name': 'ESPAsyncWebserver'}` is a built-in library (included in framework, SDK). E.g., SPI, Wire, etc.
Found 37 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <RCSwitch> 2.52



|   |-- <WiFi> 1.0
Building in release mode
Compiling .pio/build/esp32doit-devkit-v1/src/Sensor_DHT.cpp.o

Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  13.7% (used 44784 bytes from 327680 bytes)
Flash: [========  ]  79.0% (used 1035961 bytes from 1310720 bytes)
esptool.py v2.6
========================= [SUCCESS] Took 39.64 seconds =========================

I expected to see the difference in the memory usage. But it is the same as in “debug” mode. Why?

the pio target release fails:

~/.platformio/penv/bin/pio run -t release
Processing esp32doit-devkit-v1 (platform: espressif32; board: esp32doit-devkit-v1; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 1.12.4 > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 160MHz, 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)
PACKAGES: 
 - framework-arduinoespressif32 3.10004.200129 (1.0.4) 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Looking for ESPAsyncWebserver library in registry
Warning! Library `{'requirements': None, 'name': 'ESPAsyncWebserver'}` has not been found in PlatformIO Registry.
You can ignore this message, if `{'requirements': None, 'name': 'ESPAsyncWebserver'}` is a built-in library (included in framework, SDK). E.g., SPI, Wire, etc.
Found 37 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <RCSwitch> 2.52
|-- <ESPUI> 2.0.0
|   |-- <ESP Async WebServer> 1.2.3
|   |   |-- <AsyncTCP> 1.1.1
|   |   |-- <WiFi> 1.0
|   |   |-- <FS> 1.0
|   |   |-- <ArduinoJson> 6.15.2
|   |-- <ArduinoJson> 6.15.2
|   |-- <AsyncTCP> 1.1.1
|   |-- <SPIFFS> 1.0
|   |   |-- <FS> 1.0
|   |-- <FS> 1.0
|   |-- <ArduinoOTA> 1.0
|   |   |-- <Update> 1.0
|   |   |-- <ESPmDNS> 1.0
|   |   |   |-- <WiFi> 1.0
|   |   |-- <WiFi> 1.0
|   |-- <WiFi> 1.0
|-- <ArduinoJson> 6.15.2
|-- <DNSServer> 1.1.0
|   |-- <WiFi> 1.0
|-- <SPIFFS> 1.0
|   |-- <FS> 1.0
|-- <Outlets>
|-- <WiFi> 1.0
|-- <DHT sensor library for ESPx> 1.17
Building in release mode
*** Do not know how to make File target `release' (/home/az/Work/Arduino/Proj_arduino/release).  Stop.

Obvious question is why there is a difference in the behaviour?

and the last, but not the least:

~/.platformio/penv/bin/pio run --list-targets
Usage: pio run [OPTIONS]
Try "pio run -h" for help.

Error: no such option: --list-targets

PlatformIO, version 4.3.4

platformio.ini:

[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
monitor_speed = 115200
lib_deps = 
	id=246@^2.6.2
	ESPUI
	ESPAsyncWebserver
	64
	ESPAsyncTCP
board_build.f_cpu = 160000000L

If this is invoked it will just do a normal compilation run. As you can see in the template, there’s no difference in executed commands between Debug and Release version. You can switch between release and debug by either invoking pio run (with default settings) vs pio run -t debug or set the build type explicitly.

Works for me:

C:\Users\Maxi\Desktop\Programming_stuff\playground>pio run --list-targets
Environment    Group     Name       Title                 Description
-------------  --------  ---------  --------------------  -----------------------------------------------------
nucleo_f103rb  Advanced  compiledb  Compilation Database  Generate compilation database `compile_commands.json`
nucleo_f103rb  Generic   clean      Clean
nucleo_f103rb  Platform  upload     Upload

nucleo_l476rg  Advanced  compiledb  Compilation Database  Generate compilation database `compile_commands.json`
nucleo_l476rg  Generic   clean      Clean
nucleo_l476rg  Platform  upload     Upload

disco_f746ng   Advanced  compiledb  Compilation Database  Generate compilation database `compile_commands.json`
disco_f746ng   Generic   clean      Clean
disco_f746ng   Platform  upload     Upload

Make sure you have the most recent PlatformIO installed with pio upgrade --dev.

Wouldn’t that mean that I leave a stable environment and enter develop (aka beta :wink:)? Is there a way back - for instance with pio upgrade - without complete reinstall?

pip install 'platformio==4.3.4' --force-reinstall

should work. Note that the latest release is ~100 commits behind right now.

1 Like

Thx for your answer.

To be honest - at the moment I prefer a stable (aka released) environment, even if it might be not the last state of the art :wink:. May be later - with more experiences :nerd_face: on how to interpret error messages and how to locate their origins - I’ll give dev a chance.

P.S.:

sounds to me like a complete reinstall :grin:

Yes the platformio Python core scripts are reinstalled, but all downloaded packages, platforms, libraries and projects are untouched :sweat_smile:

1 Like

:+1: Good to know. Thx for clarification.

Thank you Maximillian.
Im already on the latest official 4.3 4
According to the release docs the “list-target” should be implemented as part of the release. Am i wrong?

Thank you pointing out at the template! I knew i saw it somewhere, but couldn’t find this time around .
If there is no difference, then it means the integration is not functioning properly.