Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Arduino ESP32 v3.0 based on ESP-IDF v5.1 #1225

Open
ivankravets opened this issue Nov 4, 2023 · 84 comments
Open

Support Arduino ESP32 v3.0 based on ESP-IDF v5.1 #1225

ivankravets opened this issue Nov 4, 2023 · 84 comments
Labels

Comments

@ivankravets
Copy link
Member

ivankravets commented Nov 4, 2023

The ESP32 Core for Arduino 2.x is the most recent major version currently recommended for use with PlatformIO. The decision to discontinue support was made by the Espressif company, as indicated in their official statement: espressif/arduino-esp32#8606

If you're an Espressif user who relies on PlatformIO for your projects, kindly share your thoughts in the comments below and cast your vote on this matter. Once we gather enough interest from the Espressif community, we plan to reach out to the Espressif company and request a reconsideration of support for PlatformIO.

@thijstriemstra
Copy link

thijstriemstra commented Nov 8, 2023

I've been trying this with following config:

; see https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#how-to-update-to-the-latest-code
[env:arduino-latest]
platform = https://github.com/platformio/platform-espressif32.git
board = az-delivery-devkit-v4
framework = arduino
platform_packages =
    framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#master

but the build fails with KeyError: 'framework-arduinoespressif32-libs':

Processing arduino-latest (platform: https://github.com/platformio/platform-espressif32.git; board: az-delivery-devkit-v4; framework: arduino)
--------------------------------------------------------------------------------
Platform Manager: Installing git+https://github.com/platformio/platform-espressif32.git
git version 2.42.0
Cloning into '/home/runner/.platformio/.cache/tmp/pkg-installing-uz1yxjz0'...
Platform Manager: [email protected]+sha.f6ec392 has been installed!
Tool Manager: Installing git+https://github.com/espressif/arduino-esp32#master
git version 2.42.0
Cloning into '/home/runner/.platformio/.cache/tmp/pkg-installing-kih232ry'...
Tool Manager: [email protected]+sha.bf822ef has been installed!
Library Manager: Installing fortyseveneffects/MIDI Library @ ^5.0.2
Unpacking 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
Library Manager: MIDI [email protected] has been installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/az-delivery-devkit-v4.html
PLATFORM: Espressif 32 (6.4.0+sha.f6ec392) > AZ-Delivery ESP-32 Dev Kit C V4
HARDWARE: ESP32 240MHz, 520KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, 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.0.0+sha.bf822ef 
 - tool-esptoolpy @ 1.40501.0 (4.5.1) 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Converting edrumulus.ino
/tmp/tmpj5gstour/src/edrumulus.ino:45: warning: "MYMIDI" redefined
 #  define MYMIDI                     usbMIDI
 
/tmp/tmpj5gstour/src/edrumulus.ino:39: note: this is the location of the previous definition
 #  define MYMIDI                     MIDI
 
/tmp/tmpj5gstour/src/edrumulus.ino:46: warning: "MIDI_CONTROL_CHANGE_TYPE" redefined
 #  define MIDI_CONTROL_CHANGE_TYPE   usbMIDI.ControlChange
 
/tmp/tmpj5gstour/src/edrumulus.ino:40: note: this is the location of the previous definition
 #  define MIDI_CONTROL_CHANGE_TYPE   midi::ControlChange
 
/tmp/tmpj5gstour/src/edrumulus.ino:47: warning: "MIDI_SEND_AFTER_TOUCH" redefined
 #  define MIDI_SEND_AFTER_TOUCH      sendAfterTouchPoly
 
/tmp/tmpj5gstour/src/edrumulus.ino:41: note: this is the location of the previous definition
 #  define MIDI_SEND_AFTER_TOUCH      sendAfterTouch
 
KeyError: 'framework-arduinoespressif32-libs':
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/platformio/builder/main.py", line 173:
    env.SConscript("$BUILD_SCRIPT")
  File "/home/runner/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/runner/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/runner/.platformio/platforms/espressif32@src-5f117260f75b328038ec9d3fd0e14a68/builder/main.py", line 346:
    target_elf = env.BuildProgram()
  File "/home/runner/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242:
    return self.method(*nargs, **kwargs)
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/platformio/builder/tools/piobuild.py", line 61:
    env.ProcessProgramDeps()
  File "/home/runner/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242:
    return self.method(*nargs, **kwargs)
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/platformio/builder/tools/piobuild.py", line 121:
    env.BuildFrameworks(env.get("PIOFRAMEWORK"))
  File "/home/runner/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242:
    return self.method(*nargs, **kwargs)
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/platformio/builder/tools/piobuild.py", line 342:
    SConscript(env.GetFrameworkScript(name), exports="env")
  File "/home/runner/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 662:
    return method(*args, **kw)
  File "/home/runner/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/runner/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/runner/.platformio/platforms/espressif32@src-5f117260f75b328038ec9d3fd0e14a68/builder/frameworks/arduino.py", line 41:
    SConscript(
  File "/home/runner/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 662:
    return method(*args, **kw)
  File "/home/runner/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/runner/.platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/runner/.platformio/packages/framework-arduinoespressif32/tools/platformio-build.py", line 40:
    FRAMEWORK_LIBS_DIR = platform.get_package_dir("framework-arduinoespressif32-libs")
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/platformio/platform/_packages.py", line 32:
    pkg = self.get_package(name)
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/platformio/platform/_packages.py", line 29:
    return self.pm.get_package(spec or self.get_package_spec(name))
  File "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/platformio/platform/_packages.py", line 21:
    owner=self.packages[name].get("owner"),
========================== [FAILED] Took 4.31 seconds ==========================

@ivankravets
Copy link
Member Author

See the updated comment #1225 (comment)

@Jason2866
Copy link
Contributor

Jason2866 commented Nov 10, 2023

Adding Arduino 3.0.0 support is the only way to make the ESP32-C6 available for Arduino projects.
The needed changes are not that many, i have added Arduino 3.0.x alpha support in my Fork and bulding Arduino and IDF projects with the C6 are working.
We have ported Arduino project Tasmota to the C6 and it runs already surprisingly stable.

@Jason2866
Copy link
Contributor

Jason2866 commented Nov 10, 2023

If you're an Espressif user who relies on PlatformIO for your projects, kindly share your thoughts in the comments below and cast your vote on this matter. Once we gather enough interest from the Espressif community, we plan to reach out to the Espressif company and request a reconsideration of support for PlatformIO.

@ivankravets Does this mean that Espressif has dropped any support? Looking in current Arduino 3.0.0 code (branch master) everything regarding Platformio support is there.

@VojtechBartoska
Copy link

Hello all,

I do work in Arduino Core ESP32 project as a Project Manager so I would like to clarify this from our Team point of view.

Please take a look on this comment in original Pull request.

We also update a warning note in our documentation which should be a bit confusing.

To not duplicate what is written in original PR, we will be glad if PlatformIO supports our latest version and we are open to any contributions.

@ivankravets Feel free to contact us any time directly, we will be happy to discuss this if you see any points we can do differently.

Thanks

@0x0fe
Copy link

0x0fe commented Nov 22, 2023

Adding Arduino 3.0.0 support is the only way to make the ESP32-C6 available for Arduino projects.
The needed changes are not that many, i have added Arduino 3.0.x alpha support in my Fork and bulding Arduino and IDF projects with the C6 are working.
We have ported Arduino project Tasmota to the C6 and it runs already surprisingly stable.

@Jason2866
Do you know how i can setup the .ini file in a new project for using your 3.0.0 fork and 5.1 IDF at the same time (to keep the SDK menuConfig)?

@0x0fe
Copy link

0x0fe commented Nov 22, 2023

@ivankravets
there is something i dont understand, why is there a separate platformespressif32 core? It is based on arduinoespressif32, but always lags behind, and arduinoesp32 already lags behind IDF. So what is the point of this separate core? Why is PIO not using arduinoesp32 core as is directly?

I think a reason why many users use PIO is also to keep some of the arduinoesp32 APIs while having the possibility to modify the IDF SDK configuration (menuconfig) which is necessary in many cases and not possible in arduino, unless using the libbuilder (buggy and not convenient).

Maybe it would be wise for PIO to directly use arduinoesp32 core as is, and just focus on allowing users to run arduinoesp32 core along with IDF to keep access to menuconfig.

@mhaberler
Copy link

I am concerned about the viability of this repo long-term as folks like @Jason2866 have started to roll their own and this repo not catching up

I am currently using his https://github.com/tasmota/platform-espressif32/tree/Arduino/IDF5 branch and it works mostly great for me - even if I feel uneasy about relying on a private effort with unclear future - how do you see the longer-term perspective of your fork?

This fork has diverged from this repo massively - not sure this can brought back here easily

the other issue I have is the abysmal debugging experience esp32/pio/arduino compared to using straight IDF

@0x0fe
Copy link

0x0fe commented Nov 23, 2023

@mhaberler i did the same yesterday and used https://github.com/tasmota/platform-espressif32/tree/Arduino/IDF5

platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.0-alpha2
framework = 
	arduino
	espidf
board = esp32dev

But then when building it complained of missing SPIFFS, i added it manually from previous version (in components directory) but then i get a dependancy error with esp_partition.h, despite it is well present in "components".

   17 | #include "esp_partition.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Compiling .pio\build\esp32dev\tcp_transport\transport.o
Compiling .pio\build\esp32dev\tcp_transport\transport_ssl.o
Compiling .pio\build\esp32dev\tcp_transport\transport_internal.o
*** [.pio\build\esp32dev\spiffs\esp_spiffs.o] Error 1
*** [.pio\build\esp32dev\spiffs\spiffs_api.o] Error 1

Did you met this issue too?

@Jason2866
Copy link
Contributor

Jason2866 commented Nov 23, 2023

@0x0fe @mhaberler My fork has not the goal to be compatible to anything official.
The fork is made for project Tasmota. Everything is optimized for that use. The sdkconfig settings differs a lot from the official espressif ones. There are components added and others are removed (for example SPIFFS).
Breaking changes can and will happen.
Imho no reason to be concerned about support of Arduino Espressif. Platformio always do a release when a RELEASED core is available. Core 3.0.0 is in ALPHA state!

Since project Tasmota is always in first row for new stuff, and is active in contributing to espressif Arduino Core, there was the need to have the development version of Arduino Core available with Platformio.
Project Tasmota is only possible with Platformio. Thx again to the Team of Platformio (@ivankravets ) for this awesome IDE!!

The needed changes for Arduino 3.0 in Platformio are not many. A small job for @valeros

@0x0fe
Copy link

0x0fe commented Nov 23, 2023

@Jason2866 oh, i see, that explains the error with SPIFFS

@mhaberler
Copy link

alpha stage - fair enough.

Now assume Core 3.0.0 gets released - does this have any bearing on the debugging situation?

who has the ticket to make that work?

I'm talking about openocd + gdb versions and matching debug configs which work - at least somewhat like Nordic Connect and Segger

I admit I am slightly confused about players and the who-does-what-and-why-not - I might be barking up the wrong tree (or repo) for that matter

@Jason2866
Copy link
Contributor

@mhaberler Does debugging work in espressif IDF env setup? If yes imho Platformio has the job for the devices which are currently supported with IDF 5.1. Not saying it will be easy to solve or it will be done soon. The debug issue for the C6 is known and there is an open issue.

@mhaberler
Copy link

Did you met this issue too?

@0x0fe yes, same here `Failed to resolve component 'spiffs'

@mhaberler
Copy link

@mhaberler Does debugging work in espressif IDF env setup? If yes imho Platformio has the job for the devices which are currently supported with IDF 5.1. Not saying it will be easy to solve or it will be done soon. The debug issue for the C6 is known and there is an open issue.

you mean like command line/shell? yes, repeatably

@0x0fe
Copy link

0x0fe commented Nov 23, 2023

@mhaberler It makes sense, well SPIFFS yo ucan add it manually from previous version but then you will get an error with esp_partition, and i am not sure where to re-enable the SPIFFS module and dependencies correctly.

@ivankravets
Copy link
Member Author

I'm a bit confused. Why is there a separate platform-espressif32 core? It seems to be based on arduino-espressif32, but it always seems to lag behind...

https://github.com/platformio/platform-espressif32 isn't a core itself. It's a software piece that makes the PlatformIO Build API work seamlessly with Espressif 32 products within the PlatformIO ecosystem. If you check the source code of this repository, you'll find other integrations, like ESP-IDF. If we support Zephyr/ESP32, it'll also be found here.

Would it be smarter for PIO to directly use the arduinoesp32 core as it is?

We do use it directly (https://registry.platformio.org/tools/platformio/framework-arduinoespressif32). There's no common ground between Arduino IDE and PlatformIO. The "arduino" in PlatformIO is just a framework. PlatformIO supports over 10+ different frameworks. The reason many developers see PlatformIO as a "replacement for Arduino IDE" is due to source code compatibility and advanced project management with lots of configuration and collaboration features based on PlatformIO's unique declarative principles.

If you've tried another framework besides "arduino", you'd notice there's no difference in the configuration aspect. You and your team can focus on project development without wrestling with bootstrapping and collaboration issues.

Lastly, for a VSCode-based solution with native ESP32/Arduino core support, I recommend the Arduino IDE for VSCode extension backed by Microsoft. It's similar to Arduino IDE 2.0 but uses VSCode as the editor. Both leverage "arduino-cli", so the build system and workflows are the same.

@0x0fe
Copy link

0x0fe commented Nov 23, 2023

@ivankravets I see, glue logic layer. the totally different versioning between these platforms and the cores they implement is rather annoying, though.

@mhaberler
Copy link

@ivankravets make me understand what your recommendation means - are you saying:

When I prefer to use VSCode, I should take the Microsoft Arduino extension for VSCode and drop Platformio?

@ivankravets
Copy link
Member Author

@mhaberler, we value openness in our community and aim to give you the freedom to choose. If there's a newer version of the software not yet supported by PlatformIO, we won't hide it.

The current supported version is Arduino Core v2.x for ESP32. Our collaboration with Espressif, including discussions about renewal, is ongoing. It's worth noting that we have @VojtechBartoska, a project manager from Espressif, in this thread. We're all working together to ensure you receive the best features and support. We'll keep everyone posted on any updates to ensure a smooth continuation of our services.

@hoeken
Copy link

hoeken commented Nov 25, 2023

I can see there's a bit of political project stuff happening, but as an end-user, all I want to do is be able to use the latest Arduino framework. Consider this a vote of support for making that happen, however it needs to be.

@ivankravets
Copy link
Member Author

PlatformIO is a commercial open-source project. In the past, it used to be a paid service before 2020, following a business-to-consumer (B2C) model. Unexpectedly, PlatformIO gained widespread popularity among millions of developers globally. Consequently, we shifted our strategy to make powerful tools for professional embedded development freely accessible to everyone.

The active development and maintenance of PlatformIO, along with its infrastructure, are now supported by technology partners dedicated to delivering an excellent developer experience. Espressif was one such partner, and we appreciate their long-standing collaboration.

Currently, Espressif has ceased support for new products in PlatformIO, but rest assured, we are committed to providing support for existing Espressif products integrated before this change, as per our technology licensing policy. Your projects won't face disruptions, and services will continue as usual.

If there's significant interest from Espressif customers in PlatformIO, we'll reach out to Espressif and explore the possibility of continuing our collaboration.

If you have any questions or need clarification, feel free to ask. We're here to provide all the answers you need.

@mhaberler
Copy link

ok, so Espressif jumped ship

@ivankravets what does that mean for the subject topic - Arduino3?

your wording would suggest to me "no new Espressif releases - be it Arduino or ESP-IDF, existing releases go on life support"

are you saying this repo stops at ESP-IDF 5.1.1/Arduino2 until Espressif changes its mind ?

@Jason2866
Copy link
Contributor

Jason2866 commented Nov 28, 2023

@mhaberler Looks like: as long there is not enough feedback from Platformio users wanting actual espressif framework support, there is no good position from Platformio side to argument why espressif should invest money having Platformio support.
espressif is thinking supporting the ArduinoIDE toy is enough :-(

@ajay10000
Copy link

ajay10000 commented Mar 5, 2024

As an implementer rather than a coder, I just like to get things done. PlatformIO with arduinoespressif32 framework enables me to do just that. I use PlatformIO for other types of projects/coding and it helps me a great deal to have the IDE consistency and also the great editing/support features of the platform.

Because I am not a C coder, I find everything about how these things work together extremely confusing. I have spent days trying to work out whether ESP32-C6 could be supported or not. I decided to try the last few comments above (from @Jason2866 and @empewoow) and was thrilled this morning to get my standard MQTT client code to compile and run on an ESP32-C6, along with voltage measurement.

To get this to work, I have used a combination of adding a section to platform.ini:

[env:esp32c6]
board = esp32-c6-devkitc-1
platform = https://github.com/platformio/platform-espressif32.git
platform_packages =
	platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.0-alpha3
	platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-libs.git#idf-release/v5.1
monitor_speed = 115200
build_flags=
	-fexceptions
	-DESP32_STAGE
	-DESP_IDF_VERSION_MAJOR=5
	-DLIBRARIES_NO_LOG=1
	-DDISABLE_SC16IS752_SPI
	-DCONFIG_PM_ENABLE
	-DCONFIG_LWIP_L2_TO_L3_COPY
	-DCONFIG_FREERTOS_USE_TICKLESS_IDLE=1
	-DCONFIG_FREERTOS_IDLE_TIME_BEFORE_SLEEP=3
	-DNEOPIXEL_ESP32_RMT_DEFAULT
	-DCRON_USE_LOCAL_TIME
	-I$PROJECT_DIR/src/include
	-include "sdkconfig.h"

Some of these lines come from https://github.com/letscontrolit/ESPEasy/blob/mega/platformio_core_defs.ini as advised elsewhere. I'm not sure if they are all necessary.

I also added a file: /boards/esp32-c6-devkitc-1.json as per @Jason2866's #1225 (comment) (above, a few comments up).

A huge thank you to all, both paid and unpaid, for putting so much effort into these projects. I wish it was simpler to understand the versions and how they interact, but the fact that they are there in the first place is an amazing feat of human endeavour.

I hope to try some ZigBee code next and get an endpoint up and running. Now that would be something.

@sgryphon
Copy link

Hi @ivankravets . I'm wondering if you have had a chance to review my pull request to add Arduino ESP32 v3.0 support to PlatformIO. #1281

Thanks

(Note: This is not about Espressif supporting PlatformIO, but updating PlatformIO to support Espressif ESP32 v3.0, which was a relatively small change that I am happy to contribute to PlatformIO).

@hitecSmartHome
Copy link

Well. I, and my team are very confused hearing this. What is espressif thinking? As others said, the Arduino IDE is a toy. We need a much more robust IDE. Our project grow so much in the past year using PIO with arduino,idf, we can't go back to only arduino or only idf. Maybe its time to find an other chip... :( Really sucks to stuck on idf 4.4.0 and arduino 2.0.0...

@mhaberler
Copy link

Obviously espressif are thinking their VSCode plugin is a replacement for Platformio, which basically means developers are now in the business of helping develop and debug their plugin rather than their own code.

The chaps working on it are nice and try the best, but the results are beyond pale.

If you think this is too harsh a critique, have a read of its reviews

Frankly the IDE situation for espressif users is preposterous. And I have no idea why other companies being perfectly capably of coming up with a competitive product are letting espressif get away with this quality of developer support.

@Jason2866
Copy link
Contributor

Jason2866 commented Apr 26, 2024

We will know soon what happens. Platformio never supported not released versions.
In a few weeks espressif Arduino Core 3.0.0 will be released.
The few needed (breaking) changes in Platformio and Arduino Platformio scripts to support core 3.0.0 (where I did PRs for) are merged from espressif and Platformio.
There is no blocking of either sides.

@hitecSmartHome
Copy link

Well, if we can easily port our code to vscode idf from pio arduino,idf i see it as a win to use the latest. PIO was always behind on versions.

@sblantipodi
Copy link

I haven't understood one thing, is platofrmio going to support Arduino core 3 or not?

@kzlk
Copy link

kzlk commented May 8, 2024

Trying this config:

[env:esp32-s3-devkitc-1-n16r8v]
platform = espressif32
board = esp32-s3-devkitc-1-n16r8v
framework = arduino
platform_packages =
	platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.0-rc1
	platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-libs.git#idf-release/v5.1
lib_deps = 
	ESP_I2S@^1.0.0
	ESP_SR
	bodmer/TFT_eSPI@^2.5.43
	lvgl/lvgl@^9.1.0
	; fastled/FastLED@^3.6.0
	adafruit/RTClib@^2.1.4
	gyverlibs/GyverBME280@^1.5.2
	
; lib_ldf_mode = deep+
build_flags = -DCORE_DEBUG_LEVEL=5 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -Wdeprecated-declarations -Ofast
build_type = debug
monitor_speed = 115200
board_build.arduino.memory_type = dio_opi
monitor_filters = esp32_exception_decoder
board_build.partitions = partitions.csv

But got this error: _* [.pio\build\esp32-s3-devkitc-1-n16r8v\bootloader.bin] Source C:\Users\dkozl\.platformio\packages\framework-arduinoespressif32-libs\esp32s3\bin\bootloader_qio_.elf' not found, needed by target .pio\build\esp32-s3-devkitc-1-n16r8v\bootloader.bin'._**

@Jason2866
Copy link
Contributor

Jason2866 commented May 8, 2024

Pin the platform! the memory mode is not valid. This should work

[env:esp32-s3-devkitc-1-n16r8v]
platform = espressif32 @ 6.6.0
framework = arduino
board = esp32-s3-devkitc-1

# Configure options for the N16R8V variant
build_flags= -DBOARD_HAS_PSRAM
board_build.arduino.memory_type = qio_opi 
board_build.partitions = default_16MB.csv
board_upload.flash_size = 16MB

platform_packages
	platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git
	platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-libs.git#idf-release/v5.1
lib_deps = 
	bodmer/TFT_eSPI@^2.5.43
	lvgl/lvgl@^9.1.0
	; fastled/FastLED@^3.6.0
	adafruit/RTClib@^2.1.4
	gyverlibs/GyverBME280@^1.5.2
	
build_type = release
monitor_speed = 115200
monitor_filters = esp32_exception_decoder

The error you see is from a wrong setup for the board. PSRAM fixes are not needed for S3/S2.

@Jason2866
Copy link
Contributor

Better use this boards.json
https://github.com/platformio/platform-espressif32/blob/deb6aa342245ad7bcb3d9ed69050f203779833ab/boards/esp32-s3-devkitc-1-n16r8v.json
and remove any entry which changes boards stuff.

@kzlk
Copy link

kzlk commented May 8, 2024

@Jason2866 thanks for your reply, it solved my problem described above.
But another problem happened with Arduino Core 3.0.0-rc1 in PlatfromIO, but in Arduino IDE with Arduino Core 3.0.0-rc1 works as expected. Also this problem not reproduce with Arduino Core 2 in PlatformIO.

main.ino

#include <TFT_eSPI.h> // Hardware-specific library
#include <SPI.h>

TFT_eSPI tft = TFT_eSPI();       // Invoke custom library
void setup(void) {
  tft.begin();   <---- CAUSE OF ERROR
}
void loop() {
}

Expected result: App successfully launched
Actual result:

Rebooting...
�ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40379886
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3818,len:0x508
load:0x403c9700,len:0x4
load:0x403c9704,len:0xad0
load:0x403cc700,len:0x29e4
entry 0x403c9880
Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x42002c6b  PS      : 0x00060e30  A0      : 0x82002cf8  A1      : 0x3fcec130  
A2      : 0x00000010  A3      : 0x00000000  A4      : 0x60004000  A5      : 0x0000000b  
A6      : 0x000000ff  A7      : 0x00000008  A8      : 0x08000000  A9      : 0x3fcec100  
A10     : 0x3fc975fc  A11     : 0x00000001  A12     : 0x02160ec0  A13     : 0xffffffff  
A14     : 0x00000031  A15     : 0x00000000  SAR     : 0x00000006  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00000010  LBEG    : 0x4201a1d0  LEND    : 0x4201a217  LCOUNT  : 0x00000000  


Backtrace: 0x42002c68:0x3fcec130 0x42002cf5:0x3fcec160 0x42002d00:0x3fcec180 0x42001cb5:0x3fcec1a0 0x4200657e:0x3fcec1c0

platformio.ini

[env:esp32-s3-devkitc-1-n16r8v]
platform = espressif32 @6.6.0
board = esp32-s3-devkitc-1-n16r8v
framework = arduino
platform_packages =
	platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git
	platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-libs.git#idf-release/v5.1
lib_deps = 
	bodmer/TFT_eSPI@^2.5.43
build_type = release
monitor_speed = 115200
monitor_filters = esp32_exception_decoder

Assets:
Arduino Core: 3.0.0-rc1
Board: esp32-s3-devkitc-1-n16r8v
IDE: VS Code with PlatformIO
Library: TFT_eSPI@^2.5.43

@Jason2866
Copy link
Contributor

Jason2866 commented May 8, 2024

Off topic. There is no software programming support. Just can say we are using our Platformio fork to compile project Tasmota and it does work as expected.

@hitecSmartHome
Copy link

Pin the platform! the memory mode is not valid. This should work

[env:esp32-s3-devkitc-1-n16r8v]
platform = espressif32 @ 6.6.0
framework = arduino
board = esp32-s3-devkitc-1

# Configure options for the N16R8V variant
build_flags= -DBOARD_HAS_PSRAM
board_build.arduino.memory_type = qio_opi 
board_build.partitions = default_16MB.csv
board_upload.flash_size = 16MB

platform_packages
	platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git
	platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-libs.git#idf-release/v5.1
lib_deps = 
	bodmer/TFT_eSPI@^2.5.43
	lvgl/lvgl@^9.1.0
	; fastled/FastLED@^3.6.0
	adafruit/RTClib@^2.1.4
	gyverlibs/GyverBME280@^1.5.2
	
build_type = release
monitor_speed = 115200
monitor_filters = esp32_exception_decoder

The error you see is from a wrong setup for the board. PSRAM fixes are not needed for S3/S2.

Strange, i got these errors

fatal: not a git repository (or any of the parent directories): .git
CMake Error at C:/Users/Pc/.platformio/packages/[email protected]/tools/cmake/build.cmake:463 (message):
  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  WARNING: Component "idf" not found

  ERROR: Because project depends on idf (>=5.1) which doesn't match any
  versions, version solving failed.

Call Stack (most recent call first):
  C:/Users/Pc/.platformio/packages/[email protected]/tools/cmake/project.cmake:476 (idf_build_process)
  CMakeLists.txt:4 (project)



========================= [FAILED] Took 57.84 seconds 

@Jason2866
Copy link
Contributor

Platformio seems screwed up. Close VSC and delete the hidden folder .platformio with all content. After restart VSC will rebuild Platformio and should work again.

@hitecSmartHome
Copy link

I've got a .pio folder. Will try to delete that.

@hitecSmartHome
Copy link

Platformio seems screwed up. Close VSC and delete the hidden folder .platformio with all content. After restart VSC will rebuild Platformio and should work again.

I have deleted .pio folder, restarted vscode and i got the same error :/

@hitecSmartHome
Copy link

This is my PIO.ini

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[platformio]
build_cache_dir = ./cache

[env:esp-wrover-kit]
check_skip_packages = yes
platform = espressif32 @6.6.0
board = esp-wrover-kit
framework = arduino, espidf
platform_packages =
	platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git
	platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-libs.git#idf-release/v5.1
board_build.filesystem = littlefs

upload_speed    = 921600

monitor_speed   = 115200
monitor_filters = colorize, esp32_exception_decoder

board_upload.flash_size = 16MB
board_build.flash_mode = qio
board_build.partitions = ./Partitions/hshPartition_APP_3MB.csv
board_build.f_cpu   = 240000000L
board_build.f_flash = 80000000L


build_flags = 
    -DBOARD_HAS_PSRAM
    -mfix-esp32-psram-cache-issue
    -mfix-esp32-psram-cache-strategy=memw
    -DCONFIG_SPIRAM_USE_MALLOC=1
    -DCONFIG_MBEDTLS_DYNAMIC_BUFFER=1
    -DCONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=1
    -DCONFIG_SPIRAM_CACHE_WORKAROUND=1
    -DCORE_DEBUG_LEVEL=0
    -std=gnu++17

build_unflags =
    -std=gnu++11

@Jason2866
Copy link
Contributor

Jason2866 commented May 14, 2024

You changed the setup too framework = arduino, espidf. This is not working. The error is as expected.
The subject of this issue is support for Arduino and not Arduino as an component from IDF. You are off topic.

@hitecSmartHome
Copy link

Oh, i see.... :(

@hitecSmartHome
Copy link

Thank you for the clarification

@szerwi
Copy link

szerwi commented May 15, 2024

Looking through this long thread, I haven't catched one important thing and I'm not alone with that - @sblantipodi also didn't catch that.
Will arduino-esp32 v3.0.0 be supported in PlatformIO? If yes, then when? Once it become stable version?
Can someone from PlatformIO give clear statement about it? I believe a lot of people use PlatformIO for their projects and not supporting arduino-esp32 3.0.0 at all would be very disappointing.

@hitecSmartHome
Copy link

Espressif does not support PIO. They stopped. PIO said they want to support us but if Espressif does not give them money for it, they wont. So they will wait for enough user feedback to go to Espressif for support. Until this resolves, we are ( as users of PIO ) not supported.

@sblantipodi
Copy link

sblantipodi commented May 21, 2024

I don't know if this is the best way to proceed:
If you're an Espressif user who relies on PlatformIO for your projects, kindly share your thoughts in the comments below and cast your vote on this matter. Once we gather enough interest from the Espressif community, we plan to reach out to the Espressif company and request a reconsideration of support for PlatformIO.
I mean, I'm sure that there are so many users who does not use GitHub or that does not know about this issue that can't comment on this.

I'm not an expert and I have nothing to teach to Ivan but sharing some data from the PlatformIO registry that shows how many users uses PlatformIO could be a better indicator for Espressif than some comments on an issue like this.

I really hope that things will move forward on this topic, this "uncertainty" is not good for the PlatformIO project and for all the people that uses it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests