Platformio.ini with env:custom_table builds twice?

Hi - I am new in this community, but am working with PlatformIO for a while already. Now I am confronting a problem I seem not to be able to solve on my own:

I am doing a project on an ESP32 (DevKitC V4), that required a modified partition table. I modified platformio.ini accordingly:
[env:az-delivery-devkit-v4]
platform = espressif32
board = az-delivery-devkit-v4
framework = arduino
lib_deps =
SimpleButton
Adafruit GFX Library
Adafruit SSD1306
Ticker
[env:custom_table]
platform = espressif32
board = az-delivery-devkit-v4
framework = arduino
board_build.partitions = default.csv

That worked okay, I can access alll partions as intended.

But now the build process seems to build my project twice each time (or it builds it once and again uploads the partition table).

Am I supposed to remove the [env:custom_table] part from platformio.ini to prevent that?

Hello
Iā€™m fairly new too, but from my own experience it if you have multiple environments and launch the build command without specifying which of them then it will build all of them.
To avoid this the -e option should be added like this:

pio run -e enviroment
1 Like

Welcome!

So whatā€™s happened here is you have defined two build environmentsā€¦ az-delivery-devkit-v4 and custom_tableā€¦ so when you hit ā€˜buildā€™ (which is really ā€˜build allā€™)ā€¦ it builds both.

If you didnā€™t intend to create two environments, simply remove

[env:custom_table]
platform = espressif32
board = az-delivery-devkit-v4
framework = arduino

and only keep the board_build.partitions = default.csv line. Otherwise, you can specify the specific environment one of several ways.

Via the PlatformIO menu

Via the command line as @msquirogac suggested.

Or you can set the default environment in your platformio.ini, which will instruct PlatformIO to only build the listed environments unless otherwise explicitly selected.

Since you are new to PlatformIO, now would probaly also be a good time to become familar with PlatformIO Home, and the built-in configuration editor, as it should make editing that platformio.ini a lot easier.

1 Like

Thanks a lot for your explanation. I see that I still have to find my way with platformio (I have been using the Arduino-IDE for long, but did a project a year ago when I thought it would be appropriate for platformio).
I still got a question in this context here: if I would comment out the custom-table environment: would the build of the original environment still honor the modified partition table? It should have been changed once for all, right?

Your platformio.ini file declares two completely independent configuration:

  • az-delivery-devkit-v4: ESP32, Arduino framework, four additional libraries
  • custom_table> ESP32, Arduino framework, modifed partition table

It sounds as if you would rather want to merge these two configuraitons into one, something like:

[env:az-delivery-devkit-v4]
platform = espressif32
board = az-delivery-devkit-v4
framework = arduino
lib_deps =
    SimpleButton
    Adafruit GFX Library
    Adafruit SSD1306
    Ticker
board_build.partitions = default.csv
2 Likes

Right, that is exactly what I want. Thank you! I will modify my platformio.ini as suggested.

By the way: I tried to open the project configuration via PlatformIO Home as suggested, but got a ā€œLoadingā€¦ā€ spinner forever. For the time being I will stick to manually edit platformio.ini.

1 Like

Ouchā€¦ sounds like something isnā€™t working properly there! :frowning: Glad youā€™re on the right track now! :slight_smile: