Disable components from IDF

eriksl
Posts: 112
Joined: Thu Dec 14, 2023 3:23 pm
Location: Netherlands

Disable components from IDF

Postby eriksl » Mon May 20, 2024 9:47 am

Is there a way to disable certain components of the IDF?

I understand that unused components are not included in the image (app), but my problem is that every time I need to a compilation (of even one single file), idf is checking ALL components for changes and it really takes a while, it's frustrating. There are quite a few components I will never use, so I'd like to at least disable them.

sudeep-mohanty
Posts: 6
Joined: Tue Aug 15, 2023 10:49 am

Re: Disable components from IDF

Postby sudeep-mohanty » Mon May 20, 2024 2:36 pm

Hi, In your project level CMakeLists.txt file, you may set COMPONENTS like

Code: Select all

set(COMPONENTS main)
before the call to

Code: Select all

project()
to restrict the number of components that are built.

eriksl
Posts: 112
Joined: Thu Dec 14, 2023 3:23 pm
Location: Netherlands

Re: Disable components from IDF

Postby eriksl » Mon May 20, 2024 5:26 pm

Yeah, works, thanks!

A few notes:
- many components remain active nonetheless because other components depend on them (which was to be expected)
- a few components (in my case: bt, esp_psram, wear_levelling) must be included explicitly otherwise the functionality will lack
- most components (all minus above and minus "main") can be left out anyway
- this will mess with your sdkconfig file. Make sure you make a backup first or be prepared to all configuring from scratch
- compare original and adjusted sdkconfig to see what components are missing (their config will be removed), if some are actually required, you can add them manually
- look in esp-idf/components for components' names. Don't be fooled by the output of idf (using __some_name) that's not what this option expects.

Who is online

Users browsing this forum: No registered users and 63 guests