Unable to create a precompiled Library for ESP32 boards

Continuing the discussion from Precompiling a big library?:

First of all thankyou so much for providing this Tutorial.
I followed your whole tutorial and created a precompiled file(.a) for AVR boards(Arduino Uno to be specific).
But I am unable to do the same for esp32 boards, Basically in console I am not getting any mmcu/mcpu flag.
Do you know why this might be happening?

Continuing the discussion from IDE doesn't try to find precompiled library:

Hey did you find any solution on how to clear this error when using a precompiled(.a) file with the esp32 boards??

Using the above tutorial I was able to use the created .a file for AVR(arduino) boards.
But when I try to follow same steps for esp32 and also esp8266 boards I am unable to get the mmcu/mcpu flag name for this boards.
Did you find any solution on how to solve this problem

I have merged your cross-posts @gaddbar.

Cross-posting is against the Arduino forum rules. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting can result in a suspension from the forum.

In the future, please only create one topic for each distinct subject matter. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

Hi @gaddbar.

Here are the folder names for the precompiled archives:

Microcontroller Folder Name
Original ESP32 esp32
ESP32-C3 esp32c3
ESP32-C6 esp32c6
ESP32-H2 esp32h2
ESP32-S2 esp32s2
ESP32-s3 esp32s3
ESP8266 esp8266

You can actually get Arduino IDE to tell you the folder name you should use. I'll provide instructions you can follow to do that:

  1. Add the following line to the to the library's library.properties file:
    dot_a_linkage=true
    
  2. Save the file.
  3. Create a sketch in Arduino IDE that contains an #include directive for the library's header file.
  4. Select the target board from Arduino IDE's Tools > Board menu.
  5. Select Sketch > Verify/Compile from the Arduino IDE menus.
  6. Wait for the compilation to fail.
    It is expected to fail since we haven't provided a precompiled archive file for this board's architecture yet.

Now examine the contents of the black "Ouput" panel at the bottom of the Arduino IDE window. You might need to scroll the panel up to see it all. There you will see a message with this form:

Precompiled library in "C:\Users\per\Documents\Arduino\libraries\Blink\src\esp32h2" not found

In this example, we can see that the precompiled archive file for this board should be placed under a folder named esp32h2.

1 Like

I see, I followed this steps and did the same for esp8266 board and i got it
thankyou so much for your help.

Sorry for causing problems.
I will keep this in mind next time posting anything.
and thankyou so much for your post

1 Like

You are welcome. I'm glad it is working now.

Regards,
Per

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.