PlatformIO Community

Platform_packages in platformio.ini not working as expected

I’ve cloned and built the espressif/arduino-esp32 package, uploaded it to github, and specified it in the platformio.ini file via the platform_packages stanza (shown below). However, when I build the project (after a pio pkg update and pio run -t clean, it’s never picking up my version of the package. It’s being fetched into ~/.platformio/packages directory (shown at end) just like the framework-arduinoespressif32, but it’s not being used.

I’ve run pio run -v 2>1 >output.txt and taken a look through it, but all the references are to framework-arduinoespressif32. I’ve also tried specifying it as a platform =, but that resulted in Error: This board doesn't support framework!. I also tried it as a platform =, which resulted in Error: Could not find one of 'platform.json' manifest files in the package (which is correct, there’s no platform.json in either directory).

What do I need to do to get PlatformIO to use framework-arduinoespressif32-jcw instead of framework-arduinoespressif32?

default_envs = v2x

platform = espressif32
framework = arduino
lib_deps =
  heltecautomation/Heltec ESP32 Dev-Boards@^1.1.1
  adafruit/CAN Adafruit Fork@^1.2.1
lib_ldf_mode = deep+
build_type = debug
build_flags =
monitor_speed = 115200
monitor_filters = esp32_exception_decoder

board = heltec_wifi_lora_32_V2

board = heltec_wifi_lora_32_V2
platform_packages =
  framework-arduinoespressif32-jcw @
total 0
drwx------  13 jcw  staff   416B Nov 12 20:16 framework-arduinoespressif32
drwx------  22 jcw  staff   704B Nov 12 20:39 framework-arduinoespressif32-jcw
drwx------  24 jcw  staff   768B Nov  4 11:38 tool-esptoolpy
drwx------   5 jcw  staff   160B Nov  4 11:43 tool-mkfatfs
drwx------   5 jcw  staff   160B Nov  4 11:43 tool-mklittlefs
drwx------   7 jcw  staff   224B Nov  4 11:43 tool-mkspiffs
drwx------  14 jcw  staff   448B Nov  4 11:39 tool-scons
drwx------   9 jcw  staff   288B Nov  4 11:38 toolchain-xtensa-esp32

The builder script for framework = arduino will only ever be looking at the framework-arduinoespressif32 package.

Having a different name in your forked Arduino-ESP32’s package.json or platformio.ini will make it just be ignored completely in the build process.

Do the fork, do no changes to the package.json, and specify

platform_packages =

Just like the documentation says.

1 Like

Thank you. Unfortunately, “Just like the documentation says.” was not clear that it is NECESSARY to use the same name to override a default package. As my configuration allows for building against the default framework-arduinoespressif32 and my version of framework-arduinoespressif32, I was under the (mistaken) assumption that namespace collision would be an issue.

Trust me, I spent plenty of time Googling this and reading the documentation before I asked.