Where to find the archives source code?

User avatar
kmulier
Posts: 7
Joined: Wed Apr 14, 2021 3:49 pm

Where to find the archives source code?

Postby kmulier » Wed Apr 14, 2021 4:01 pm

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

ESP_Sprite
Posts: 8999
Joined: Thu Nov 26, 2015 4:08 am

Re: Where to find the archives source code?

Postby ESP_Sprite » Thu Apr 15, 2021 8:43 am

Those are (mostly) esp-idf libraries; the sources are in esp-idf. See e.g. here for how they get built.

lbernstone
Posts: 659
Joined: Mon Jul 22, 2019 3:20 pm

Re: Where to find the archives source code?

Postby lbernstone » Thu Apr 15, 2021 2:52 pm

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.

User avatar
kmulier
Posts: 7
Joined: Wed Apr 14, 2021 3:49 pm

Re: Where to find the archives source code?

Postby kmulier » Sat Apr 17, 2021 11:40 am

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.

Who is online

Users browsing this forum: Dloranger and 63 guests