Page 1 of 1

Where to find the archives source code?

Posted: Wed Apr 14, 2021 4:01 pm
by kmulier
I'm co-founder of a startup building a new IDE for microcontrollers: Embeetle IDE. We would like to support the ESP32 microcontroller family in our IDE.

Unfortunately, I'm running into a problem. To create a first ESP32-based sample project for our IDE, I was observing the build-output at maximal verbosity in the Arduino IDE. It occurred to me that a lot of precompiled libraries (archives) are being used:

Image



In Embeetle, we try to avoid precompiled libraries. You see, they break the code navigation. If a user clicks on a function call, he expects to jump to the function definition. If that function is defined in a precompiled library - the code navigation doesn't work.

Where can I find the source code for all these precompiled libraries?

Thank you for your help.

Kind regards,
Kristof Mulier

Re: Where to find the archives source code?

Posted: Thu Apr 15, 2021 8:43 am
by ESP_Sprite
Those are (mostly) esp-idf libraries; the sources are in esp-idf. See e.g. here for how they get built.

Re: Where to find the archives source code?

Posted: Thu Apr 15, 2021 2:52 pm
by lbernstone
You may want to look at how platform.io handles this. They have two mechanisms for building arduino- using pre-compiled libraries from arduino-esp32, and building from esp-idf source + arduino-esp32 source. If you can use their python scripts it may save you a lot of duplicated effort.
Note that you won't be able to get away from some pre-compiled libraries, as the hardware drivers are not open source, so you will need some way to incorporate headers to provide those symbols.

Re: Where to find the archives source code?

Posted: Sat Apr 17, 2021 11:40 am
by kmulier
Thank you @ESP_Sprite and @Ibernstone for the link and the useful information.

First I'd like to support the Arduino-based ESP32 projects in our Embeetle IDE. I've more knowledge about Arduino IDE than Platform IO, as I've built an importer for Arduino projects some time ago (this importer transforms an Arduino sketch file into a self-contained C/C++ makefile-based project, such that it can be opened in Embeetle). That being said, I will look into the Platform IO solution also, later on, to discover how they approached all of this.

The Arduino IDE generates this `sdkconfig` file in its cache:
```
~/.arduino15/packages/esp32/hardware/esp32/1.0.6/tools/sdk/sdkconfig
```

It sits right next to the folder where all the precompiled libraries are stored! So it must be related to them. If I create a "hello-world" project with the ESP-IDF tool, and I replace the default `sdkconfig` file in that "hello-world" project with the one from Arduino, then I can do a full-verbosity build and see *exactly* how the precompiled libraries from Arduino are being built.

Is this theory correct?

If yes, I have one more question. For a given target chip/board (eg. the `ESP32 PICO KIT` I'm using now), will this `sdkconfig` file that I located in the Arduino cache always be the same? This is important to know if I ever build an ESP32-Arduino-sketch importer for Embeetle IDE. You see, if I can assume that the `sdkconfig` file used by Arduino IDE is stable for a specific target chip/board, then that would make the construction of such an importer much simpler.