Page 1 of 1

Can I use the espressif arduino-esp32 library in platformio?

Posted: Thu Feb 06, 2025 3:56 am
by cdub2k
(I apologize if this question has been answered here already - the search on this forum is failing)

I'm successfully using the espressif arduino-esp32 library in the Arduino IDE, to create a MIDI controller that supports MIDI over both USB and BLE, and I want to move from the Arduino IDE to platformio + VSCode.

I've been able to get the BLE side of things to build using Arduino BLE MIDI libraries that aren't part of the espressif library, but I can't seem to get the USB library from arduino-esp32 to build in platformio in VSCode. The build is mostly successful, but it fails to find definitions for a few constants and functions while building the library's USB library.

I know the arduino-esp32 library officially only supports the Arduino IDE, but I'm hoping there's some way to configure platformio to use this library.

Thank you!

- Chris

Re: Can I use the espressif arduino-esp32 library in platformio?

Posted: Thu Feb 06, 2025 7:25 am
by lbernstone
The official platformio group has stopped supporting esp32 at version 2.0. To compile with the v3 code (aka IDF 5.x), modify your platformio.ini with

Code: Select all

platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.11/platform-espressif32.zip
If you browse to the releases page, you can always see what the latest version is there.

Re: Can I use the espressif arduino-esp32 library in platformio?

Posted: Fri Feb 07, 2025 9:22 pm
by cdub2k
Thank you for the suggestion. I changed the platform line as you suggested and I now get the following error on build:

Code: Select all

*** [.pio/build/adafruit_qtpy_esp32s3_nopsram/partitions.bin] Source `partitions-8MB-tinyuf2.csv' not found, needed by target `.pio/build/adafruit_qtpy_esp32s3_nopsram/partitions.bin'.
(I'm using the Adafruit ESP32-S3 board with no PSRAM).

My platformio.ini:

Code: Select all

[env:adafruit_qtpy_esp32s3_nopsram]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.11/platform-espressif32.zip
;espressif32
board = adafruit_qtpy_esp32s3_nopsram
framework = arduino
I did some more reading and found that there's a VSCode plugin for pioarduino IDE, which I installed. I created a new, empty PIO project and I get the same error on build.

I'm relatively new to PlatformIO and have been successful so far using it to build for ESP32 with the Arduino framework.

Re: Can I use the espressif arduino-esp32 library in platformio?

Posted: Sat Feb 08, 2025 4:43 pm
by lbernstone
It looks like the partition file name has changed, so that board definition is no longer valid. I'd recommend you override the partition file with the correct file